@@ -20,33 +20,135 @@ patches:
20
20
# Enable webhook.
21
21
- path : manager_webhook_patch.yaml
22
22
23
- vars :
24
- - name : CERTIFICATE_NAMESPACE # namespace of the certificate CR
25
- objref :
23
+ replacements :
24
+ - source : # Add cert-manager annotation to ValidatingWebhookConfiguration, MutatingWebhookConfiguration and CRDs
26
25
kind : Certificate
27
26
group : cert-manager.io
28
27
version : v1
29
28
name : serving-cert # this name should match the one in certificate.yaml
30
- fieldref :
31
- fieldpath : metadata.namespace
32
- - name : CERTIFICATE_NAME
33
- objref :
29
+ fieldPath : .metadata.namespace # namespace of the certificate CR
30
+ targets :
31
+ - select :
32
+ kind : ValidatingWebhookConfiguration
33
+ fieldPaths :
34
+ - .metadata.annotations.[cert-manager.io/inject-ca-from]
35
+ options :
36
+ delimiter : ' /'
37
+ index : 0
38
+ create : true
39
+ - select :
40
+ kind : MutatingWebhookConfiguration
41
+ fieldPaths :
42
+ - .metadata.annotations.[cert-manager.io/inject-ca-from]
43
+ options :
44
+ delimiter : ' /'
45
+ index : 0
46
+ create : true
47
+ - select :
48
+ kind : CustomResourceDefinition
49
+ fieldPaths :
50
+ - .metadata.annotations.[cert-manager.io/inject-ca-from]
51
+ options :
52
+ delimiter : ' /'
53
+ index : 0
54
+ create : true
55
+ - source :
34
56
kind : Certificate
35
57
group : cert-manager.io
36
58
version : v1
37
59
name : serving-cert # this name should match the one in certificate.yaml
38
- - name : SERVICE_NAMESPACE # namespace of the service
39
- objref :
60
+ fieldPath : .metadata.name
61
+ targets :
62
+ - select :
63
+ kind : ValidatingWebhookConfiguration
64
+ fieldPaths :
65
+ - .metadata.annotations.[cert-manager.io/inject-ca-from]
66
+ options :
67
+ delimiter : ' /'
68
+ index : 1
69
+ create : true
70
+ - select :
71
+ kind : MutatingWebhookConfiguration
72
+ fieldPaths :
73
+ - .metadata.annotations.[cert-manager.io/inject-ca-from]
74
+ options :
75
+ delimiter : ' /'
76
+ index : 1
77
+ create : true
78
+ - select :
79
+ kind : CustomResourceDefinition
80
+ fieldPaths :
81
+ - .metadata.annotations.[cert-manager.io/inject-ca-from]
82
+ options :
83
+ delimiter : ' /'
84
+ index : 1
85
+ create : true
86
+ - source : # Add cert-manager annotation to the webhook Service
40
87
kind : Service
41
88
version : v1
42
89
name : webhook-service
43
- fieldref :
44
- fieldpath : metadata.namespace
45
- - name : SERVICE_NAME
46
- objref :
90
+ fieldPath : .metadata.name # namespace of the service
91
+ targets :
92
+ - select :
93
+ kind : Certificate
94
+ group : cert-manager.io
95
+ version : v1
96
+ name : serving-cert
97
+ fieldPaths :
98
+ - .spec.dnsNames.0
99
+ - .spec.dnsNames.1
100
+ options :
101
+ delimiter : ' .'
102
+ index : 0
103
+ create : false
104
+ - source :
47
105
kind : Service
48
106
version : v1
49
107
name : webhook-service
108
+ fieldPath : .metadata.namespace # namespace of the service
109
+ targets :
110
+ - select :
111
+ kind : Certificate
112
+ group : cert-manager.io
113
+ version : v1
114
+ name : serving-cert
115
+ fieldPaths :
116
+ - .spec.dnsNames.0
117
+ - .spec.dnsNames.1
118
+ options :
119
+ delimiter : ' .'
120
+ index : 1
121
+ create : false
122
+ - source : # Prefix the certificate secret name with the name of service
123
+ kind : Service
124
+ version : v1
125
+ name : webhook-service
126
+ fieldPath : .metadata.name # namespace of the service
127
+ targets :
128
+ - select :
129
+ kind : Certificate
130
+ group : cert-manager.io
131
+ version : v1
132
+ fieldPaths :
133
+ - .spec.secretName
134
+ options :
135
+ delimiter : ' -'
136
+ index : 0
137
+ create : false
138
+ - source : # Certificate secret name
139
+ kind : Certificate
140
+ group : cert-manager.io
141
+ version : v1
142
+ name : serving-cert
143
+ fieldPath : .spec.secretName
144
+ targets :
145
+ - select :
146
+ kind : Deployment
147
+ group : apps
148
+ version : v1
149
+ name : controller-manager
150
+ fieldPaths :
151
+ - .spec.template.spec.volumes.[name=cert].secret.secretName
50
152
51
153
configurations :
52
154
- kustomizeconfig.yaml
0 commit comments