diff options
author | 2025-02-10 11:57:45 +0100 | |
---|---|---|
committer | 2025-02-23 11:53:14 +0000 | |
commit | d9c3cc6c8dc375df464fd0cdf009572d7bc3831b (patch) | |
tree | edf8bb691a2a393869bc970c3e441eabee43c027 /kubernetes/common/elasticsearch/components/master/templates | |
parent | dc8cf1efa5e069173351ffcc8d065478fdeac3d5 (diff) |
[COMMON] Add label template and make jobs GitOps ready
- update label template and use it within the resource definitions
- add jobAnnotations in DB init jobs to make them GitOps ready
- add bitnami/common chart to nginx and fix lint errors
Issue-ID: OOM-3327
Issue-ID: OOM-3329
Change-Id: I72b1adad43ff479e46f6db2834c627d74c97a20c
Signed-off-by: Andreas Geissler <andreas-geissler@telekom.de>
Diffstat (limited to 'kubernetes/common/elasticsearch/components/master/templates')
-rw-r--r-- | kubernetes/common/elasticsearch/components/master/templates/statefulset.yaml | 79 |
1 files changed, 50 insertions, 29 deletions
diff --git a/kubernetes/common/elasticsearch/components/master/templates/statefulset.yaml b/kubernetes/common/elasticsearch/components/master/templates/statefulset.yaml index 8ee0fc50db..54b427c80d 100644 --- a/kubernetes/common/elasticsearch/components/master/templates/statefulset.yaml +++ b/kubernetes/common/elasticsearch/components/master/templates/statefulset.yaml @@ -42,17 +42,21 @@ spec: {{- if .Values.tolerations }} tolerations: {{- include "common.tplValue" (dict "value" .Values.tolerations "context" $) | nindent 8 }} {{- end }} - {{- if .Values.securityContext.enabled }} - securityContext: - fsGroup: {{ .Values.securityContext.fsGroup }} - {{- end }} - {{- if or .Values.sysctlImage.enabled (and .Values.volumePermissions.enabled .Values.persistence.enabled) }} + {{ include "common.podSecurityContext" . | indent 6 | trim }} initContainers: {{- if .Values.sysctlImage.enabled }} ## Image that performs the sysctl operation to modify Kernel settings (needed sometimes to avoid boot errors) - name: sysctl image: {{ include "repositoryGenerator.image.busybox" . }} imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + {{ include "common.containerSecurityContext" . | indent 10 | trim }} + resources: + limits: + cpu: 20m + memory: 50Mi + requests: + cpu: 5m + memory: 20Mi command: - /bin/sh - -c @@ -60,37 +64,35 @@ spec: set -o errexit set -o pipefail set -o nounset - sysctl -w vm.max_map_count=262144 && sysctl -w fs.file-max=65536 - securityContext: - privileged: true + volumeMounts: + - mountPath: /etc/sysctl.conf + name: config + subPath: sysctl.conf {{- end }} - {{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }} - - name: volume-permissions - image: {{ include "repositoryGenerator.image.busybox" . }} + - name: {{ include "common.name" . }}-config-copy + image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image }} imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + {{ include "common.containerSecurityContext" . | indent 10 | trim }} + resources: + limits: + cpu: 20m + memory: 50Mi + requests: + cpu: 5m + memory: 20Mi command: - /bin/sh - -c - | - chown -R {{ .Values.securityContext.runAsUser }}:{{ .Values.securityContext.fsGroup }} //bitnami/elasticsearch/data - securityContext: - runAsUser: 0 - {{- if .Values.volumePermissions.resource }} - resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }} - {{- end }} + cp -R /opt/bitnami/elasticsearch/config/. /opt/bitnami/elasticsearch/config_rw volumeMounts: - - name: data - mountPath: "/bitnami/elasticsearch/data" - {{- end }} - {{- end }} + - mountPath: /opt/bitnami/elasticsearch/config_rw + name: bitnami-config containers: - name: {{ include "common.name" . }}-master - image: {{ printf "%s/%s" (include "repositoryGenerator.dockerHubRepository" .) .Values.image }} + image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image }} imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} - {{- if .Values.securityContext.enabled }} - securityContext: - runAsUser: {{ .Values.securityContext.runAsUser }} - {{- end }} + {{ include "common.containerSecurityContext" . | indent 10 | trim }} env: - name: BITNAMI_DEBUG value: {{ ternary "true" "false" .Values.debug | quote }} @@ -147,6 +149,14 @@ spec: resources: {{- toYaml .Values.resources | nindent 12 }} {{- end }} volumeMounts: + - mountPath: /tmp + name: tmp + - mountPath: /opt/bitnami/elasticsearch/logs + name: bitnami-logs + - mountPath: /opt/bitnami/elasticsearch/tmp + name: bitnami-tmp + - mountPath: /opt/bitnami/elasticsearch/config + name: bitnami-config {{- if .Values.config }} - mountPath: /opt/bitnami/elasticsearch/config/elasticsearch.yml name: config @@ -158,17 +168,28 @@ spec: {{- toYaml .Values.extraVolumeMounts | nindent 12 }} {{- end }} volumes: - {{- if .Values.config }} - name: config configMap: name: {{ include "common.fullname" . }} - {{- end }} + - emptyDir: + sizeLimit: {{ .Values.volumes.tmpSizeLimit }} + name: tmp + - emptyDir: + sizeLimit: {{ .Values.volumes.bitnamiLogsSizeLimit }} + name: bitnami-logs + - emptyDir: + sizeLimit: {{ .Values.volumes.bitnamiTmpSizeLimit }} + name: bitnami-tmp + - emptyDir: + sizeLimit: {{ .Values.volumes.bitnamiConfigSizeLimit }} + name: bitnami-config {{- if .Values.extraVolumes }} {{- toYaml .Values.extraVolumes | nindent 8 }} {{- end }} {{- if not .Values.persistence.enabled }} - name: "data" - emptyDir: {} + emptyDir: + sizeLimit: {{ .Values.volumes.dataSizeLimit }} {{- else }} volumeClaimTemplates: - metadata: |