Update repo URL domain name
[it/dep.git] / ricplt / appmgr / charts / appmgr / templates / deployment.yaml
1 ################################################################################
2 #   Copyright (c) 2019 AT&T Intellectual Property.                             #
3 #   Copyright (c) 2019 Nokia.                                                  #
4 #                                                                              #
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #
6 #   you may not use this file except in compliance with the License.           #
7 #   You may obtain a copy of the License at                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
11 #   Unless required by applicable law or agreed to in writing, software        #
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################
17
18 apiVersion: apps/v1
19 kind: Deployment
20 metadata:
21   name: {{ include "appmgr.fullname" . }}
22   namespace: {{ include "common.namespace" . }}
23   labels:
24     app: {{ include "common.namespace" . }}-{{ include "common.name" . }}
25     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
26     release: {{ .Release.Name }}
27     heritage: {{ .Release.Service }}
28 spec:
29   replicas: {{ .Values.replicaCount }}
30   selector:
31     matchLabels:
32       app: {{ include "common.namespace" . }}-{{ include "common.name" . }}
33       release: {{ .Release.Name }}
34       #app.kubernetes.io/name: {{ include "appmgr.name" . }}
35       #app.kubernetes.io/instance: {{ .Release.Name }}
36   template:
37     metadata:
38       labels:
39         app: {{ include "common.namespace" . }}-{{ include "common.name" . }}
40         release: {{ .Release.Name }}
41     spec:
42       hostname: {{ include "common.namespace" . }}-{{ include "common.name" . }}
43       imagePullSecrets:
44         - name: {{ .Values.image.repositoryCred }}
45       hostAliases:
46         # create a DNS name entry in container's /etc/hosts for resolving helm chart repo hostnaem
47         - ip: "${__RUNRICENV_DOCKER_IP__}"
48           hostnames:
49             - "${__RUNRICENV_DOCKER_HOST__}"
50         - ip: "${__RUNRICENV_HELMREPO_IP__}"
51           hostnames:
52             - "${__RUNRICENV_HELMREPO_HOST__}"
53       containers:
54         - name: {{ include "common.namespace" . }}-{{ include "common.name" . }}
55           image: "{{ .Values.image.repository }}/{{ .Values.image.name }}:{{ .Values.image.tag }}"
56           imagePullPolicy: {{ .Values.image.pullPolicy }}
57           ports:
58             - name: http
59               containerPort: {{ .Values.containerPort }}
60               protocol: TCP
61           volumeMounts:
62             - name: config-volume
63               mountPath: {{ .Values.appconfigpath }}
64             - name: secret-volume
65               mountPath: {{ .Values.appsecretpath }}
66             - name: cert-volume
67               mountPath: {{ .Values.appcertpath }}
68           envFrom:
69             - configMapRef:
70                 name: {{ include "appmgr.fullname" . }}-appenv
71           livenessProbe:
72             #exec:
73             #  command:
74             #    - /bin/bash
75             #    - -c
76             #    - ps -ef | grep {{ .Values.livenessprocessname }}| grep -v "grep"
77             #initialDelaySeconds: 120
78             #periodSeconds: 30
79           readinessProbe:
80           #  httpGet:
81           #    path: /
82           #    port: http
83           restartPolicy: Always
84           resources:
85             {{- toYaml .Values.resources | nindent 12 }}
86           securityContext:
87             # ubuntu
88             #runAsUser: 1000
89             #allowPrivilegeEscalation: false
90       {{- with .Values.nodeSelector }}
91       nodeSelector:
92         {{- toYaml . | nindent 8 }}
93       {{- end }}
94     {{- with .Values.affinity }}
95       affinity:
96         {{- toYaml . | nindent 8 }}
97     {{- end }}
98     {{- with .Values.tolerations }}
99       tolerations:
100         {{- toYaml . | nindent 8 }}
101     {{- end }}
102
103       volumes:
104         - name: config-volume
105           configMap:
106             name: {{ include "appmgr.fullname" . }}-appconfig
107         - name: secret-volume
108           secret:
109             secretName: {{ .Values.appsecretobject }}
110         - name: cert-volume
111           configMap:
112             name: {{ .Values.appcertobject }}