Skip to content

Commit

Permalink
feat: add ability to customize operator service account
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeVienne committed Aug 11, 2024
1 parent d20a1ab commit 1f0b4c7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion charts/tailscale-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ name: tailscale-operator
sources:
- https://github.com/tailscale/tailscale
type: application
version: 1.70.2
version: 1.70.3
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ metadata:
name: tailscale-auth-proxy
subjects:
- kind: ServiceAccount
name: operator
name: {{ .Values.operatorConfig.serviceAccount.name }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
Expand Down
2 changes: 1 addition & 1 deletion charts/tailscale-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: operator
serviceAccountName: {{ .Values.operatorConfig.serviceAccount.name }}
{{- with .Values.operatorConfig.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
Expand Down
10 changes: 7 additions & 3 deletions charts/tailscale-operator/templates/operator-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: operator
name: {{ .Values.operatorConfig.serviceAccount.name }}
namespace: {{ .Release.Namespace }}
annotations:
{{- toYaml .Values.operatorConfig.serviceAccount.annotations | nindent 4 }}
labels:
{{- toYaml .Values.operatorConfig.serviceAccount.labels | nindent 4 }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down Expand Up @@ -34,7 +38,7 @@ metadata:
name: tailscale-operator
subjects:
- kind: ServiceAccount
name: operator
name: {{ .Values.operatorConfig.serviceAccount.name }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
Expand Down Expand Up @@ -64,7 +68,7 @@ metadata:
namespace: {{ .Release.Namespace }}
subjects:
- kind: ServiceAccount
name: operator
name: {{ .Values.operatorConfig.serviceAccount.name }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: Role
Expand Down
5 changes: 5 additions & 0 deletions charts/tailscale-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ operatorConfig:
defaultTags:
- "tag:k8s-operator"

serviceAccount:
name: operator
annotations: {}
labels: {}

image:
# Repository defaults to DockerHub, but images are also synced to ghcr.io/tailscale/k8s-operator.
repository: tailscale/k8s-operator
Expand Down

0 comments on commit 1f0b4c7

Please sign in to comment.