Skip to content

Document custom annotation behaviour #1501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion content/docs/releases/release-notes/release-notes-1.18.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ cert-manager v1.18 includes:

## Major Themes

### TODO
### Copy annotations from Ingress or Gateway to the Certificate

We've added a new configuration option to the cert-manager controller: `--extra-certificate-annotations`, which allows you to specify annotation keys to be copied from an Ingress or Gateway resource to the resulting Certificate object.
Read [Annotated Ingress resource: Copy annotations to the Certificate](../../usage/ingress.md#copy-annotations-to-the-certificate ), and
[Annotated Gateway resource: Copy annotations to the Certificate](../../usage/gateway.md#copy-annotations-to-the-certificate), to learn more.

## Community

Expand Down
34 changes: 34 additions & 0 deletions content/docs/usage/gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,40 @@ Certificate resources:
configure `spec.privateKey.rotationPolicy` field to set the rotation policy of the private key for a Certificate.
Valid values are `Never` and `Always`. If unset a rotation policy `Never` will be used.

## Copy annotations to the Certificate

> ℹ️ This feature was added in cert-manager `v1.18.0`.

It is possible to copy any specific custom annotation into the generated `Certificate` objects.
For example, to copy the annotation: `venafi.cert-manager.io/custom-fields` from the Gateway to the Certificate,
you must first redeploy the cert-manager controller with the following extra argument:

```
--extra-certificate-annotations=venafi.cert-manager.io/custom-fields
```

Or if you use Helm, supply the following values:

```yaml
# values.yaml
config:
ingressShimConfig:
extraCertificateAnnotations:
- venafi.cert-manager.io/custom-fields
```

Then you can add the annotation to the Gateway resource:

```yaml
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: example
annotations:
# custom venafi configuration
venafi.cert-manager.io/custom-fields: `[ {"name": "field-name", "value": "field value"}]`
```

## Inner workings diagram for developers

<object data="/images/request-certificate-debug/gateway-shim-flow.svg"></object>
Expand Down
35 changes: 35 additions & 0 deletions content/docs/usage/ingress.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,41 @@ trigger Certificate resources to be automatically created:
configure `spec.privateKey.rotationPolicy` field to set the rotation policy of the private key for a Certificate.
Valid values are `Never` and `Always`. If unset a rotation policy `Never` will be used.

## Copying annotations to the Certificate

> ℹ️ This feature was added in cert-manager `v1.18.0`.

It is possible to copy any specific custom annotation into the generated `Certificate` objects.
For example, to copy the annotation: `venafi.cert-manager.io/custom-fields` from the Ingress to the Certificate,
you must first redeploy the cert-manager controller with the following extra argument:

```
--extra-certificate-annotations=venafi.cert-manager.io/custom-fields
```

Or if you use Helm, supply the following values:

```yaml
# values.yaml
config:
ingressShimConfig:
extraCertificateAnnotations:
- venafi.cert-manager.io/custom-fields
```

Then you can add the annotation to the Ingress resource:

```yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
# custom venafi configuration
venafi.cert-manager.io/custom-fields: `[ {"name": "field-name", "value": "field value"}]`
name: myIngress
namespace: myIngress
```

## Generate multiple certificates with multiple ingresses

If you need to generate certificates from multiple ingresses make sure it has the issuer annotation.
Expand Down