Skip to content

Commit 59e6296

Browse files
Merge pull request #1501 from AbsaOSS/ingress_shim_annotations
Document custom annotation behaviour
2 parents d9fbc01 + 5c313bb commit 59e6296

File tree

3 files changed

+74
-1
lines changed

3 files changed

+74
-1
lines changed

content/docs/releases/release-notes/release-notes-1.18.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ cert-manager v1.18 includes:
99

1010
## Major Themes
1111

12-
### TODO
12+
### Copy annotations from Ingress or Gateway to the Certificate
13+
14+
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.
15+
Read [Annotated Ingress resource: Copy annotations to the Certificate](../../usage/ingress.md#copy-annotations-to-the-certificate ), and
16+
[Annotated Gateway resource: Copy annotations to the Certificate](../../usage/gateway.md#copy-annotations-to-the-certificate), to learn more.
1317

1418
## Community
1519

content/docs/usage/gateway.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,40 @@ Certificate resources:
438438
configure `spec.privateKey.rotationPolicy` field to set the rotation policy of the private key for a Certificate.
439439
Valid values are `Never` and `Always`. If unset a rotation policy `Never` will be used.
440440

441+
## Copy annotations to the Certificate
442+
443+
> ℹ️ This feature was added in cert-manager `v1.18.0`.
444+
445+
It is possible to copy any specific custom annotation into the generated `Certificate` objects.
446+
For example, to copy the annotation: `venafi.cert-manager.io/custom-fields` from the Gateway to the Certificate,
447+
you must first redeploy the cert-manager controller with the following extra argument:
448+
449+
```
450+
--extra-certificate-annotations=venafi.cert-manager.io/custom-fields
451+
```
452+
453+
Or if you use Helm, supply the following values:
454+
455+
```yaml
456+
# values.yaml
457+
config:
458+
ingressShimConfig:
459+
extraCertificateAnnotations:
460+
- venafi.cert-manager.io/custom-fields
461+
```
462+
463+
Then you can add the annotation to the Gateway resource:
464+
465+
```yaml
466+
apiVersion: gateway.networking.k8s.io/v1
467+
kind: Gateway
468+
metadata:
469+
name: example
470+
annotations:
471+
# custom venafi configuration
472+
venafi.cert-manager.io/custom-fields: `[ {"name": "field-name", "value": "field value"}]`
473+
```
474+
441475
## Inner workings diagram for developers
442476

443477
<object data="/images/request-certificate-debug/gateway-shim-flow.svg"></object>

content/docs/usage/ingress.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,41 @@ trigger Certificate resources to be automatically created:
177177
configure `spec.privateKey.rotationPolicy` field to set the rotation policy of the private key for a Certificate.
178178
Valid values are `Never` and `Always`. If unset a rotation policy `Never` will be used.
179179

180+
## Copying annotations to the Certificate
181+
182+
> ℹ️ This feature was added in cert-manager `v1.18.0`.
183+
184+
It is possible to copy any specific custom annotation into the generated `Certificate` objects.
185+
For example, to copy the annotation: `venafi.cert-manager.io/custom-fields` from the Ingress to the Certificate,
186+
you must first redeploy the cert-manager controller with the following extra argument:
187+
188+
```
189+
--extra-certificate-annotations=venafi.cert-manager.io/custom-fields
190+
```
191+
192+
Or if you use Helm, supply the following values:
193+
194+
```yaml
195+
# values.yaml
196+
config:
197+
ingressShimConfig:
198+
extraCertificateAnnotations:
199+
- venafi.cert-manager.io/custom-fields
200+
```
201+
202+
Then you can add the annotation to the Ingress resource:
203+
204+
```yaml
205+
apiVersion: networking.k8s.io/v1
206+
kind: Ingress
207+
metadata:
208+
annotations:
209+
# custom venafi configuration
210+
venafi.cert-manager.io/custom-fields: `[ {"name": "field-name", "value": "field value"}]`
211+
name: myIngress
212+
namespace: myIngress
213+
```
214+
180215
## Generate multiple certificates with multiple ingresses
181216
182217
If you need to generate certificates from multiple ingresses make sure it has the issuer annotation.

0 commit comments

Comments
 (0)