@@ -19,6 +19,8 @@ resources:
1919- ../../rbac
2020- ../../manager
2121- ../k0smotron.io
22+ - ../../certmanager
23+ - ../../webhook
2224- ./bases/bootstrap.cluster.x-k8s.io_k0scontrollerconfigs.yaml
2325- ./bases/bootstrap.cluster.x-k8s.io_k0sworkerconfigs.yaml
2426- ./bases/bootstrap.cluster.x-k8s.io_k0sworkerconfigtemplates.yaml
@@ -35,6 +37,10 @@ patches:
3537# If you want your controller-manager to expose the /metrics
3638# endpoint w/o any authn/z, please comment the following line.
3739- path : manager_config_patch.yaml
40+ - path : patches/webhook_in_k0sworkerconfig.yaml
41+ - path : patches/cainjection_in_k0sworkerconfig.yaml
42+ - path : patches/manager_webhook_patch.yaml
43+ - path : patches/webhook_service_patch.yaml
3844
3945configurations :
4046# - kustomizeconfig.yaml
@@ -49,100 +55,84 @@ configurations:
4955# # 'CERTMANAGER' needs to be enabled to use ca injection
5056# #- webhookcainjection_patch.yaml
5157#
52- # replacements:
53- # - source: # Add cert-manager annotation to ValidatingWebhookConfiguration, MutatingWebhookConfiguration and CRDs
54- # kind: Certificate
55- # group: cert-manager.io
56- # version: v1
57- # name: serving-cert # this name should match the one in certificate.yaml
58- # fieldPath: .metadata.namespace # namespace of the certificate CR
59- # targets:
60- # - select:
61- # kind: ValidatingWebhookConfiguration
62- # fieldPaths:
63- # - .metadata.annotations.[cert-manager.io/inject-ca-from]
64- # options:
65- # delimiter: '/'
66- # index: 0
67- # create: true
68- # - select:
69- # kind: MutatingWebhookConfiguration
70- # fieldPaths:
71- # - .metadata.annotations.[cert-manager.io/inject-ca-from]
72- # options:
73- # delimiter: '/'
74- # index: 0
75- # create: true
76- # - select:
77- # kind: CustomResourceDefinition
78- # fieldPaths:
79- # - .metadata.annotations.[cert-manager.io/inject-ca-from]
80- # options:
81- # delimiter: '/'
82- # index: 0
83- # create: true
84- # - source:
85- # kind: Certificate
86- # group: cert-manager.io
87- # version: v1
88- # name: serving-cert # this name should match the one in certificate.yaml
89- # fieldPath: .metadata.name
90- # targets:
91- # - select:
92- # kind: ValidatingWebhookConfiguration
93- # fieldPaths:
94- # - .metadata.annotations.[cert-manager.io/inject-ca-from]
95- # options:
96- # delimiter: '/'
97- # index: 1
98- # create: true
99- # - select:
100- # kind: MutatingWebhookConfiguration
101- # fieldPaths:
102- # - .metadata.annotations.[cert-manager.io/inject-ca-from]
103- # options:
104- # delimiter: '/'
105- # index: 1
106- # create: true
107- # - select:
108- # kind: CustomResourceDefinition
109- # fieldPaths:
110- # - .metadata.annotations.[cert-manager.io/inject-ca-from]
111- # options:
112- # delimiter: '/'
113- # index: 1
114- # create: true
115- # - source: # Add cert-manager annotation to the webhook Service
116- # kind: Service
117- # version: v1
118- # name: webhook-service
119- # fieldPath: .metadata.name # namespace of the service
120- # targets:
121- # - select:
122- # kind: Certificate
123- # group: cert-manager.io
124- # version: v1
125- # fieldPaths:
126- # - .spec.dnsNames.0
127- # - .spec.dnsNames.1
128- # options:
129- # delimiter: '.'
130- # index: 0
131- # create: true
132- # - source:
133- # kind: Service
134- # version: v1
135- # name: webhook-service
136- # fieldPath: .metadata.namespace # namespace of the service
137- # targets:
138- # - select:
139- # kind: Certificate
140- # group: cert-manager.io
141- # version: v1
142- # fieldPaths:
143- # - .spec.dnsNames.0
144- # - .spec.dnsNames.1
145- # options:
146- # delimiter: '.'
147- # index: 1
148- # create: true
58+ replacements :
59+ - source : # Add cert-manager annotation to ValidatingWebhookConfiguration, MutatingWebhookConfiguration and CRDs
60+ kind : Certificate
61+ group : cert-manager.io
62+ version : v1
63+ name : serving-cert # this name should match the one in certificate.yaml
64+ fieldPath : .metadata.namespace # namespace of the certificate CR
65+ targets :
66+ - select :
67+ kind : ValidatingWebhookConfiguration
68+ fieldPaths :
69+ - .metadata.annotations.[cert-manager.io/inject-ca-from]
70+ options :
71+ delimiter : ' /'
72+ index : 0
73+ create : true
74+ - select :
75+ kind : CustomResourceDefinition
76+ fieldPaths :
77+ - .metadata.annotations.[cert-manager.io/inject-ca-from]
78+ options :
79+ delimiter : ' /'
80+ index : 0
81+ create : true
82+ - source :
83+ kind : Certificate
84+ group : cert-manager.io
85+ version : v1
86+ name : serving-cert # this name should match the one in certificate.yaml
87+ fieldPath : .metadata.name
88+ targets :
89+ - select :
90+ kind : ValidatingWebhookConfiguration
91+ fieldPaths :
92+ - .metadata.annotations.[cert-manager.io/inject-ca-from]
93+ options :
94+ delimiter : ' /'
95+ index : 1
96+ create : true
97+ - select :
98+ kind : CustomResourceDefinition
99+ fieldPaths :
100+ - .metadata.annotations.[cert-manager.io/inject-ca-from]
101+ options :
102+ delimiter : ' /'
103+ index : 1
104+ create : true
105+ - source : # Add cert-manager annotation to the webhook Service
106+ kind : Service
107+ version : v1
108+ name : webhook-service
109+ fieldPath : .metadata.name # namespace of the service
110+ targets :
111+ - select :
112+ kind : Certificate
113+ group : cert-manager.io
114+ version : v1
115+ fieldPaths :
116+ - .spec.dnsNames.0
117+ - .spec.dnsNames.1
118+ options :
119+ delimiter : ' .'
120+ index : 0
121+ create : true
122+ - source :
123+ kind : Service
124+ version : v1
125+ name : webhook-service
126+ fieldPath : .metadata.namespace # namespace of the service
127+ targets :
128+ - select :
129+ kind : Certificate
130+ group : cert-manager.io
131+ version : v1
132+ fieldPaths :
133+ - .spec.dnsNames.0
134+ - .spec.dnsNames.1
135+ options :
136+ delimiter : ' .'
137+ index : 1
138+ create : true
0 commit comments