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

Commit

Permalink
[logstash] Restart the logstash pod when the secrets have changed (#723)
Browse files Browse the repository at this point in the history
  • Loading branch information
kksudo authored and jmlrt committed Jul 15, 2020
1 parent 8430060 commit 5f5c0d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions logstash/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,17 @@ spec:
{{- range $key, $value := .Values.podAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{/* This forces a restart if the configmap has changed */}}
{{- /* This forces a restart if the configmap has changed */}}
{{- if .Values.logstashConfig }}
configchecksum: {{ include (print .Template.BasePath "/configmap-config.yaml") . | sha256sum | trunc 63 }}
{{- end }}
{{/* This forces a restart if the configmap has changed */}}
{{- /* This forces a restart if the configmap has changed */}}
{{- if .Values.logstashPipeline }}
pipelinechecksum: {{ include (print .Template.BasePath "/configmap-pipeline.yaml") . | sha256sum | trunc 63 }}
{{- end }}
{{- if .Values.secrets }}
secretschecksum: {{ include (print .Template.BasePath "/secret.yaml") . | sha256sum | trunc 63 }}
{{- end }}
spec:
{{- if .Values.schedulerName }}
schedulerName: "{{ .Values.schedulerName }}"
Expand Down
4 changes: 4 additions & 0 deletions logstash/tests/logstash_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,10 @@ def test_adding_a_secret():
assert len(r["secret"]) == 1
assert len(s["data"]) == 1
assert s["data"] == {"ELASTICSEARCH_PASSWORD": content_b64}
assert (
"secretschecksum"
in r["statefulset"][name]["spec"]["template"]["metadata"]["annotations"]
)


def test_adding_secret_from_file():
Expand Down

0 comments on commit 5f5c0d3

Please sign in to comment.