Skip to content

Commit

Permalink
Allow passing linodeApitoken and region as secretRef
Browse files Browse the repository at this point in the history
  • Loading branch information
tchinmai7 committed Aug 29, 2023
1 parent 0427d17 commit 4930728
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 2 additions & 0 deletions deploy/chart/templates/ccm-linode.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.secretRef }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -7,3 +8,4 @@ stringData:
apiToken: {{ required ".Values.apiToken required" .Values.apiToken }}
region: {{ required ".Values.region required" .Values.region }}
type: Opaque
{{- end }}
8 changes: 4 additions & 4 deletions deploy/chart/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ spec:
- name: LINODE_API_TOKEN
valueFrom:
secretKeyRef:
name: ccm-linode
key: apiToken
name: {{ .Values.secretRef.name | default "ccm-linode"}}
key: {{ .Values.secretRef.apiTokenRef | default "apiToken"}}
- name: LINODE_REGION
valueFrom:
secretKeyRef:
name: ccm-linode
key: region
name: {{ .Values.secretRef.name | default "ccm-linode"}}
key: {{ .Values.secretRef.regionRef | default "region"}}
{{- toYaml .Values.env | nindent 12 }}
volumes:
- name: k8s
Expand Down
10 changes: 8 additions & 2 deletions deploy/chart/values.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# apiToken [Required] - Must be a Linode APIv4 Personal Access Token with all permissions. (https://cloud.linode.com/profile/tokens)
# apiToken [Required if secretRef is not set] - Must be a Linode APIv4 Personal Access Token with all permissions. (https://cloud.linode.com/profile/tokens)
apiToken: ""

# region [Required] - Must be a Linode region. (https://api.linode.com/v4/regions)
# region [Required if secretRef is not set] - Must be a Linode region. (https://api.linode.com/v4/regions)
region: ""

# Set these values if your APIToken and region are already present in a k8s secret.
# secretRef:
# name: "linode-ccm"
# apiTokenRef: "apiToken"
# regionRef: "region"

# node-role.kubernetes.io/master - if set true, it deploys the svc on the master node
nodeSelector:
# The CCM will only run on a Node labelled as a master, you may want to change this
Expand Down

0 comments on commit 4930728

Please sign in to comment.