chart: Allow to disabling kube-rbac-proxy and expose metrics (#511)

Fixes #454
This commit is contained in:
Yair Fried 2021-05-03 17:36:01 +03:00 committed by GitHub
parent 0e0f385f72
commit cb54864387
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -31,7 +31,8 @@ spec:
{{- end }} {{- end }}
containers: containers:
- args: - args:
- "--metrics-addr=127.0.0.1:8080" {{- $metricsHost := .Values.kube_rbac_proxy.enabled | ternary "127.0.0.1" "0.0.0.0" }}
- "--metrics-addr={{ $metricsHost }}:8080"
- "--enable-leader-election" - "--enable-leader-election"
- "--sync-period={{ .Values.syncPeriod }}" - "--sync-period={{ .Values.syncPeriod }}"
- "--docker-image={{ .Values.image.dindSidecarRepositoryAndTag }}" - "--docker-image={{ .Values.image.dindSidecarRepositoryAndTag }}"
@ -72,6 +73,11 @@ spec:
- containerPort: 9443 - containerPort: 9443
name: webhook-server name: webhook-server
protocol: TCP protocol: TCP
{{- if not .Values.kube_rbac_proxy.enabled }}
- containerPort: 9443
name: https
protocol: TCP
{{- end }}
resources: resources:
{{- toYaml .Values.resources | nindent 12 }} {{- toYaml .Values.resources | nindent 12 }}
securityContext: securityContext:
@ -85,6 +91,7 @@ spec:
- mountPath: /tmp/k8s-webhook-server/serving-certs - mountPath: /tmp/k8s-webhook-server/serving-certs
name: cert name: cert
readOnly: true readOnly: true
{{- if .Values.kube_rbac_proxy.enabled }}
- args: - args:
- "--secure-listen-address=0.0.0.0:8443" - "--secure-listen-address=0.0.0.0:8443"
- "--upstream=http://127.0.0.1:8080/" - "--upstream=http://127.0.0.1:8080/"
@ -100,6 +107,7 @@ spec:
{{- toYaml .Values.resources | nindent 12 }} {{- toYaml .Values.resources | nindent 12 }}
securityContext: securityContext:
{{- toYaml .Values.securityContext | nindent 12 }} {{- toYaml .Values.securityContext | nindent 12 }}
{{- end }}
terminationGracePeriodSeconds: 10 terminationGracePeriodSeconds: 10
volumes: volumes:
- name: secret - name: secret

View File

@ -26,6 +26,7 @@ image:
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
kube_rbac_proxy: kube_rbac_proxy:
enabled: true
image: image:
repository: quay.io/brancz/kube-rbac-proxy repository: quay.io/brancz/kube-rbac-proxy
tag: v0.8.0 tag: v0.8.0