Skip to content

Commit

Permalink
Added secret reference nats token for client and agent chart
Browse files Browse the repository at this point in the history
  • Loading branch information
akash4sh committed Sep 19, 2023
1 parent d347ca3 commit d0844b5
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 6 deletions.
2 changes: 1 addition & 1 deletion charts/agent/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.1.1
version: 1.1.2

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
21 changes: 21 additions & 0 deletions charts/agent/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,14 @@ spec:
- name: CLUSTER_NAME
value: {{ .Values.clusterName }}
- name: NATS_TOKEN
{{- if .Values.nats.auth.token }}
value: {{ .Values.nats.auth.token }}
{{- else if .Values.nats.auth.secret }}
valueFrom:
secretKeyRef:
name: {{ .Values.nats.auth.secret.name }}
key: {{ .Values.nats.auth.secret.key }}
{{- end }}
- name: NATS_ADDRESS
value: {{ .Values.nats.host }}
- name: SCHEDULING_INTERVAL
Expand Down Expand Up @@ -82,7 +89,14 @@ spec:
- name: CLUSTER_NAME
value: {{ .Values.clusterName }}
- name: NATS_TOKEN
{{- if .Values.nats.auth.token }}
value: {{ .Values.nats.auth.token }}
{{- else if .Values.nats.auth.secret }}
valueFrom:
secretKeyRef:
name: {{ .Values.nats.auth.secret.name }}
key: {{ .Values.nats.auth.secret.key }}
{{- end }}
- name: NATS_ADDRESS
value: {{ .Values.nats.host }}
resources:
Expand All @@ -100,7 +114,14 @@ spec:
- name: CLUSTER_NAME
value: {{ .Values.clusterName }}
- name: NATS_TOKEN
{{- if .Values.nats.auth.token }}
value: {{ .Values.nats.auth.token }}
{{- else if .Values.nats.auth.secret }}
valueFrom:
secretKeyRef:
name: {{ .Values.nats.auth.secret.name }}
key: {{ .Values.nats.auth.secret.key }}
{{- end }}
- name: NATS_ADDRESS
value: {{ .Values.nats.host }}
resources:
Expand Down
7 changes: 6 additions & 1 deletion charts/agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,9 @@ clusterName: "kubviz"
nats:
host: kubviz-client-nats
auth:
token: "UfmrJOYwYCCsgQvxvcfJ3BdI6c8WBbnD"
# Use token if you want to provide the token via Helm Values
token: ""
# Use a secret reference if you want to get a token from a secret
secret:
name: ""
key: ""
4 changes: 2 additions & 2 deletions charts/client/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.1.1
version: 1.1.2

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand All @@ -25,7 +25,7 @@ appVersion: "v1.0.0"
dependencies:
- name: nats
condition: nats.enabled
version: 0.13.4
version: 0.13.5
repository: https://intelops.github.io/kubviz/
- name: clickhouse
condition: clickhouse.enabled
Expand Down
9 changes: 8 additions & 1 deletion charts/client/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,14 @@ spec:
# port: http
env:
- name: NATS_TOKEN
{{- if and .Values.nats.enabled .Values.nats.auth.enabled .Values.nats.auth.token }}
value: {{ .Values.nats.auth.token }}
{{- else if and .Values.nats.enabled .Values.nats.auth.enabled .Values.nats.auth.secret }}
valueFrom:
secretKeyRef:
name: {{ .Values.nats.auth.secret.name }}
key: {{ .Values.nats.auth.secret.key }}
{{- end }}
- name: NATS_ADDRESS
value: {{ include "client.fullname" . }}-nats
- name: DB_ADDRESS
Expand All @@ -83,4 +90,4 @@ spec:
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
7 changes: 6 additions & 1 deletion charts/client/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,12 @@ nats:
#Authentication setup
auth:
enabled: true
token: "UfmrJOYwYCCsgQvxvcfJ3BdI6c8WBbnD"
# Use token if you want to provide the token via Helm Values
token: ""
# Use a secret reference if you want to get a token from a secret
secret:
name: ""
key: ""
nats:
jetstream:
enabled: true
Expand Down

0 comments on commit d0844b5

Please sign in to comment.