diff --git a/charts/seq/templates/deployment.yaml b/charts/seq/templates/deployment.yaml index 7671ae7..daa1cbe 100644 --- a/charts/seq/templates/deployment.yaml +++ b/charts/seq/templates/deployment.yaml @@ -128,7 +128,10 @@ spec: - name: "SEQ_ADDRESS" value: "http://localhost:{{ .Values.ingestion.service.port }}" - name: "SEQ_API_KEY" - value: "{{ .Values.gelf.apiKey }}" + valueFrom: + secretKeyRef: + name: "{{ default (printf "%s-apiKeys" (include "seq.fullname" .)) .Values.gelf.existingApiKey.name }}" + key: "{{ default "gelf-key" .Values.gelf.existingApiKey.key }}" - name: "GELF_ADDRESS" value: "{{ .Values.gelf.service.protocol | lower }}://0.0.0.0:12201" - name: "GELF_ENABLE_DIAGNOSTICS" @@ -148,7 +151,10 @@ spec: - name: "SEQ_ADDRESS" value: "http://localhost:{{ .Values.ingestion.service.port }}" - name: "SEQ_API_KEY" - value: "{{ .Values.syslog.apiKey }}" + valueFrom: + secretKeyRef: + name: "{{- default (printf "%s-apiKeys" (include "seq.fullname" .)) .Values.syslog.existingApiKey.name }}" + key: "{{- default "syslog-key" .Values.syslog.existingApiKey.key }}" - name: "SYSLOG_ADDRESS" value: "{{ .Values.syslog.service.protocol | lower }}://0.0.0.0:514" - name: "SYSLOG_ENABLE_DIAGNOSTICS" diff --git a/charts/seq/templates/secret.yaml b/charts/seq/templates/secret.yaml new file mode 100644 index 0000000..def9c0f --- /dev/null +++ b/charts/seq/templates/secret.yaml @@ -0,0 +1,17 @@ +{{- if or (and .Values.gelf.enabled (not .Values.gelf.existingApiKey.name)) (and .Values.syslog.enabled (not .Values.syslog.existingApiKey.name)) }} +apiVersion: v1 +kind: Secret +metadata: + labels: + app: {{ template "seq.name" . }} + chart: {{ template "seq.chart" . }} + release: {{ .Release.Name }} + name: {{ template "seq.fullname" . }}-apiKeys +data: + {{- if and .Values.gelf.enabled (not .Values.gelf.existingApiKey.name) }} + gelf-key: {{ .Values.gelf.apiKey | b64enc | quote }} + {{- end}} + {{- if and .Values.syslog.enabled (not .Values.syslog.existingApiKey.name) }} + syslog-key: {{ .Values.syslog.apiKey | b64enc | quote }} + {{- end }} +{{- end }} diff --git a/charts/seq/values.yaml b/charts/seq/values.yaml index 7b854f4..1453c43 100644 --- a/charts/seq/values.yaml +++ b/charts/seq/values.yaml @@ -95,6 +95,11 @@ gelf: protocol: TCP nodePort: "" + apiKey: "" + existingApiKey: + name: "" + key: "" + # Accept events in the Syslog format and forward them to Seq. syslog: enabled: false @@ -112,6 +117,11 @@ syslog: protocol: UDP nodePort: "" + apiKey: "" + existingApiKey: + name: "" + key: "" + service: type: ClusterIP