@@ -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,11 @@ 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
44+ - path : patches/certificate_patch.yaml
3845
3946configurations :
4047# - kustomizeconfig.yaml
@@ -49,100 +56,84 @@ configurations:
4956# # 'CERTMANAGER' needs to be enabled to use ca injection
5057# #- webhookcainjection_patch.yaml
5158#
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
59+ replacements :
60+ - source : # Add cert-manager annotation to ValidatingWebhookConfiguration, MutatingWebhookConfiguration and CRDs
61+ kind : Certificate
62+ group : cert-manager.io
63+ version : v1
64+ name : serving-cert # this name should match the one in certificate.yaml
65+ fieldPath : .metadata.namespace # namespace of the certificate CR
66+ targets :
67+ - select :
68+ kind : ValidatingWebhookConfiguration
69+ fieldPaths :
70+ - .metadata.annotations.[cert-manager.io/inject-ca-from]
71+ options :
72+ delimiter : ' /'
73+ index : 0
74+ create : true
75+ - select :
76+ kind : CustomResourceDefinition
77+ fieldPaths :
78+ - .metadata.annotations.[cert-manager.io/inject-ca-from]
79+ options :
80+ delimiter : ' /'
81+ index : 0
82+ create : true
83+ - source :
84+ kind : Certificate
85+ group : cert-manager.io
86+ version : v1
87+ name : serving-cert # this name should match the one in certificate.yaml
88+ fieldPath : .metadata.name
89+ targets :
90+ - select :
91+ kind : ValidatingWebhookConfiguration
92+ fieldPaths :
93+ - .metadata.annotations.[cert-manager.io/inject-ca-from]
94+ options :
95+ delimiter : ' /'
96+ index : 1
97+ create : true
98+ - select :
99+ kind : CustomResourceDefinition
100+ fieldPaths :
101+ - .metadata.annotations.[cert-manager.io/inject-ca-from]
102+ options :
103+ delimiter : ' /'
104+ index : 1
105+ create : true
106+ - source : # Add cert-manager annotation to the webhook Service
107+ kind : Service
108+ version : v1
109+ name : webhook-service
110+ fieldPath : .metadata.name # namespace of the service
111+ targets :
112+ - select :
113+ kind : Certificate
114+ group : cert-manager.io
115+ version : v1
116+ fieldPaths :
117+ - .spec.dnsNames.0
118+ - .spec.dnsNames.1
119+ options :
120+ delimiter : ' .'
121+ index : 0
122+ create : true
123+ - source :
124+ kind : Service
125+ version : v1
126+ name : webhook-service
127+ fieldPath : .metadata.namespace # namespace of the service
128+ targets :
129+ - select :
130+ kind : Certificate
131+ group : cert-manager.io
132+ version : v1
133+ fieldPaths :
134+ - .spec.dnsNames.0
135+ - .spec.dnsNames.1
136+ options :
137+ delimiter : ' .'
138+ index : 1
139+ create : true
0 commit comments