Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 1 | # 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 | |
| 15 | apiVersion: extensions/v1beta1 |
| 16 | kind: Deployment |
| 17 | metadata: |
| 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 }} |
| 25 | spec: |
| 26 | replicas: {{ .Values.replicaCount }} |
| 27 | template: |
| 28 | metadata: |
| 29 | labels: |
| 30 | app: {{ include "common.name" . }} |
| 31 | release: {{ .Release.Name }} |
| 32 | spec: |
| 33 | initContainers: |
Sonsino, Ofir (os0695) | 2dda01d | 2018-05-30 18:41:14 +0300 | [diff] [blame] | 34 | #dd775k: This container checks if the job that wait for all db instances to be up and initializes the db had finished. |
| 35 | # - command: |
| 36 | # - /bin/sh |
| 37 | # args: |
| 38 | # - "-c" |
| 39 | # - "sleep 1000000000m" |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 40 | - command: |
Sonsino, Ofir (os0695) | 2dda01d | 2018-05-30 18:41:14 +0300 | [diff] [blame] | 41 | - python |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 42 | args: |
Sonsino, Ofir (os0695) | 2dda01d | 2018-05-30 18:41:14 +0300 | [diff] [blame] | 43 | - /tmp/vid-check-job-completion/vid_check_job_completion.py |
| 44 | - --job-name |
| 45 | - vid-config-galera |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 46 | env: |
| 47 | - name: NAMESPACE |
| 48 | valueFrom: |
| 49 | fieldRef: |
| 50 | apiVersion: v1 |
| 51 | fieldPath: metadata.namespace |
| 52 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 53 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 54 | name: {{ include "common.name" . }}-readiness |
Sonsino, Ofir (os0695) | 2dda01d | 2018-05-30 18:41:14 +0300 | [diff] [blame] | 55 | volumeMounts: |
| 56 | - mountPath: /tmp/vid-check-job-completion |
| 57 | name: vid-check-job-completion |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 58 | containers: |
| 59 | - name: {{ include "common.name" . }} |
BorislavG | df11cd5 | 2018-05-06 12:55:20 +0000 | [diff] [blame] | 60 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 61 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 62 | lifecycle: |
| 63 | postStart: |
| 64 | exec: |
| 65 | 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"] |
| 66 | ports: |
| 67 | - containerPort: {{ .Values.service.internalPort }} |
| 68 | # disable liveness probe when breakpoints set in debugger |
| 69 | # so K8s doesn't restart unresponsive container |
| 70 | {{- if eq .Values.liveness.enabled true }} |
| 71 | livenessProbe: |
| 72 | tcpSocket: |
| 73 | port: {{ .Values.service.internalPort }} |
| 74 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 75 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 76 | {{ end -}} |
| 77 | readinessProbe: |
| 78 | tcpSocket: |
| 79 | port: {{ .Values.service.internalPort }} |
| 80 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 81 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 82 | env: |
| 83 | - name: ASDC_CLIENT_REST_HOST |
mahendrr | bb49cf9 | 2018-04-16 08:33:47 +0000 | [diff] [blame] | 84 | value: sdc-be.{{ include "common.namespace" . }} |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 85 | - name: ASDC_CLIENT_REST_AUTH |
| 86 | value: "{{ .Values.config.asdcclientrestauth }}" |
| 87 | - name: ASDC_CLIENT_REST_PORT |
| 88 | value: "{{ .Values.config.asdcclientrestport }}" |
| 89 | - name: VID_AAI_HOST |
Roger Maitland | 0c6d4b8 | 2018-05-02 16:03:15 -0400 | [diff] [blame] | 90 | value: aai.{{ include "common.namespace" . }} |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 91 | - name: VID_AAI_PORT |
| 92 | value: "{{ .Values.config.vidaaiport }}" |
| 93 | - name: VID_ECOMP_SHARED_CONTEXT_REST_URL |
Roger Maitland | 0c6d4b8 | 2018-05-02 16:03:15 -0400 | [diff] [blame] | 94 | value: http://portal-app.{{ include "common.namespace" . }}:{{ .Values.config.onapport }}/ONAPPORTAL/context |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 95 | - name: VID_MSO_SERVER_URL |
Piotr Darosz | 12dad20 | 2018-08-29 11:08:03 +0200 | [diff] [blame] | 96 | value: https://so.{{ include "common.namespace" . }}:{{ .Values.config.msoport }} |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 97 | - name: VID_MSO_PASS |
| 98 | value: "{{ .Values.config.vidmsopass }}" |
| 99 | - name: MSO_DME2_SERVER_URL |
| 100 | value: "{{ .Values.config.msodme2serverurl }}" |
| 101 | - name: MSO_DME2_ENABLED |
| 102 | value: {{ .Values.global.debugEnabled | default .Values.debugEnabled | quote }} |
| 103 | - name: VID_ECOMP_REDIRECT_URL |
Roger Maitland | 0c6d4b8 | 2018-05-02 16:03:15 -0400 | [diff] [blame] | 104 | value: http://portal-app.{{ include "common.namespace" . }}:{{ .Values.config.onapport }}/ONAPPORTAL/login.htm |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 105 | - name: VID_ECOMP_REST_URL |
Roger Maitland | 0c6d4b8 | 2018-05-02 16:03:15 -0400 | [diff] [blame] | 106 | value: http://portal-app.{{ include "common.namespace" . }}:{{ .Values.config.onapport }}/ONAPPORTAL/auxapi |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 107 | - name: VID_CONTACT_US_LINK |
| 108 | value: "{{ .Values.config.vidcontactuslink }}" |
| 109 | - name: VID_UEB_URL_LIST |
BorislavG | 1ffbd99 | 2018-04-24 07:56:27 +0000 | [diff] [blame] | 110 | value: message-router.{{ include "common.namespace" . }} |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 111 | - name: VID_MYSQL_HOST |
BorislavG | 1ffbd99 | 2018-04-24 07:56:27 +0000 | [diff] [blame] | 112 | value: "{{ .Values.config.vidmysqlhost }}" |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 113 | - name: VID_MYSQL_PORT |
| 114 | value: "{{ .Values.config.vidmysqlport }}" |
| 115 | - name: VID_MYSQL_DBNAME |
| 116 | value: "{{ .Values.config.vidmysqldbname }}" |
| 117 | - name: VID_MYSQL_USER |
| 118 | value: "{{ .Values.config.vidmysqluser }}" |
| 119 | - name: VID_MYSQL_PASS |
Sonsino, Ofir (os0695) | 2dda01d | 2018-05-30 18:41:14 +0300 | [diff] [blame] | 120 | value: "{{ .Values.config.vidmysqlpassword }}" |
| 121 | #valueFrom: |
| 122 | # secretKeyRef: {name: {{ include "common.fullname" . }}, key: vid-password} |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 123 | - name: VID_MYSQL_MAXCONNECTIONS |
| 124 | value: "{{ .Values.config.vidmysqlmaxconnections }}" |
| 125 | volumeMounts: |
| 126 | - mountPath: /etc/localtime |
| 127 | name: localtime |
| 128 | readOnly: true |
| 129 | - mountPath: /var/log/onap |
| 130 | name: vid-logs |
| 131 | - mountPath: /tmp/logback.xml |
| 132 | name: vid-logback |
| 133 | subPath: logback.xml |
| 134 | resources: |
| 135 | {{ toYaml .Values.resources | indent 12 }} |
| 136 | {{- if .Values.nodeSelector }} |
| 137 | nodeSelector: |
| 138 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 139 | {{- end -}} |
| 140 | {{- if .Values.affinity }} |
| 141 | affinity: |
| 142 | {{ toYaml .Values.affinity | indent 10 }} |
| 143 | {{- end }} |
| 144 | # side car containers |
| 145 | - name: filebeat-onap |
| 146 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 147 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 148 | volumeMounts: |
| 149 | - mountPath: /usr/share/filebeat/filebeat.yml |
| 150 | name: filebeat-conf |
| 151 | subPath: filebeat.yml |
| 152 | - mountPath: /var/log/onap |
| 153 | name: vid-logs |
| 154 | - mountPath: /usr/share/filebeat/data |
| 155 | name: vid-data-filebeat |
| 156 | volumes: |
| 157 | - name: localtime |
| 158 | hostPath: |
| 159 | path: /etc/localtime |
| 160 | - name: filebeat-conf |
| 161 | configMap: |
| 162 | name: {{ include "common.fullname" . }}-filebeat-configmap |
| 163 | - name: vid-logs |
| 164 | emptyDir: {} |
| 165 | - name: vid-data-filebeat |
| 166 | emptyDir: {} |
| 167 | - name: vid-logback |
| 168 | configMap: |
| 169 | name: {{ include "common.fullname" . }}-log-configmap |
Sonsino, Ofir (os0695) | 2dda01d | 2018-05-30 18:41:14 +0300 | [diff] [blame] | 170 | - name: vid-check-job-completion |
| 171 | configMap: |
| 172 | name: {{ include "common.fullname" . }}-check-job-completion |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 173 | imagePullSecrets: |
| 174 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
Sonsino, Ofir (os0695) | 2dda01d | 2018-05-30 18:41:14 +0300 | [diff] [blame] | 175 | |
| 176 | |