@@ -28,32 +28,77 @@ components:
2828 # To disable cert-manager comment out the following line, the 'webhook' component is required
2929 - ../certmanager
3030
31- # the following config is for teaching kustomize how to do var substitution
32- vars :
33- # [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
34- - name : CERTIFICATE_NAMESPACE # namespace of the certificate CR
35- objref :
31+ replacements :
32+ # The following patches adds a directive for certmanager to inject CA into the CRD
33+ # CRD conversion requires k8s 1.13 or later.
34+ - source :
3635 kind : Certificate
37- group : cert-manager.io
38- version : v1
39- name : serving-cert # this name should match the one in certificate.yaml
40- fieldref :
41- fieldpath : metadata.namespace
42- - name : CERTIFICATE_NAME
43- objref :
36+ fieldPath : metadata.namespace
37+ targets :
38+ - select :
39+ kind : CustomResourceDefinition
40+ fieldPaths :
41+ - metadata.annotations.[cert-manager.io/inject-ca-from]
42+ options :
43+ delimiter : /
44+ - select :
45+ kind : MutatingWebhookConfiguration
46+ fieldPaths :
47+ - metadata.annotations.[cert-manager.io/inject-ca-from]
48+ options :
49+ delimiter : /
50+ - select :
51+ kind : ValidatingWebhookConfiguration
52+ fieldPaths :
53+ - metadata.annotations.[cert-manager.io/inject-ca-from]
54+ options :
55+ delimiter : /
56+ - source :
4457 kind : Certificate
45- group : cert-manager.io
46- version : v1
47- name : serving-cert # this name should match the one in certificate.yaml
48- - name : SERVICE_NAMESPACE # namespace of the service
49- objref :
58+ fieldPath : metadata.name
59+ targets :
60+ - select :
61+ kind : CustomResourceDefinition
62+ fieldPaths :
63+ - metadata.annotations.[cert-manager.io/inject-ca-from]
64+ options :
65+ delimiter : /
66+ index : 1
67+ - select :
68+ kind : MutatingWebhookConfiguration
69+ fieldPaths :
70+ - metadata.annotations.[cert-manager.io/inject-ca-from]
71+ options :
72+ delimiter : /
73+ index : 1
74+ - select :
75+ kind : ValidatingWebhookConfiguration
76+ fieldPaths :
77+ - metadata.annotations.[cert-manager.io/inject-ca-from]
78+ options :
79+ delimiter : /
80+ index : 1
81+ # Patch dnsNames in webhook Service
82+ - source :
5083 kind : Service
51- version : v1
52- name : webhook-service
53- fieldref :
54- fieldpath : metadata.namespace
55- - name : SERVICE_NAME
56- objref :
84+ fieldPath : metadata.name
85+ targets :
86+ - select :
87+ kind : Certificate
88+ name : serving-cert
89+ fieldPaths :
90+ - spec.dnsNames.*
91+ options :
92+ delimiter : .
93+ - source :
5794 kind : Service
58- version : v1
59- name : webhook-service
95+ fieldPath : metadata.namespace
96+ targets :
97+ - select :
98+ kind : Certificate
99+ name : serving-cert
100+ fieldPaths :
101+ - spec.dnsNames.*
102+ options :
103+ delimiter : .
104+ index : 1
0 commit comments