Skip to content

Commit ecc0f83

Browse files
authored
deprecate authProxy.enabled value option (#304)
Marks the `authProxy.enabled` values file option as deprecated and adds documentation to the `metrics.disableAuth` values file option explaining its effect. Ensures that metrics port binding to localhost (127.0.0.1) only occurs when the auth proxy is enabled (via metrics.disableAuth=true). Issue #167 Signed-off-by: Jay Pipes <jay.pipes@temporal.io>
1 parent b8d9428 commit ecc0f83

6 files changed

Lines changed: 26 additions & 12 deletions

File tree

.github/workflows/helm-image-check.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ jobs:
4343
--set namespace.create=true \
4444
> /tmp/rendered-namespace.yaml
4545
helm template test-release helm/temporal-worker-controller \
46-
--set authProxy.enabled=false \
4746
--set metrics.disableAuth=true \
4847
> /tmp/rendered-no-auth.yaml
4948

.github/workflows/helm-validate.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ jobs:
4747
- name: Template with auth proxy disabled
4848
run: |
4949
helm template test-release helm/temporal-worker-controller \
50-
--set authProxy.enabled=false \
5150
--set metrics.disableAuth=true
5251
5352
helm-lint-crds:

helm/temporal-worker-controller/templates/auth_proxy.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
{{- if .Values.authProxy.enabled -}}
1+
{{- if .Values.metrics.enabled }}
2+
{{- if not .Values.metrics.disableAuth -}}
23
apiVersion: rbac.authorization.k8s.io/v1
34
kind: ClusterRole
45
metadata:
@@ -62,4 +63,5 @@ spec:
6263
selector:
6364
{{- include "temporal-worker-controller.selectorLabels" . | nindent 4 }}
6465
---
66+
{{- end -}}
6567
{{- end }}

helm/temporal-worker-controller/templates/manager.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,12 @@ spec:
9191
args:
9292
- --leader-elect
9393
{{- if .Values.metrics.enabled }}
94+
{{- if .Values.metrics.disableAuth }}
95+
- "--metrics-bind-address=:{{ .Values.metrics.port }}"
96+
{{- else }}
9497
- "--metrics-bind-address=127.0.0.1:{{ .Values.metrics.port }}"
9598
{{- end }}
99+
{{- end }}
96100
- "--health-probe-bind-address=:8081"
97101
ports:
98102
- containerPort: {{ .Values.webhook.port }}
@@ -160,4 +164,4 @@ spec:
160164
{{- with .Values.tolerations }}
161165
tolerations:
162166
{{- toYaml . | nindent 8 }}
163-
{{- end }}
167+
{{- end }}

helm/temporal-worker-controller/values.schema.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@
121121
"properties": {
122122
"enabled": {
123123
"type": "boolean",
124-
"description": "Whether to enable the auth proxy"
124+
"description": "Whether to enable the auth proxy",
125+
"deprecated": true
125126
}
126127
}
127128
},
@@ -216,4 +217,4 @@
216217
"type": "number"
217218
}
218219
}
219-
}
220+
}

helm/temporal-worker-controller/values.yaml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,28 @@ affinity: {}
5757
# More than one replica is required for high availability.
5858
replicas: 2
5959

60-
# Opt out of these resources if you want to disable the
61-
# auth proxy (https://github.com/brancz/kube-rbac-proxy)
62-
# which protects your /metrics endpoint.
60+
# deprecated. disable authenticated metrics endpoint access with the
61+
# metrics.disableAuth value.
6362
authProxy:
6463
enabled: true
6564

6665
metrics:
6766
enabled: true
6867
port: 8080
6968
# Set to true if you want your controller-manager to expose the /metrics
70-
# endpoint w/o any authn/z. If false, creates an HTTP proxy sidecar container
71-
# for the controller manager which performs RBAC authorization against the
72-
# Kubernetes API using SubjectAccessReviews.
69+
# endpoint w/o any authn/z.
70+
#
71+
# If false (the default), a kube-rbac-proxy sidecar
72+
# (https://github.com/brancz/kube-rbac-proxy) is injected into the manager
73+
# pod. It listens on HTTPS port 8443 and proxies to the manager's metrics
74+
# endpoint on localhost, authorizing each request via Kubernetes
75+
# SubjectAccessReviews. The manager binds metrics to 127.0.0.1 so it is only
76+
# reachable through the proxy.
77+
#
78+
# Set to true when network-level controls already restrict access
79+
# (NetworkPolicy, service mesh, same-namespace Prometheus), your scraper
80+
# cannot present a bearer token, or simplicity is preferred (e.g.
81+
# dev/staging).
7382
disableAuth: false
7483

7584
namespace:

0 commit comments

Comments
 (0)