mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-24 02:31:18 -08:00
The Helm chart hardcoded the operator's Deployment, ServiceAccount, Role, and RoleBinding names to "operator". Adds a standard _helpers.tpl with name/fullname template functions and use them for the operator's resources, including the oauth Secret and the cluster-scoped ClusterRole/ClusterRoleBinding. When neither nameOverride nor fullnameOverride is set, the fullname resolves to the historical hardcoded names rather than the release name, so existing installations upgrade with no resource renames; rendering with default values is byte-identical to before. Fixes tailscale/tailscale#18232 Signed-off-by: chaosinthecrd <[email protected]>
45 lines
1.2 KiB
YAML
45 lines
1.2 KiB
YAML
# Copyright (c) Tailscale Inc & contributors
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
# If old setting used, enable both old (operator) and new (ProxyGroup) workflows.
|
|
# If new setting used, enable only new workflow.
|
|
{{ if or (eq (toString .Values.apiServerProxyConfig.mode) "true")
|
|
(eq (toString .Values.apiServerProxyConfig.allowImpersonation) "true") }}
|
|
apiVersion: v1
|
|
kind: ServiceAccount
|
|
metadata:
|
|
name: kube-apiserver-auth-proxy
|
|
namespace: {{ .Release.Namespace }}
|
|
{{- with .Values.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 2 }}
|
|
{{- end }}
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: ClusterRole
|
|
metadata:
|
|
name: tailscale-auth-proxy
|
|
rules:
|
|
- apiGroups: [""]
|
|
resources: ["users", "groups"]
|
|
verbs: ["impersonate"]
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: ClusterRoleBinding
|
|
metadata:
|
|
name: tailscale-auth-proxy
|
|
subjects:
|
|
{{- if eq (toString .Values.apiServerProxyConfig.mode) "true" }}
|
|
- kind: ServiceAccount
|
|
name: {{ include "tailscale-operator.fullname" . }}
|
|
namespace: {{ .Release.Namespace }}
|
|
{{- end }}
|
|
- kind: ServiceAccount
|
|
name: kube-apiserver-auth-proxy
|
|
namespace: {{ .Release.Namespace }}
|
|
roleRef:
|
|
kind: ClusterRole
|
|
name: tailscale-auth-proxy
|
|
apiGroup: rbac.authorization.k8s.io
|
|
{{ end }}
|