Merge "[CONSUL] Add limits to consul chart."
[oom.git] / kubernetes / pomba / charts / pomba-search-data / templates / deployment.yaml
index c0e2568..462d4e6 100644 (file)
@@ -1,3 +1,4 @@
+{{/*
 # Copyright © 2017 Amdocs, Bell Canada
 #
 # 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: extensions/v1beta1
 kind: Deployment
@@ -20,7 +22,7 @@ metadata:
   labels:
     app: {{ include "common.name" . }}
     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ .Release.Name }}
+    release: {{ include "common.release" . }}
     heritage: {{ .Release.Service }}
 spec:
   replicas: {{ .Values.replicaCount }}
@@ -31,9 +33,24 @@ spec:
     metadata:
       labels:
         app: {{ include "common.name" . }}
-        release: {{ .Release.Name }}
+        release: {{ include "common.release" . }}
       name: {{ include "common.name" . }}
     spec:
+      initContainers:
+      - command:
+        - /app/ready.py
+        args:
+        - --container-name
+        - pomba-elasticsearch
+        env:
+        - name: NAMESPACE
+          valueFrom:
+            fieldRef:
+              apiVersion: v1
+              fieldPath: metadata.namespace
+        image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
+        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+        name: {{ include "common.name" . }}-readiness
       containers:
       - name: {{ include "common.name" . }}
         image: "{{ include "common.repository" . }}/{{ .Values.image }}"
@@ -92,7 +109,7 @@ spec:
           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
           periodSeconds: {{ .Values.readiness.periodSeconds }}
         resources:
-{{ toYaml .Values.resources | indent 10 }}
+{{ include "common.resources" . | indent 10 }}
       {{- if .Values.nodeSelector }}
       nodeSelector:
 {{ toYaml .Values.nodeSelector | indent 8 }}
@@ -130,7 +147,7 @@ spec:
           secretName: {{ include "common.fullname" . }}-policy
       - name: filebeat-conf
         configMap:
-          name: {{ .Release.Name }}-pomba-filebeat-configmap
+          name: {{ include "common.release" . }}-pomba-filebeat-configmap
       - name: {{ include "common.fullname" . }}-service-logs
         emptyDir: {}
       - name: {{ include "common.fullname" . }}-service-filebeat