Skip to content
This repository was archived by the owner on May 16, 2023. It is now read-only.

Commit 95ecedd

Browse files
committed
Skip referencing the secret elasticsearch-certs if .Values.elasticsearchCertificateSecret is empty
Signed-off-by: Nobi <nobi@nobidev.com>
1 parent 2fd64d0 commit 95ecedd

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

kibana/templates/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ spec:
4949
volumes:
5050
- name: kibana-tokens
5151
emptyDir: {}
52+
{{- if .Values.elasticsearchCertificateSecret }}
5253
- name: elasticsearch-certs
5354
secret:
5455
secretName: {{ .Values.elasticsearchCertificateSecret }}
56+
{{- end }}
5557
{{- if .Values.kibanaConfig }}
5658
- name: kibanaconfig
5759
configMap:
@@ -163,9 +165,11 @@ spec:
163165
resources:
164166
{{ toYaml .Values.resources | indent 10 }}
165167
volumeMounts:
168+
{{- if .Values.elasticsearchCertificateSecret }}
166169
- name: elasticsearch-certs
167170
mountPath: {{ template "kibana.home_dir" . }}/config/certs
168171
readOnly: true
172+
{{- end }}
169173
- name: kibana-tokens
170174
mountPath: {{ template "kibana.home_dir" . }}/config/tokens
171175
readOnly: true

kibana/templates/post-delete-job.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,20 @@ spec:
3838
- name: ELASTICSEARCH_SSL_CERTIFICATEAUTHORITIES
3939
value: "{{ template "kibana.home_dir" . }}/config/certs/{{ .Values.elasticsearchCertificateAuthoritiesFile }}"
4040
volumeMounts:
41+
{{- if .Values.elasticsearchCertificateSecret }}
4142
- name: elasticsearch-certs
4243
mountPath: {{ template "kibana.home_dir" . }}/config/certs
4344
readOnly: true
45+
{{- end }}
4446
- name: kibana-helm-scripts
4547
mountPath: {{ template "kibana.home_dir" . }}/helm-scripts
4648
serviceAccount: post-delete-{{ template "kibana.fullname" . }}
4749
volumes:
50+
{{- if .Values.elasticsearchCertificateSecret }}
4851
- name: elasticsearch-certs
4952
secret:
5053
secretName: {{ .Values.elasticsearchCertificateSecret }}
54+
{{- end }}
5155
- name: kibana-helm-scripts
5256
configMap:
5357
name: {{ template "kibana.fullname" . }}-helm-scripts

kibana/templates/pre-install-job.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,25 @@ spec:
3535
secretKeyRef:
3636
name: {{ .Values.elasticsearchCredentialSecret }}
3737
key: password
38+
{{- if .Values.elasticsearchCertificateSecret }}
3839
- name: ELASTICSEARCH_SSL_CERTIFICATEAUTHORITIES
3940
value: "{{ template "kibana.home_dir" . }}/config/certs/{{ .Values.elasticsearchCertificateAuthoritiesFile }}"
41+
{{- end }}
4042
volumeMounts:
43+
{{- if .Values.elasticsearchCertificateSecret }}
4144
- name: elasticsearch-certs
4245
mountPath: {{ template "kibana.home_dir" . }}/config/certs
4346
readOnly: true
47+
{{- end }}
4448
- name: kibana-helm-scripts
4549
mountPath: {{ template "kibana.home_dir" . }}/helm-scripts
4650
serviceAccount: pre-install-{{ template "kibana.fullname" . }}
4751
volumes:
52+
{{- if .Values.elasticsearchCertificateSecret }}
4853
- name: elasticsearch-certs
4954
secret:
5055
secretName: {{ .Values.elasticsearchCertificateSecret }}
56+
{{- end }}
5157
- name: kibana-helm-scripts
5258
configMap:
5359
name: {{ template "kibana.fullname" . }}-helm-scripts

0 commit comments

Comments
 (0)