@@ -9,10 +9,12 @@ namespace: "{{ .Release.Namespace }}"
99namePrefix : capi-operator-
1010
1111# Labels to add to all resources and selectors.
12- commonLabels :
13- clusterctl.cluster.x-k8s.io/core : " capi-operator"
12+ labels :
13+ - includeSelectors : true
14+ pairs :
15+ clusterctl.cluster.x-k8s.io/core : " capi-operator"
1416
15- bases :
17+ resources :
1618- ../crd
1719- ../rbac
1820# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
@@ -27,40 +29,102 @@ patches:
2729- path : patches/keep-crds.yaml
2830 target :
2931 kind : CustomResourceDefinition
32+ - path : webhookcainjection_patch.yaml
3033
31- patchesStrategicMerge :
32- # [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
33- # Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
34- # 'CERTMANAGER' needs to be enabled to use ca injection
35- - webhookcainjection_patch.yaml
36-
37- configurations :
38- - kustomizeconfig.yaml
39- vars :
40- # [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
41- - name : CERTIFICATE_NAMESPACE # namespace of the certificate CR
42- objref :
34+ replacements :
35+ - source : # Add cert-manager annotation to ValidatingWebhookConfiguration, MutatingWebhookConfiguration and CRDs
4336 kind : Certificate
4437 group : cert-manager.io
4538 version : v1
4639 name : serving-cert # this name should match the one in certificate.yaml
47- fieldref :
48- fieldpath : metadata.namespace
49- - name : CERTIFICATE_NAME
50- objref :
40+ fieldPath : .metadata.namespace # namespace of the certificate CR
41+ targets :
42+ - select :
43+ kind : ValidatingWebhookConfiguration
44+ fieldPaths :
45+ - .metadata.annotations.[cert-manager.io/inject-ca-from]
46+ options :
47+ delimiter : ' /'
48+ index : 0
49+ create : true
50+ - select :
51+ kind : MutatingWebhookConfiguration
52+ fieldPaths :
53+ - .metadata.annotations.[cert-manager.io/inject-ca-from]
54+ options :
55+ delimiter : ' /'
56+ index : 0
57+ create : true
58+ - select :
59+ kind : CustomResourceDefinition
60+ fieldPaths :
61+ - .metadata.annotations.[cert-manager.io/inject-ca-from]
62+ options :
63+ delimiter : ' /'
64+ index : 0
65+ create : true
66+ - source :
5167 kind : Certificate
5268 group : cert-manager.io
5369 version : v1
5470 name : serving-cert # this name should match the one in certificate.yaml
55- - name : SERVICE_NAMESPACE # namespace of the service
56- objref :
71+ fieldPath : .metadata.name
72+ targets :
73+ - select :
74+ kind : ValidatingWebhookConfiguration
75+ fieldPaths :
76+ - .metadata.annotations.[cert-manager.io/inject-ca-from]
77+ options :
78+ delimiter : ' /'
79+ index : 1
80+ create : true
81+ - select :
82+ kind : MutatingWebhookConfiguration
83+ fieldPaths :
84+ - .metadata.annotations.[cert-manager.io/inject-ca-from]
85+ options :
86+ delimiter : ' /'
87+ index : 1
88+ create : true
89+ - select :
90+ kind : CustomResourceDefinition
91+ fieldPaths :
92+ - .metadata.annotations.[cert-manager.io/inject-ca-from]
93+ options :
94+ delimiter : ' /'
95+ index : 1
96+ create : true
97+ - source : # Add cert-manager annotation to the webhook Service
5798 kind : Service
5899 version : v1
59100 name : webhook-service
60- fieldref :
61- fieldpath : metadata.namespace
62- - name : SERVICE_NAME
63- objref :
101+ fieldPath : .metadata.name # namespace of the service
102+ targets :
103+ - select :
104+ kind : Certificate
105+ group : cert-manager.io
106+ version : v1
107+ fieldPaths :
108+ - .spec.dnsNames.0
109+ - .spec.dnsNames.1
110+ options :
111+ delimiter : ' .'
112+ index : 0
113+ create : true
114+ - source :
64115 kind : Service
65116 version : v1
66117 name : webhook-service
118+ fieldPath : .metadata.namespace # namespace of the service
119+ targets :
120+ - select :
121+ kind : Certificate
122+ group : cert-manager.io
123+ version : v1
124+ fieldPaths :
125+ - .spec.dnsNames.0
126+ - .spec.dnsNames.1
127+ options :
128+ delimiter : ' .'
129+ index : 1
130+ create : true
0 commit comments