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+ - --webhook-cert-path=/tmp/k8s-webhook-server/serving-certs
31+ {{- else }}
2632 - --metrics-bind-address=127.0.0.1:8080
27- - --leader-elect
33+ {{- end }}
2834 command :
2935 - /manager
3036 env :
@@ -55,12 +61,18 @@ spec:
5561 memory : {{ .Deployment.Manager.Resources.Requests.Memory }}
5662 securityContext :
5763 allowPrivilegeEscalation : false
58- {{- if isEnvVarTrue .Deployment.Manager.Env "ENABLE_WEBHOOKS" }}
5964 volumeMounts :
65+ {{- if isEnvVarTrue .Deployment.Manager.Env "ENABLE_WEBHOOKS" }}
6066 - mountPath : /tmp/k8s-webhook-server/serving-certs
6167 name : cert
6268 readOnly : true
6369{{- end }}
70+ {{- if isEnvVarTrue .Deployment.Manager.Env "METRICS_CERTS" }}
71+ - mountPath : /tmp/k8s-metrics-server/metrics-certs
72+ name : metrics-certs
73+ readOnly : true
74+ {{- end }}
75+ {{- if isEnvVarFalse .Deployment.Manager.Env "METRICS_CERTS" }}
6476 - args :
6577 - --secure-listen-address=0.0.0.0:8443
6678 - --upstream=http://127.0.0.1:8080/
8193 memory : {{ .Deployment.KubeRbacProxy.Resources.Requests.Memory }}
8294 securityContext :
8395 allowPrivilegeEscalation : false
96+ {{- end }}
8497 securityContext :
8598 runAsNonRoot : true
8699 serviceAccountName : {{ .Name }}-operator-controller-manager
@@ -101,12 +114,28 @@ spec:
101114 tolerationSeconds : {{ .TolerationSeconds }}
102115{{- end }}
103116{{- end }}
104- {{- if isEnvVarTrue .Deployment.Manager.Env "ENABLE_WEBHOOKS" }}
105117 volumes :
118+ {{- if isEnvVarTrue .Deployment.Manager.Env "ENABLE_WEBHOOKS" }}
106119 - name : cert
107120 secret :
108121 defaultMode : 420
109122 secretName : {{ .Name }}-operator-webhook-server-cert
110123{{ end }}
124+ {{- if isEnvVarTrue .Deployment.Manager.Env "METRICS_CERTS" }}
125+ - name : metrics-certs
126+ secret :
127+ items :
128+ - key : ca.crt
129+ path : ca.crt
130+ - key : tls.crt
131+ path : tls.crt
132+ - key : tls.key
133+ path : tls.key
134+ optional : false
135+ - name : cert
136+ secret :
137+ defaultMode : 420
138+ secretName : {{ .Name }}-operator-metrics-server-cert
139+ {{ end }}
111140---
112141{{ end }}
0 commit comments