Skip to content

Commit

Permalink
feat: support secret store csi for Tailscale
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeVienne committed Aug 11, 2024
1 parent 68941e0 commit 6801474
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 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.0
version: 1.70.1
17 changes: 17 additions & 0 deletions charts/tailscale-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,18 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
{{- if .Values.operatorConfig.secretStore.enabled -}}
- name: oauth
csi:
driver: secrets-store.csi.k8s.io
readOnly: true
volumeAttributes:
secretProviderClass: {{ .Values.operatorConfig.secretStore.secretStore }}
{{- else -}}
- name: oauth
secret:
secretName: operator-oauth
{{- end -}}
containers:
- name: operator
{{- with .Values.operatorConfig.securityContext }}
Expand Down Expand Up @@ -65,9 +74,17 @@ spec:
fieldRef:
fieldPath: metadata.namespace
- name: CLIENT_ID_FILE
{{- if .Values.operatorConfig.secretStore.enabled -}}
value: /oauth/{{ .Values.operatorConfig.secretStore.paths.clientId }}
{{- else -}}
value: /oauth/client_id
{{- end -}}
- name: CLIENT_SECRET_FILE
{{- if .Values.operatorConfig.secretStore.enabled -}}
value: /oauth/{{ .Values.operatorConfig.secretStore.paths.clientSecret }}
{{- else -}}
value: /oauth/client_secret
{{- end -}}
{{- $proxyTag := printf ":%s" ( .Values.proxyConfig.image.tag | default .Chart.AppVersion )}}
- name: PROXY_IMAGE
value: {{ coalesce .Values.proxyConfig.image.repo .Values.proxyConfig.image.repository }}{{- if .Values.proxyConfig.image.digest -}}{{ printf "@%s" .Values.proxyConfig.image.digest}}{{- else -}}{{ printf "%s" $proxyTag }}{{- end }}
Expand Down
9 changes: 8 additions & 1 deletion charts/tailscale-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Operator oauth credentials. If set a Kubernetes Secret with the provided
# values will be created in the operator namespace. If unset a Secret named
# operator-oauth must be precreated.
# operator-oauth must be precreated or use the secretStore configuration.
oauth: {}
# clientId: ""
# clientSecret: ""
Expand Down Expand Up @@ -48,6 +48,13 @@ operatorConfig:

securityContext: {}

secretStore:
enabled: false
secretStore: operator-oauth
paths:
clientId: clientId
clientSecret: clientSecret

# proxyConfig contains configuraton that will be applied to any ingress/egress
# proxies created by the operator.
# https://tailscale.com/kb/1236/kubernetes-operator/#cluster-ingress
Expand Down

0 comments on commit 6801474

Please sign in to comment.