1 ################################################################################
2 # Copyright (c) 2019 AT&T Intellectual Property. #
4 # Licensed under the Apache License, Version 2.0 (the "License"); #
5 # you may not use this file except in compliance with the License. #
6 # You may obtain a copy of the License at #
8 # http://www.apache.org/licenses/LICENSE-2.0 #
10 # Unless required by applicable law or agreed to in writing, software #
11 # distributed under the License is distributed on an "AS IS" BASIS, #
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
13 # See the License for the specific language governing permissions and #
14 # limitations under the License. #
15 ################################################################################
19 name: {{ template "logstash.fullname" . }}
21 app: {{ template "logstash.name" . }}
22 chart: {{ template "logstash.chart" . }}
23 release: {{ .Release.Name }}
24 heritage: {{ .Release.Service }}
26 serviceName: {{ template "logstash.fullname" . }}
27 replicas: {{ .Values.replicaCount }}
28 podManagementPolicy: {{ .Values.podManagementPolicy }}
31 app: {{ template "logstash.name" . }}
32 release: {{ .Release.Name }}
36 app: {{ template "logstash.name" . }}
37 release: {{ .Release.Name }}
38 {{- if .Values.podLabels }}
40 {{- range $key, $value := .Values.podLabels }}
41 {{ $key }}: {{ $value | quote }}
45 checksum/patterns: {{ include (print $.Template.BasePath "/patterns-config.yaml") . | sha256sum }}
46 checksum/templates: {{ include (print $.Template.BasePath "/files-config.yaml") . | sha256sum }}
47 checksum/pipeline: {{ include (print $.Template.BasePath "/pipeline-config.yaml") . | sha256sum }}
48 {{- if .Values.podAnnotations }}
49 ## Custom pod annotations
50 {{- range $key, $value := .Values.podAnnotations }}
51 {{ $key }}: {{ $value | quote }}
55 {{- if .Values.priorityClassName }}
56 priorityClassName: "{{ .Values.priorityClassName }}"
59 runAsUser: {{ .Values.securityContext.runAsUser }}
60 fsGroup: {{ .Values.securityContext.fsGroup }}
61 {{- if .Values.image.pullSecrets }}
63 {{ toYaml .Values.image.pullSecrets | indent 8 }}
66 {{- if .Values.extraInitContainers }}
67 {{ toYaml .Values.extraInitContainers | indent 8 }}
72 - name: {{ .Chart.Name }}
73 image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
74 imagePullPolicy: {{ .Values.image.pullPolicy }}
77 containerPort: {{ .Values.exporter.logstash.target.port }}
79 {{ toYaml .Values.ports | indent 12 }}
81 {{ toYaml .Values.livenessProbe | indent 12 }}
83 {{ toYaml .Values.readinessProbe | indent 12 }}
85 ## Logstash monitoring API host and port env vars
89 value: {{ .Values.exporter.logstash.target.port | quote }}
90 ## Elasticsearch output
91 - name: ELASTICSEARCH_HOST
92 value: {{ .Values.elasticsearch.host | quote }}
93 - name: ELASTICSEARCH_PORT
94 value: {{ .Values.elasticsearch.port | quote }}
95 # Logstash Java Options
97 value: {{ .Values.logstashJavaOpts }}
98 ## Additional env vars
99 {{- range $key, $value := .Values.config }}
100 - name: {{ $key | upper | replace "." "_" }}
101 value: {{ $value | quote }}
103 {{- if .Values.extraEnv }}
104 {{ .Values.extraEnv | toYaml | indent 12 }}
107 {{ toYaml .Values.resources | indent 12 }}
109 {{ toYaml .Values.volumeMounts | indent 12 }}
111 {{- if .Values.exporter.logstash.enabled }}
113 - name: {{ .Chart.Name }}-exporter
114 image: "{{ .Values.exporter.logstash.image.repository }}:{{ .Values.exporter.logstash.image.tag }}"
115 imagePullPolicy: {{ .Values.exporter.logstash.image.pullPolicy }}
116 command: ["/bin/sh", "-c"]
117 ## Delay start of logstash-exporter to give logstash more time to come online.
121 exec /logstash_exporter
122 --logstash.endpoint=http://localhost:{{ .Values.exporter.logstash.target.port }}
123 --web.listen-address=:{{ .Values.exporter.logstash.port }}
126 containerPort: {{ .Values.exporter.logstash.port }}
129 {{ toYaml .Values.exporter.logstash.livenessProbe | indent 12 }}
131 {{ toYaml .Values.exporter.logstash.readinessProbe | indent 12 }}
132 {{- with .Values.exporter.logstash.config }}
134 {{- range $key, $value := . }}
135 - name: {{ $key | upper | replace "." "_" }}
136 value: {{ $value | quote }}
140 {{ toYaml .Values.exporter.logstash.resources | indent 12 }}
143 {{- with .Values.nodeSelector }}
145 {{ toYaml . | indent 8 }}
147 {{- with .Values.affinity }}
149 {{ toYaml . | indent 8 }}
151 {{- with .Values.tolerations }}
153 {{ toYaml . | indent 8 }}
155 terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
159 name: {{ template "logstash.fullname" . }}-patterns
162 name: {{ template "logstash.fullname" . }}-files
165 name: {{ template "logstash.fullname" . }}-pipeline
166 {{- with .Values.volumes }}
167 {{ toYaml . | indent 8 }}
169 {{- if not .Values.persistence.enabled }}
173 volumeClaimTemplates:
178 - {{ .Values.persistence.accessMode | quote }}
181 storage: {{ .Values.persistence.size | quote }}
182 {{- if .Values.persistence.storageClass }}
183 {{- if (eq "-" .Values.persistence.storageClass) }}
186 storageClassName: "{{ .Values.persistence.storageClass }}"