diff --git a/templates/dvcr/deployment.yaml b/templates/dvcr/deployment.yaml index a69c28901..e3d7af2c3 100644 --- a/templates/dvcr/deployment.yaml +++ b/templates/dvcr/deployment.yaml @@ -94,54 +94,13 @@ spec: {{- end }} env: {{ include "dvcr.envs" . | nindent 12 }} volumeMounts: {{ include "dvcr.volumeMounts" . | nindent 12 }} - - name: kube-rbac-proxy - {{- include "helm_lib_module_container_security_context_read_only_root_filesystem" . | nindent 10 }} - image: {{ include "helm_lib_module_common_image" (list . "kubeRbacProxy") }} - args: - - "--secure-listen-address=$(KUBE_RBAC_PROXY_LISTEN_ADDRESS):8082" - - "--client-ca-file=/etc/kube-rbac-proxy/ca.crt" - - "--v=2" - - "--logtostderr=true" - - "--stale-cache-interval=1h30m" - - "--livez-path=/livez" - env: - - name: KUBE_RBAC_PROXY_LISTEN_ADDRESS - valueFrom: - fieldRef: - fieldPath: status.podIP - - name: KUBE_RBAC_PROXY_CONFIG - value: | - excludePaths: - - /config - upstreams: - - upstream: http://127.0.0.1:5001/metrics - path: /metrics - authorization: - resourceAttributes: - namespace: d8-virtualization - apiGroup: apps - apiVersion: v1 - resource: deployments - subresource: http - name: dvcr - resources: - requests: - {{- include "helm_lib_module_ephemeral_storage_only_logs" . | nindent 14 }} - {{- if not ( .Values.global.enabledModules | has "vertical-pod-autoscaler") }} - {{- include "helm_lib_container_kube_rbac_proxy_resources" . | nindent 14 }} - {{- end }} - volumeMounts: - - name: kube-rbac-proxy-ca - mountPath: /etc/kube-rbac-proxy - ports: - - containerPort: 8082 - name: https-metrics - protocol: TCP + {{- $kubeRbacProxySettings := dict }} + {{- $_ := set $kubeRbacProxySettings "resource" "deployment" }} + {{- $_ := set $kubeRbacProxySettings "name" "dvcr" }} + {{- $_ := set $kubeRbacProxySettings "upstream" "https://127.0.0.1:5001/metrics" }} + {{- include "kube_rbac_proxy.sidecar_container" (tuple . $kubeRbacProxySettings) | nindent 8 }} volumes: {{ include "dvcr.volumes" . | nindent 8 }} - - name: kube-rbac-proxy-ca - configMap: - defaultMode: 420 - name: kube-rbac-proxy-ca.crt + {{- include "kube_rbac_proxy.sidecar_container" (tuple . $kubeRbacProxySettings) | nindent 8 }} {{- include "helm_lib_priority_class" (tuple . $priorityClassName) | nindent 6 }} {{- include "helm_lib_node_selector" (tuple . "system") | nindent 6 }} {{- include "helm_lib_tolerations" (tuple . "system") | nindent 6 }}