DNS add option for display target machine info
[oom.git] / kubernetes / sdc / charts / sdc-kb / templates / deployment.yaml
1 # Copyright © 2017 Amdocs, Bell Canada
2 # Modifications Copyright © 2018 AT&T, ZTE
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 apiVersion: extensions/v1beta1
17 kind: Deployment
18 metadata:
19   name: {{ include "common.fullname" . }}
20   namespace: {{ include "common.namespace" . }}
21   labels:
22     app: {{ include "common.name" . }}
23     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
24     release: {{ include "common.release" . }}
25     heritage: {{ .Release.Service }}
26 spec:
27   replicas: {{ .Values.replicaCount }}
28   template:
29     metadata:
30       labels:
31         app: {{ include "common.name" . }}
32         release: {{ include "common.release" . }}
33     spec:
34       initContainers:
35       - name: {{ include "common.name" . }}-job-completion
36         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
37         imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}"
38         command:
39         - /root/job_complete.py
40         args:
41         - --job-name
42         - {{ include "common.release" . }}-sdc-es-config-elasticsearch
43         env:
44         - name: NAMESPACE
45           valueFrom:
46             fieldRef:
47               apiVersion: v1
48               fieldPath: metadata.namespace
49       containers:
50         - name: {{ include "common.name" . }}
51           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
52           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
53           ports:
54           - containerPort: {{ .Values.service.internalPort }}
55           {{ if eq .Values.liveness.enabled true }}
56           livenessProbe:
57             tcpSocket:
58               port: {{ .Values.service.internalPort }}
59             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
60             periodSeconds: {{ .Values.liveness.periodSeconds }}
61           {{ end }}
62           readinessProbe:
63             tcpSocket:
64               port: {{ .Values.service.internalPort }}
65             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
66             periodSeconds: {{ .Values.readiness.periodSeconds }}
67           resources:
68 {{ include "common.resources" . | indent 12 }}
69           env:
70           - name: ENVNAME
71             value: {{ .Values.global.env.name }}
72           - name: NODE_OPTIONS
73             value: {{ .Values.config.nodeOptions }}
74           - name: HOST_IP
75             valueFrom:
76               fieldRef:
77                 fieldPath: status.podIP
78           volumeMounts:
79           - name: {{ include "common.fullname" . }}-environments
80             mountPath: /root/chef-solo/environments/
81           - name: {{ include "common.fullname" . }}-localtime
82             mountPath: /etc/localtime
83             readOnly: true
84       volumes:
85       - name: {{ include "common.fullname" . }}-localtime
86         hostPath:
87           path: /etc/localtime
88       - name: {{ include "common.fullname" . }}-environments
89         configMap:
90           name: {{ include "common.release" . }}-sdc-environments-configmap
91           defaultMode: 0755
92       imagePullSecrets:
93       - name: "{{ include "common.namespace" . }}-docker-registry-key"