blob: 847e636fa8047cdb84ce5372b089a0c478f52bb3 [file] [log] [blame]
Priyanka5fdca022018-03-13 12:53:06 +00001# Copyright © 2017 Amdocs, Bell Canada
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15apiVersion: extensions/v1beta1
16kind: Deployment
17metadata:
18 name: {{ include "common.fullname" . }}
19 namespace: {{ include "common.namespace" . }}
20 labels:
21 app: {{ include "common.name" . }}
22 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
23 release: {{ .Release.Name }}
24 heritage: {{ .Release.Service }}
25spec:
26 replicas: {{ .Values.replicaCount }}
27 template:
28 metadata:
29 labels:
30 app: {{ include "common.name" . }}
31 release: {{ .Release.Name }}
32 spec:
33 initContainers:
34 - command:
35 - /root/ready.py
36 args:
37 - --container-name
38 - {{ .Values.mariadb.nameOverride }}
39 env:
40 - name: NAMESPACE
41 valueFrom:
42 fieldRef:
43 apiVersion: v1
44 fieldPath: metadata.namespace
45 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
46 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
47 name: {{ include "common.name" . }}-readiness
48 containers:
49 - name: {{ include "common.name" . }}
50 image: "{{ .Values.global.repository | default .Values.repository }}/{{ .Values.image }}"
51 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
52 lifecycle:
53 postStart:
54 exec:
55 command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/usr/local/tomcat/webapps/vid/WEB-INF/classes/; while [ ! -e $DST ]; do echo 'Waiting for $DST...' >> $LOG; sleep 5; done; sleep 2; /bin/cp -f $SRC $DST; echo 'Done' >> $LOG"]
56 ports:
57 - containerPort: {{ .Values.service.internalPort }}
58 # disable liveness probe when breakpoints set in debugger
59 # so K8s doesn't restart unresponsive container
60 {{- if eq .Values.liveness.enabled true }}
61 livenessProbe:
62 tcpSocket:
63 port: {{ .Values.service.internalPort }}
64 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
65 periodSeconds: {{ .Values.liveness.periodSeconds }}
66 {{ end -}}
67 readinessProbe:
68 tcpSocket:
69 port: {{ .Values.service.internalPort }}
70 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
71 periodSeconds: {{ .Values.readiness.periodSeconds }}
72 env:
73 - name: ASDC_CLIENT_REST_HOST
mahendrrbb49cf92018-04-16 08:33:47 +000074 value: sdc-be.{{ include "common.namespace" . }}
Priyanka5fdca022018-03-13 12:53:06 +000075 - name: ASDC_CLIENT_REST_AUTH
76 value: "{{ .Values.config.asdcclientrestauth }}"
77 - name: ASDC_CLIENT_REST_PORT
78 value: "{{ .Values.config.asdcclientrestport }}"
79 - name: VID_AAI_HOST
mahendrrbb49cf92018-04-16 08:33:47 +000080 value: aai-service.{{ include "common.namespace" . }}
Priyanka5fdca022018-03-13 12:53:06 +000081 - name: VID_AAI_PORT
82 value: "{{ .Values.config.vidaaiport }}"
83 - name: VID_ECOMP_SHARED_CONTEXT_REST_URL
mahendrrbb49cf92018-04-16 08:33:47 +000084 value: http://portalapps.{{ include "common.namespace" . }}:"{{ .Values.config.onapport }}"/ONAPPORTAL/context
Priyanka5fdca022018-03-13 12:53:06 +000085 - name: VID_MSO_SERVER_URL
mahendrrbb49cf92018-04-16 08:33:47 +000086 value: http://mso.{{ include "common.namespace" . }}:"{{ .Values.config.msoport }}"
Priyanka5fdca022018-03-13 12:53:06 +000087 - name: VID_MSO_PASS
88 value: "{{ .Values.config.vidmsopass }}"
89 - name: MSO_DME2_SERVER_URL
90 value: "{{ .Values.config.msodme2serverurl }}"
91 - name: MSO_DME2_ENABLED
92 value: {{ .Values.global.debugEnabled | default .Values.debugEnabled | quote }}
93 - name: VID_ECOMP_REDIRECT_URL
mahendrrbb49cf92018-04-16 08:33:47 +000094 value: http://portalapps.{{ include "common.namespace" . }}:"{{ .Values.config.onapport }}"/ONAPPORTAL/login.htm
Priyanka5fdca022018-03-13 12:53:06 +000095 - name: VID_ECOMP_REST_URL
mahendrrbb49cf92018-04-16 08:33:47 +000096 value: http://portalapps.{{ include "common.namespace" . }}:"{{ .Values.config.onapport }}"/ONAPPORTAL/auxapi
Priyanka5fdca022018-03-13 12:53:06 +000097 - name: VID_CONTACT_US_LINK
98 value: "{{ .Values.config.vidcontactuslink }}"
99 - name: VID_UEB_URL_LIST
mahendrrbb49cf92018-04-16 08:33:47 +0000100 value: dmaap.{{ include "common.namespace" . }}
Priyanka5fdca022018-03-13 12:53:06 +0000101 - name: VID_MYSQL_HOST
mahendrrbb49cf92018-04-16 08:33:47 +0000102 value: "{{ .Release.Name }}-{{ .Values.config.vidmysqlhost }}"
Priyanka5fdca022018-03-13 12:53:06 +0000103 - name: VID_MYSQL_PORT
104 value: "{{ .Values.config.vidmysqlport }}"
105 - name: VID_MYSQL_DBNAME
106 value: "{{ .Values.config.vidmysqldbname }}"
107 - name: VID_MYSQL_USER
108 value: "{{ .Values.config.vidmysqluser }}"
109 - name: VID_MYSQL_PASS
110 valueFrom:
111 secretKeyRef:
112 name: {{ template "common.fullname" . }}
113 key: vid-password
114 - name: VID_MYSQL_MAXCONNECTIONS
115 value: "{{ .Values.config.vidmysqlmaxconnections }}"
116 volumeMounts:
117 - mountPath: /etc/localtime
118 name: localtime
119 readOnly: true
120 - mountPath: /var/log/onap
121 name: vid-logs
122 - mountPath: /tmp/logback.xml
123 name: vid-logback
124 subPath: logback.xml
125 resources:
126{{ toYaml .Values.resources | indent 12 }}
127 {{- if .Values.nodeSelector }}
128 nodeSelector:
129{{ toYaml .Values.nodeSelector | indent 10 }}
130 {{- end -}}
131 {{- if .Values.affinity }}
132 affinity:
133{{ toYaml .Values.affinity | indent 10 }}
134 {{- end }}
135 # side car containers
136 - name: filebeat-onap
137 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
138 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
139 volumeMounts:
140 - mountPath: /usr/share/filebeat/filebeat.yml
141 name: filebeat-conf
142 subPath: filebeat.yml
143 - mountPath: /var/log/onap
144 name: vid-logs
145 - mountPath: /usr/share/filebeat/data
146 name: vid-data-filebeat
147 volumes:
148 - name: localtime
149 hostPath:
150 path: /etc/localtime
151 - name: filebeat-conf
152 configMap:
153 name: {{ include "common.fullname" . }}-filebeat-configmap
154 - name: vid-logs
155 emptyDir: {}
156 - name: vid-data-filebeat
157 emptyDir: {}
158 - name: vid-logback
159 configMap:
160 name: {{ include "common.fullname" . }}-log-configmap
161 imagePullSecrets:
162 - name: "{{ include "common.namespace" . }}-docker-registry-key"