mirror of
https://github.com/bitnami/charts.git
synced 2026-03-16 06:47:30 +08:00
[bitnami/logstash] Add persistence and volumePermissions (#6284)
* [bitnami/logstash] Add persistence and volumePermissions * Chart version bump * Chart fix linting * Apply suggestions * Add persistence section * Update bitnami/logstash/README.md Co-authored-by: Juan Ariza Toledano <juanariza@vmware.com> * [bitnami/logstash] Update components versions Signed-off-by: Bitnami Containers <containers@bitnami.com> Co-authored-by: Juan Ariza Toledano <juanariza@vmware.com> Co-authored-by: Bitnami Containers <containers@bitnami.com>
This commit is contained in:
@@ -62,3 +62,10 @@ logstash: metrics
|
||||
Please enable the Montoring API (--set enableMonitoringAPI="true")
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper image name (for the init container volume-permissions image)
|
||||
*/}}
|
||||
{{- define "logstash.volumePermissions.image" -}}
|
||||
{{- include "common.images.image" ( dict "imageRoot" .Values.volumePermissions.image "global" .Values.global ) -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -49,6 +49,29 @@ spec:
|
||||
runAsUser: {{ .Values.securityContext.runAsUser }}
|
||||
fsGroup: {{ .Values.securityContext.fsGroup }}
|
||||
{{- end }}
|
||||
{{- if or (and .Values.securityContext.enabled .Values.volumePermissions.enabled .Values.persistence.enabled) (.Values.initContainers) }}
|
||||
initContainers:
|
||||
{{- if and .Values.securityContext.enabled .Values.volumePermissions.enabled }}
|
||||
- name: volume-permissions
|
||||
image: {{ include "logstash.volumePermissions.image" . }}
|
||||
imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }}
|
||||
command:
|
||||
- /bin/bash
|
||||
- -ec
|
||||
- |
|
||||
chown -R {{ .Values.securityContext.runAsUser }}:{{ .Values.securityContext.fsGroup }} "{{ .Values.persistence.mountPath }}"
|
||||
securityContext: {{ .Values.volumePermissions.securityContext | toYaml | nindent 12 }}
|
||||
{{- if .Values.volumePermissions.resources }}
|
||||
resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: {{ .Values.persistence.mountPath }}
|
||||
{{- end }}
|
||||
{{- if .Values.initContainers }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: logstash
|
||||
image: {{ include "logstash.image" . }}
|
||||
@@ -66,6 +89,10 @@ spec:
|
||||
value: {{ ternary "yes" "no" .Values.enableMonitoringAPI | quote }}
|
||||
- name: LOGSTASH_API_PORT_NUMBER
|
||||
value: {{ .Values.monitoringAPIPort | quote }}
|
||||
{{- if .Values.persistence.enabled }}
|
||||
- name: LOGSTASH_DATA_DIR
|
||||
value: {{ .Values.persistence.mountPath }}
|
||||
{{- end }}
|
||||
{{- if .Values.extraEnvVars }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
@@ -91,6 +118,10 @@ spec:
|
||||
resources: {{- toYaml .Values.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
{{- if .Values.persistence.enabled }}
|
||||
- name: data
|
||||
mountPath: {{ .Values.persistence.mountPath }}
|
||||
{{- end }}
|
||||
{{- if or .Values.input .Values.filter .Values.output .Values.existingConfiguration }}
|
||||
- name: configurations
|
||||
mountPath: /bitnami/logstash/config
|
||||
@@ -128,6 +159,28 @@ spec:
|
||||
configMap:
|
||||
name: {{ include "logstash.configmapName" . }}
|
||||
{{- end }}
|
||||
{{- if and .Values.persistence.enabled }}
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .Values.persistence.existingClaim | default (include "common.names.fullname" .) }}
|
||||
{{- end }}
|
||||
{{- if .Values.extraVolumes }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.extraVolumes "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: data
|
||||
{{- if .Values.persistence.annotations }}
|
||||
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.annotations "context" $) | nindent 10 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes:
|
||||
{{- range .Values.persistence.accessModes }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.persistence.size | quote }}
|
||||
{{ include "common.storage.class" (dict "persistence" .Values.persistence "global" .Values.global) }}
|
||||
{{- end }}
|
||||
|
||||
Reference in New Issue
Block a user