[UUI] Update image version 16.0.1 of components of UUI
[oom.git] / kubernetes / common / elasticsearch / templates / coordinating-deploy.yaml
index 65a7f46..08c9303 100644 (file)
@@ -1,3 +1,4 @@
+{{/*
 # Copyright © 2020 Bitnami, AT&T, Amdocs, Bell Canada, highstreet technologies
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -11,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+*/}}
 apiVersion: apps/v1
 kind: Deployment
 {{ $role := "coordinating-only" -}}
@@ -28,7 +30,7 @@ spec:
   template:
     metadata: {{- include "common.templateMetadata" (dict "labels" $labels "dot" .) | nindent 6 }}
     spec:
-{{- include "elasticsearch.imagePullSecrets" . | nindent 6 }}
+      {{- include "common.imagePullSecrets" . | nindent 6 }}
       {{- if .Values.affinity }}
       affinity: {{- include "common.tplValue" (dict "value" .Values.affinity "context" $) | nindent 8 }}
       {{- end }}
@@ -39,17 +41,22 @@ spec:
       tolerations: {{- include "common.tplValue" (dict "value" .Values.tolerations "context" $) | nindent 8 }}
       {{- end }}
       serviceAccountName: {{ template "elasticsearch.serviceAccountName" . }}
-      {{- if .Values.securityContext.enabled }}
-      securityContext:
-        fsGroup: {{ .Values.securityContext.fsGroup }}
-      {{- end }}
-
+      {{ include "common.podSecurityContext" . | indent 6 | trim }}
       ## Image that performs the sysctl operation to modify Kernel settings (needed sometimes to avoid boot errors)
       initContainers:
-      {{- if .Values.sysctlImage.enabled }}
+       {{- if .Values.sysctlImage.enabled }}
+        ## Image that performs the sysctl operation to modify Kernel settings (needed sometimes to avoid boot errors)
         - name: sysctl
-          image: {{ .Values.global.busyboxRepository | default .Values.busyboxRepository }}/{{ .Values.global.busyboxImage | default .Values.busyboxImage }}
+          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
@@ -57,15 +64,55 @@ 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
-      {{- end }}
-          {{ include "common.aaf-config" . | nindent 8}}
-
+          volumeMounts:
+            - mountPath: /etc/sysctl.conf
+              name: config
+              subPath: sysctl.conf
+        {{- end }}
+        - 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
+            - |
+              cp -R /opt/bitnami/elasticsearch/config/. /opt/bitnami/elasticsearch/config_rw
+          volumeMounts:
+            - mountPath: /opt/bitnami/elasticsearch/config_rw
+              name: bitnami-config
+        - name: {{ include "common.name" . }}-nginx-config-copy
+          image: {{ include "repositoryGenerator.image.nginx" . }}
+          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.nginx.pullPolicy | quote }}
+          {{ include "common.containerSecurityContext" . | indent 10 | trim }}
+          resources:
+            limits:
+              cpu: 20m
+              memory: 50Mi
+            requests:
+              cpu: 5m
+              memory: 20Mi
+          command:
+            - /bin/sh
+            - -c
+            - |
+              cp -R /opt/bitnami/nginx/conf/. /opt/bitnami/nginx/conf_rw;
+              cp -R /opt/bitnami/nginx/logs/. /opt/bitnami/nginx/logs_rw
+          volumeMounts:
+            - mountPath: /opt/bitnami/nginx/conf_rw
+              name: nginx-config
+            - mountPath: /opt/bitnami/nginx/logs_rw
+              name: nginx-logs
       containers:
         - name: {{ include "common.name" . }}-nginx
-          image: {{printf "%s/%s:%s" (include "common.repository" .)  .Values.nginx.imageName  .Values.nginx.tag }}
+          image: {{ include "repositoryGenerator.image.nginx" . }}
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.nginx.pullPolicy | quote }}
           ports: {{- include "common.containerPorts" . | indent 12 -}}
           {{- if .Values.nginx.livenessProbe }}
@@ -77,23 +124,26 @@ spec:
           {{- if .Values.nginx.resources }}
           resources: {{- toYaml .Values.nginx.resources | nindent 12 }}
           {{- end }}
+          {{ include "common.containerSecurityContext" . | indent 10 | trim }}
           volumeMounts:
+          - mountPath: /opt/bitnami/nginx/conf
+            name: nginx-config
+          - mountPath: /opt/bitnami/nginx/tmp
+            name: nginx-tmp
+          - mountPath: /opt/bitnami/nginx/logs
+            name: nginx-logs
           {{- if .Values.nginx.serverBlock }}
           - name: nginx-server-block
             mountPath: /opt/bitnami/nginx/conf/server_blocks
           {{- end }}
-          {{- include "common.aaf-config-volume-mountpath" . | nindent 10 }}
 
         - name: {{ include "common.name" . }}-elasticsearch
-          image: {{ printf "%s/%s:%s" (include "common.repository" .)  .Values.image.imageName  .Values.image.tag }}
-          {{- if .Values.securityContext.enabled }}
+          image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image }}
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-          securityContext:
-            runAsUser: {{ .Values.securityContext.runAsUser }}
-          {{- end }}
+          {{ include "common.containerSecurityContext" . | indent 10 | trim }}
           env:
             - name: BITNAMI_DEBUG
-              value: {{ ternary "true" "false" .Values.image.debug | quote }}
+              value: {{ ternary "true" "false" .Values.debug | quote }}
             - name: ELASTICSEARCH_CLUSTER_NAME
               value: {{ include "elasticsearch.clustername" .}}
             - name: ELASTICSEARCH_CLUSTER_HOSTS
@@ -110,6 +160,12 @@ spec:
               value: "coordinating"
             - name: ELASTICSEARCH_PORT_NUMBER
               value: "9000"
+            - name: network.bind_host
+              value: 127.0.0.1
+            - name: network.publish_host
+              valueFrom:
+                fieldRef:
+                  fieldPath: status.podIP
           {{/*ports: {{- include "common.containerPorts" . | indent 12 -}} */}}
           {{- if .Values.livenessProbe.enabled }}
           livenessProbe:
@@ -137,6 +193,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
@@ -148,13 +212,33 @@ 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
+        - emptyDir:
+            sizeLimit: {{ .Values.volumes.nginxLogsSizeLimit }}
+          name: nginx-logs
+        - emptyDir:
+            sizeLimit: {{ .Values.volumes.nginxTmpSizeLimit }}
+          name: nginx-tmp
+        - emptyDir:
+            sizeLimit: {{ .Values.volumes.nginxConfigSizeLimit }}
+          name: nginx-config
         - name: data
-          emptyDir: {}
+          emptyDir:
+            sizeLimit: {{ .Values.volumes.dataSizeLimit }}
         {{- if .Values.extraVolumes }}
         {{- toYaml .Values.extraVolumes | nindent 8 }}
         {{- end }}
@@ -163,5 +247,3 @@ spec:
           configMap:
             name: {{ include "common.fullname" . }}-nginx-server-block
         {{- end }}
-        {{- include "common.aaf-config-volumes" . | nindent 8}}
-