2222 spec :
2323 containers :
2424 - args :
25+ - --leader-elect
2526 - --health-probe-bind-address=:8081
27+ {{- if isEnvVarTrue .Deployment.Manager.Env "METRICS_CERTS" }}
28+ - --metrics-bind-address=:8443
29+ - --metrics-cert-path=/tmp/k8s-metrics-server/metrics-certs
30+ {{- if isEnvVarTrue .Deployment.Manager.Env "ENABLE_WEBHOOKS" }}
31+ - --webhook-cert-path=/tmp/k8s-webhook-server/serving-certs
32+ {{- end }}
33+ {{- else }}
2634 - --metrics-bind-address=127.0.0.1:8080
27- - --leader-elect
35+ {{- end }}
2836 command :
2937 - /manager
3038 env :
@@ -55,12 +63,18 @@ spec:
5563 memory : {{ .Deployment.Manager.Resources.Requests.Memory }}
5664 securityContext :
5765 allowPrivilegeEscalation : false
58- {{- if isEnvVarTrue .Deployment.Manager.Env "ENABLE_WEBHOOKS" }}
5966 volumeMounts :
67+ {{- if isEnvVarTrue .Deployment.Manager.Env "ENABLE_WEBHOOKS" }}
6068 - mountPath : /tmp/k8s-webhook-server/serving-certs
6169 name : cert
6270 readOnly : true
6371{{- end }}
72+ {{- if isEnvVarTrue .Deployment.Manager.Env "METRICS_CERTS" }}
73+ - mountPath : /tmp/k8s-metrics-server/metrics-certs
74+ name : metrics-certs
75+ readOnly : true
76+ {{- end }}
77+ {{- if isEnvVarFalse .Deployment.Manager.Env "METRICS_CERTS" }}
6478 - args :
6579 - --secure-listen-address=0.0.0.0:8443
6680 - --upstream=http://127.0.0.1:8080/
8195 memory : {{ .Deployment.KubeRbacProxy.Resources.Requests.Memory }}
8296 securityContext :
8397 allowPrivilegeEscalation : false
98+ {{- end }}
8499 securityContext :
85100 runAsNonRoot : true
86101 serviceAccountName : {{ .Name }}-operator-controller-manager
@@ -101,12 +116,25 @@ spec:
101116 tolerationSeconds : {{ .TolerationSeconds }}
102117{{- end }}
103118{{- end }}
104- {{- if isEnvVarTrue .Deployment.Manager.Env "ENABLE_WEBHOOKS" }}
105119 volumes :
120+ {{- if isEnvVarTrue .Deployment.Manager.Env "ENABLE_WEBHOOKS" }}
106121 - name : cert
107122 secret :
108123 defaultMode : 420
109124 secretName : {{ .Name }}-operator-webhook-server-cert
110125{{ end }}
126+ {{- if isEnvVarTrue .Deployment.Manager.Env "METRICS_CERTS" }}
127+ - name : metrics-certs
128+ secret :
129+ items :
130+ - key : ca.crt
131+ path : ca.crt
132+ - key : tls.crt
133+ path : tls.crt
134+ - key : tls.key
135+ path : tls.key
136+ optional : false
137+ secretName : {{ .Name }}-operator-metrics-server-cert
138+ {{ end }}
111139---
112140{{ end }}
0 commit comments