Updating charts to use common resource template
[oom.git] / kubernetes / sdc / charts / sdc-es / templates / deployment.yaml
index 699dfc3..c3d9600 100644 (file)
@@ -1,4 +1,5 @@
 # Copyright © 2017 Amdocs, AT&T, Bell Canada
+# Modifications Copyright © 2018 ZTE
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -30,35 +31,20 @@ spec:
         app: {{ include "common.name" . }}
         release: {{ .Release.Name }}
     spec:
-      initContainers:
-      - name: {{ include "common.name" . }}-logs-init
-        command:
-        - /bin/bash
-        - "-c"
-        - |
-          mkdir -p /ubuntu-init/ASDC/ASDC-ES/
-          chmod -R 777 /ubuntu-init/
-        image: "{{ .Values.global.ubuntuInitRepository }}/{{ .Values.global.ubuntuInitImage }}"
-        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-        volumeMounts:
-        - name: {{ include "common.fullname" . }}-logs
-          mountPath: /ubuntu-init/
       containers:
         - name: {{ include "common.name" . }}
-          image: "{{ .Values.global.repository | default .Values.repository }}/{{ .Values.image }}"
+          image: "{{ include "common.repository" . }}/{{ .Values.image }}"
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
           ports:
           - containerPort: {{ .Values.service.internalPort }}
           - containerPort: {{ .Values.service.internalPort2 }}
-          # disable liveness probe when breakpoints set in debugger
-          # so K8s doesn't restart unresponsive container
-          {{- if eq .Values.liveness.enabled true }}
+          {{ if eq .Values.liveness.enabled true }}
           livenessProbe:
             tcpSocket:
               port: {{ .Values.service.internalPort }}
             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
             periodSeconds: {{ .Values.liveness.periodSeconds }}
-          {{ end -}}
+          {{ end }}
           readinessProbe:
             httpGet:
               path: "_cluster/health?wait_for_status=yellow&timeout=120s"
@@ -66,6 +52,8 @@ spec:
               scheme: HTTP
             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
             periodSeconds: {{ .Values.readiness.periodSeconds }}
+          resources:
+{{ include "common.resources" . | indent 12 }}
           env:
           - name: ENVNAME
             value: {{ .Values.global.env.name }}
@@ -83,20 +71,8 @@ spec:
           - name: {{ include "common.fullname" . }}-localtime
             mountPath: /etc/localtime
             readOnly: true
-          - name: {{ include "common.fullname" . }}-logs
-            mountPath: /var/lib/jetty/logs
           - name: {{ include "common.fullname" . }}-data
             mountPath: /usr/share/elasticsearch/data/
-          resources:
-{{ toYaml .Values.resources | indent 12 }}
-        {{- if .Values.nodeSelector }}
-        nodeSelector:
-{{ toYaml .Values.nodeSelector | indent 10 }}
-        {{- end -}}
-        {{- if .Values.affinity }}
-        affinity:
-{{ toYaml .Values.affinity | indent 10 }}
-        {{- end }}
       volumes:
         - name: {{ include "common.fullname" . }}-localtime
           hostPath:
@@ -112,7 +88,5 @@ spec:
           configMap:
             name: {{ .Release.Name }}-sdc-environments-configmap
             defaultMode: 0755
-        - name: {{ include "common.fullname" . }}-logs
-          emptyDir: {}
       imagePullSecrets:
-      - name: "{{ include "common.namespace" . }}-docker-registry-key"
\ No newline at end of file
+      - name: "{{ include "common.namespace" . }}-docker-registry-key"