Skip to content

Commit d0844b5

Browse files
committed
Added secret reference nats token for client and agent chart
1 parent d347ca3 commit d0844b5

File tree

6 files changed

+44
-6
lines changed

6 files changed

+44
-6
lines changed

charts/agent/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 1.1.1
18+
version: 1.1.2
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

charts/agent/templates/deployment.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,14 @@ spec:
4949
- name: CLUSTER_NAME
5050
value: {{ .Values.clusterName }}
5151
- name: NATS_TOKEN
52+
{{- if .Values.nats.auth.token }}
5253
value: {{ .Values.nats.auth.token }}
54+
{{- else if .Values.nats.auth.secret }}
55+
valueFrom:
56+
secretKeyRef:
57+
name: {{ .Values.nats.auth.secret.name }}
58+
key: {{ .Values.nats.auth.secret.key }}
59+
{{- end }}
5360
- name: NATS_ADDRESS
5461
value: {{ .Values.nats.host }}
5562
- name: SCHEDULING_INTERVAL
@@ -82,7 +89,14 @@ spec:
8289
- name: CLUSTER_NAME
8390
value: {{ .Values.clusterName }}
8491
- name: NATS_TOKEN
92+
{{- if .Values.nats.auth.token }}
8593
value: {{ .Values.nats.auth.token }}
94+
{{- else if .Values.nats.auth.secret }}
95+
valueFrom:
96+
secretKeyRef:
97+
name: {{ .Values.nats.auth.secret.name }}
98+
key: {{ .Values.nats.auth.secret.key }}
99+
{{- end }}
86100
- name: NATS_ADDRESS
87101
value: {{ .Values.nats.host }}
88102
resources:
@@ -100,7 +114,14 @@ spec:
100114
- name: CLUSTER_NAME
101115
value: {{ .Values.clusterName }}
102116
- name: NATS_TOKEN
117+
{{- if .Values.nats.auth.token }}
103118
value: {{ .Values.nats.auth.token }}
119+
{{- else if .Values.nats.auth.secret }}
120+
valueFrom:
121+
secretKeyRef:
122+
name: {{ .Values.nats.auth.secret.name }}
123+
key: {{ .Values.nats.auth.secret.key }}
124+
{{- end }}
104125
- name: NATS_ADDRESS
105126
value: {{ .Values.nats.host }}
106127
resources:

charts/agent/values.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,9 @@ clusterName: "kubviz"
156156
nats:
157157
host: kubviz-client-nats
158158
auth:
159-
token: "UfmrJOYwYCCsgQvxvcfJ3BdI6c8WBbnD"
159+
# Use token if you want to provide the token via Helm Values
160+
token: ""
161+
# Use a secret reference if you want to get a token from a secret
162+
secret:
163+
name: ""
164+
key: ""

charts/client/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 1.1.1
18+
version: 1.1.2
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
@@ -25,7 +25,7 @@ appVersion: "v1.0.0"
2525
dependencies:
2626
- name: nats
2727
condition: nats.enabled
28-
version: 0.13.4
28+
version: 0.13.5
2929
repository: https://intelops.github.io/kubviz/
3030
- name: clickhouse
3131
condition: clickhouse.enabled

charts/client/templates/deployment.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,14 @@ spec:
6363
# port: http
6464
env:
6565
- name: NATS_TOKEN
66+
{{- if and .Values.nats.enabled .Values.nats.auth.enabled .Values.nats.auth.token }}
6667
value: {{ .Values.nats.auth.token }}
68+
{{- else if and .Values.nats.enabled .Values.nats.auth.enabled .Values.nats.auth.secret }}
69+
valueFrom:
70+
secretKeyRef:
71+
name: {{ .Values.nats.auth.secret.name }}
72+
key: {{ .Values.nats.auth.secret.key }}
73+
{{- end }}
6774
- name: NATS_ADDRESS
6875
value: {{ include "client.fullname" . }}-nats
6976
- name: DB_ADDRESS
@@ -83,4 +90,4 @@ spec:
8390
{{- with .Values.tolerations }}
8491
tolerations:
8592
{{- toYaml . | nindent 8 }}
86-
{{- end }}
93+
{{- end }}

charts/client/values.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,12 @@ nats:
8383
#Authentication setup
8484
auth:
8585
enabled: true
86-
token: "UfmrJOYwYCCsgQvxvcfJ3BdI6c8WBbnD"
86+
# Use token if you want to provide the token via Helm Values
87+
token: ""
88+
# Use a secret reference if you want to get a token from a secret
89+
secret:
90+
name: ""
91+
key: ""
8792
nats:
8893
jetstream:
8994
enabled: true

0 commit comments

Comments
 (0)