Skip to content

Commit

Permalink
Allow users to provide a Secret name and key.
Browse files Browse the repository at this point in the history
  • Loading branch information
macb committed Nov 1, 2023
1 parent 94a8025 commit 5405e91
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/vantage-kubernetes-agent/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ apiVersion: v2
name: vantage-kubernetes-agent
description: Provisions the Vantage Kubernetes agent.
type: application
version: 1.0.10
version: 1.0.11
appVersion: "1.0.8"
icon: "https://www.vantage.sh/nav-logo.svg"
2 changes: 2 additions & 0 deletions charts/vantage-kubernetes-agent/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.agent.secret.name }}
{{- $token := .Values.agent.token | required ".Values.agent.token is required."}}
apiVersion: v1
kind: Secret
Expand All @@ -8,3 +9,4 @@ metadata:
type: Opaque
data:
token: {{ $token | b64enc | quote }}
{{- end }}
7 changes: 6 additions & 1 deletion charts/vantage-kubernetes-agent/templates/statefulset.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- $clusterID := .Values.agent.clusterID | required ".Values.clusterID.token is required."}}
{{- $clusterID := .Values.agent.clusterID | required ".Values.agent.clusterID is required."}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
Expand Down Expand Up @@ -41,8 +41,13 @@ spec:
- name: VANTAGE_API_TOKEN
valueFrom:
secretKeyRef:
{{- if .Values.agent.secret.name }}
name: {{ .Values.agent.secret.name }}
key: {{ .Values.agent.secret.key }}
{{- else }}
name: {{ include "vantage-kubernetes-agent.fullname" . }}
key: token
{{- end }}
{{- with .Values.agent.apiHost }}
- name: VANTAGE_API_HOST
value: "{{ . }}"
Expand Down
4 changes: 4 additions & 0 deletions charts/vantage-kubernetes-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ agent:
clusterID: ""
# Vantage API Token
token: ""
# If the Secret is pre-provisioned, can override the secret name and key as needed below. If name is not set a Secret using `token` is provisioned.
secret:
name: ""
key: "token"

persist:
mountPath: "/var/lib/vantage-agent"
Expand Down

0 comments on commit 5405e91

Please sign in to comment.