6161 image : {{ include "graylog.image" . }}
6262 imagePullPolicy : {{ .Values.graylog.custom.image.imagePullPolicy }}
6363 command : [ "/bin/sh", "/scripts/init-script.sh" ]
64+ {{- if and .Values.graylog.config.plugins.enabled .Values.graylog.config.init.assetFetch.enabled .Values.graylog.config.init.assetFetch.plugins.enabled .Values.graylog.plugins }}
65+ env :
66+ - name : GRAYLOG_PLUGIN_URLS
67+ value : {{ include "graylog.pluginURLs" . }}
68+ {{- end }}
6469 envFrom :
6570 - configMapRef :
6671 name : {{ include "graylog.configmapName" . }}
@@ -71,10 +76,34 @@ spec:
7176 mountPath : /mnt/data
7277 - name : init-script
7378 mountPath : /scripts
79+ {{- if .Values.graylog.config.plugins.enabled }}
80+ - name : init-plugins
81+ mountPath : /mnt/plugins
82+ {{- range .Values.graylog.plugins }}
83+ {{- if empty .image | and .existingClaim }}
84+ - name : {{ .name }}
85+ mountPath : {{ printf "/mnt/shared/plugins/%s" .name }}
86+ {{- end }}
87+ {{- end }}
88+ {{- range .Values.graylog.plugins }}
89+ {{- if empty .existingClaim | and .image }}
90+ - name : {{ printf "copy-plugin-%s" .name }}
91+ image : {{ .image }}
92+ command : [ "/bin/sh", "-c", "cp *.jar /mnt/plugins/" ]
93+ volumeMounts :
94+ - name : init-plugins
95+ mountPath : /mnt/plugins
96+ {{- end }}
97+ {{- end }}
98+ {{- end }}
7499 containers :
75100 - name : graylog-app
76101 image : {{ include "graylog.image" . }}
77102 imagePullPolicy : {{ .Values.graylog.custom.image.imagePullPolicy }}
103+ {{- if or .Values.graylog.custom.env .Values.graylog.custom.extraEnv }}
104+ env :
105+ {{- include "graylog.custom.env" .Values.graylog | indent 12 }}
106+ {{- end }}
78107 envFrom :
79108 - configMapRef :
80109 name : {{ include "graylog.configmapName" . }}
89118 protocol : TCP
90119 {{- range .Values.graylog.inputs }}
91120 - name : {{ .name }}
92- containerPort : {{ .targetPort | int }}
121+ containerPort : {{ .targetPort | default .port | int }}
93122 protocol : {{ .protocol }}
94123 {{- end }}
95124 - name : input-fwd-conf
@@ -126,6 +155,10 @@ spec:
126155 - name : tls-creds
127156 mountPath : /usr/share/graylog/tls
128157 {{- end }}
158+ {{- if .Values.graylog.config.plugins.enabled }}
159+ - name : init-plugins
160+ mountPath : /usr/share/graylog/plugin
161+ {{- end }}
129162 tolerations :
130163 {{- with .Values.graylog.custom.tolerations }}
131164 {{- toYaml . | nindent 8 }}
@@ -138,12 +171,23 @@ spec:
138171 - name : init-script
139172 configMap :
140173 name : init-script-cm
141- defaultMode : 0755 # Make script executable
174+ defaultMode : 0755
142175 {{- if .Values.graylog.config.tls.byoc.enabled }}
143176 - name : tls-creds
144177 secret :
145178 secretName : {{ .Values.graylog.config.tls.byoc.secretName | quote }}
146179 {{- end }}
180+ {{- if .Values.graylog.config.plugins.enabled }}
181+ - name : init-plugins
182+ emptyDir : {}
183+ {{- range .Values.graylog.plugins }}
184+ {{- if empty .url | and .existingClaim }}
185+ - name : {{ .name }}
186+ persistentVolumeClaim :
187+ claimName : {{ .existingClaim }}
188+ {{- end }}
189+ {{- end }}
190+ {{- end }}
147191 {{- if not .Values.graylog.custom.persistence.enabled | or .Values.graylog.custom.persistence.existingClaim }}
148192 - name : {{ include "graylog.volumeName" . }}
149193 {{- if .Values.graylog.custom.persistence.existingClaim }}
0 commit comments