@@ -16,56 +16,75 @@ bases:
1616# - ../crd
1717- ../rbac
1818- ../manager
19+ - ../certmanager
1920- ../prometheus
20- # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
21- # crd/kustomization.yaml
22- # - ../webhook
23- # [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required.
24- # - ../certmanager
21+ - metrics_service.yaml
2522
26- patchesStrategicMerge :
27- # Protect the /metrics endpoint by putting it behind auth.
28- # If you want your controller-manager to expose the /metrics
29- # endpoint w/o any authn/z, please comment the following line.
30- - manager_auth_proxy_patch.yaml
23+ patches :
24+ - path : cert_metrics_manager_patch.yaml
25+ target :
26+ kind : Deployment
27+ - path : manager_metrics_patch.yaml
28+ target :
29+ kind : Deployment
3130
31+ replacements :
32+ - source : # Uncomment the following block to enable certificates for metrics
33+ kind : Service
34+ version : v1
35+ name : controller-manager-metrics-service
36+ fieldPath : metadata.name
37+ targets :
38+ - select :
39+ kind : Certificate
40+ group : cert-manager.io
41+ version : v1
42+ name : metrics-certs
43+ fieldPaths :
44+ - spec.dnsNames.0
45+ - spec.dnsNames.1
46+ options :
47+ delimiter : ' .'
48+ index : 0
49+ create : true
50+ - select : # Uncomment the following to set the Service name for TLS config in Prometheus ServiceMonitor
51+ kind : ServiceMonitor
52+ group : monitoring.coreos.com
53+ version : v1
54+ name : controller-manager-metrics-monitor
55+ fieldPaths :
56+ - spec.endpoints.0.tlsConfig.serverName
57+ options :
58+ delimiter : ' .'
59+ index : 0
60+ create : true
3261
33-
34- # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
35- # crd/kustomization.yaml
36- # - manager_webhook_patch.yaml
37-
38- # [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
39- # Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
40- # 'CERTMANAGER' needs to be enabled to use ca injection
41- # - webhookcainjection_patch.yaml
42-
43- # the following config is for teaching kustomize how to do var substitution
44- vars :
45- # [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
46- # - name: CERTIFICATE_NAMESPACE # namespace of the certificate CR
47- # objref:
48- # kind: Certificate
49- # group: cert-manager.io
50- # version: v1
51- # name: serving-cert # this name should match the one in certificate.yaml
52- # fieldref:
53- # fieldpath: metadata.namespace
54- # - name: CERTIFICATE_NAME
55- # objref:
56- # kind: Certificate
57- # group: cert-manager.io
58- # version: v1
59- # name: serving-cert # this name should match the one in certificate.yaml
60- # - name: SERVICE_NAMESPACE # namespace of the service
61- # objref:
62- # kind: Service
63- # version: v1
64- # name: webhook-service
65- # fieldref:
66- # fieldpath: metadata.namespace
67- # - name: SERVICE_NAME
68- # objref:
69- # kind: Service
70- # version: v1
71- # name: webhook-service
62+ - source :
63+ kind : Service
64+ version : v1
65+ name : controller-manager-metrics-service
66+ fieldPath : metadata.namespace
67+ targets :
68+ - select :
69+ kind : Certificate
70+ group : cert-manager.io
71+ version : v1
72+ name : metrics-certs
73+ fieldPaths :
74+ - spec.dnsNames.0
75+ - spec.dnsNames.1
76+ options :
77+ delimiter : ' .'
78+ index : 1
79+ create : true
80+ - select : # Uncomment the following to set the Service namespace for TLS in Prometheus ServiceMonitor
81+ kind : ServiceMonitor
82+ group : monitoring.coreos.com
83+ version : v1
84+ name : controller-manager-metrics-monitor
85+ fieldPaths :
86+ - spec.endpoints.0.tlsConfig.serverName
87+ options :
88+ delimiter : ' .'
89+ index : 1
90+ create : true
0 commit comments