Skip to content

Commit 7ce08fd

Browse files
authored
helm: added shared-secret
1 parent c14c4ca commit 7ce08fd

5 files changed

Lines changed: 57 additions & 4 deletions

File tree

deploy/helm/templates/deployment-grpc.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ spec:
6767
mountPath: /opt/spaceone/{{ .Values.name }}/config/application.yaml
6868
subPath: application.yaml
6969
readOnly: true
70+
{{- if .Values.global.shared_secret.enabled }}
71+
- name: shared-secret
72+
mountPath: /opt/spaceone/{{ .Values.name }}/config/shared-secret.yaml
73+
subPath: shared-secret.yaml
74+
readOnly: true
75+
{{- end }}
7076
{{- if .Values.volumeMounts.application_grpc }}
7177
{{- toYaml .Values.volumeMounts.application_grpc | nindent 12 }}
7278
{{- end }}
@@ -99,7 +105,11 @@ spec:
99105
- name: application-conf
100106
configMap:
101107
name: {{ .Values.name }}-application-grpc-conf
102-
108+
{{- if .Values.global.shared_secret.enabled }}
109+
- name: shared-secret
110+
secret:
111+
secretName: shared-secret
112+
{{- end }}
103113
{{- if .Values.volumes }}
104114
{{- toYaml .Values.volumes | nindent 8 }}
105115
{{- end }}

deploy/helm/templates/deployment-rest.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ spec:
6767
mountPath: /opt/spaceone/{{ .Values.name }}/config/application.yaml
6868
subPath: application.yaml
6969
readOnly: true
70+
{{- if .Values.global.shared_secret.enabled }}
71+
- name: shared-secret
72+
mountPath: /opt/spaceone/{{ .Values.name }}/config/shared-secret.yaml
73+
subPath: shared-secret.yaml
74+
readOnly: true
75+
{{- end }}
7076
{{- if .Values.volumeMounts.application_rest }}
7177
{{- toYaml .Values.volumeMounts.application_rest | nindent 12 }}
7278
{{- end }}
@@ -137,7 +143,11 @@ spec:
137143
- name: rest-nginx-proxy-conf
138144
configMap:
139145
name: {{ .Values.name }}-rest-nginx-proxy-conf
140-
146+
{{- if .Values.global.shared_secret.enabled }}
147+
- name: shared-secret
148+
secret:
149+
secretName: shared-secret
150+
{{- end }}
141151
{{- if .Values.volumes }}
142152
{{- toYaml .Values.volumes | nindent 8 }}
143153
{{- end }}

deploy/helm/templates/deployment-scheduler.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ spec:
6565
mountPath: /opt/spaceone/{{ .Values.name }}/config/application.yaml
6666
subPath: application.yaml
6767
readOnly: true
68+
{{- if .Values.global.shared_secret.enabled }}
69+
- name: shared-secret
70+
mountPath: /opt/spaceone/{{ .Values.name }}/config/shared-secret.yaml
71+
subPath: shared-secret.yaml
72+
readOnly: true
73+
{{- end }}
6874
{{- if .Values.volumeMounts.application_scheduler }}
6975
{{- toYaml .Values.volumeMounts.application_scheduler | nindent 12 }}
7076
{{- end }}
@@ -97,7 +103,11 @@ spec:
97103
- name: application-conf
98104
configMap:
99105
name: {{ .Values.name }}-application-scheduler-conf
100-
106+
{{- if .Values.global.shared_secret.enabled }}
107+
- name: shared-secret
108+
secret:
109+
secretName: shared-secret
110+
{{- end }}
101111
{{- if .Values.volumes }}
102112
{{- toYaml .Values.volumes | nindent 8 }}
103113
{{- end }}

deploy/helm/templates/deployment-worker.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ spec:
6565
mountPath: /opt/spaceone/{{ .Values.name }}/config/application.yaml
6666
subPath: application.yaml
6767
readOnly: true
68+
{{- if .Values.global.shared_secret.enabled }}
69+
- name: shared-secret
70+
mountPath: /opt/spaceone/{{ .Values.name }}/config/shared-secret.yaml
71+
subPath: shared-secret.yaml
72+
readOnly: true
73+
{{- end }}
6874
{{- if .Values.volumeMounts.application_worker }}
6975
{{- toYaml .Values.volumeMounts.application_worker | nindent 12 }}
7076
{{- end }}
@@ -97,7 +103,11 @@ spec:
97103
- name: application-conf
98104
configMap:
99105
name: {{ .Values.name }}-application-worker-conf
100-
106+
{{- if .Values.global.shared_secret.enabled }}
107+
- name: shared-secret
108+
secret:
109+
secretName: shared-secret
110+
{{- end }}
101111
{{- if .Values.volumes }}
102112
{{- toYaml .Values.volumes | nindent 8 }}
103113
{{- end }}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{- if .Values.global.shared_secret.create }}
2+
{{ if not (lookup "v1" "Secret" .Release.Namespace "shared-secret" ) }}
3+
apiVersion: v1
4+
kind: Secret
5+
metadata:
6+
name: shared-secret
7+
namespace: {{ .Values.global.namespace | default .Release.Namespace }}
8+
type: Opaque
9+
stringData:
10+
shared_secret.yaml: |-
11+
{{- toYaml .Values.global.shared_secret | nindent 4 }}
12+
{{- end }}
13+
{{- end }}

0 commit comments

Comments
 (0)