cmd/k8s-operator/deploy: allow modifying operator tags via Helm values

Updates tailscale/tailscale#10659

Signed-off-by: Chandon Pierre <cpierre@coreweave.com>
This commit is contained in:
ChandonPierre 2024-01-19 16:22:23 -05:00 committed by GitHub
parent 2ac7c0161b
commit 2ce596ea7a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 1 deletions

View File

@ -49,6 +49,8 @@ spec:
image: {{ .Values.operatorConfig.image.repo }}{{- if .Values.operatorConfig.image.digest -}}{{ printf "@%s" .Values.operatorConfig.image.digest}}{{- else -}}{{ printf "%s" $operatorTag }}{{- end }} image: {{ .Values.operatorConfig.image.repo }}{{- if .Values.operatorConfig.image.digest -}}{{ printf "@%s" .Values.operatorConfig.image.digest}}{{- else -}}{{ printf "%s" $operatorTag }}{{- end }}
imagePullPolicy: {{ .Values.operatorConfig.image.pullPolicy }} imagePullPolicy: {{ .Values.operatorConfig.image.pullPolicy }}
env: env:
- name: OPERATOR_INITIAL_TAGS
value: {{ join "," .Values.operatorConfig.defaultTags }}
- name: OPERATOR_HOSTNAME - name: OPERATOR_HOSTNAME
value: {{ .Values.operatorConfig.hostname }} value: {{ .Values.operatorConfig.hostname }}
- name: OPERATOR_SECRET - name: OPERATOR_SECRET

View File

@ -15,6 +15,13 @@ oauth: {}
installCRDs: "true" installCRDs: "true"
operatorConfig: operatorConfig:
# ACL tag that operator will be tagged with. Operator must be made owner of
# these tags
# https://tailscale.com/kb/1236/kubernetes-operator/?q=operator#setting-up-the-kubernetes-operator
# Multiple tags are defined as array items and passed to the operator as a comma-separated string
defaultTags:
- "tag:k8s-operator"
image: image:
repo: tailscale/k8s-operator repo: tailscale/k8s-operator
# Digest will be prioritized over tag. If neither are set appVersion will be # Digest will be prioritized over tag. If neither are set appVersion will be

View File

@ -284,6 +284,8 @@ spec:
spec: spec:
containers: containers:
- env: - env:
- name: OPERATOR_INITIAL_TAGS
value: tag:k8s-operator
- name: OPERATOR_HOSTNAME - name: OPERATOR_HOSTNAME
value: tailscale-operator value: tailscale-operator
- name: OPERATOR_SECRET - name: OPERATOR_SECRET

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<policyDefinitions revision="1.0" schemaVersion="1.0" <policyDefinitions revision="1.0" schemaVersion="1.0"
xmlns="http://www.microsoft.com/GroupPolicy/PolicyDefinitions"> xmlns="http://www.microsoft.com/GroupPolicy/PolicyDefinitions">
<policyNamespaces> <policyNamespaces>