mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 1 | # Copyright © 2017 Amdocs, Bell Canada |
Durgpal | 7ad4069 | 2018-08-03 07:28:36 +0000 | [diff] [blame] | 2 | # Modifications Copyright © 2018 AT&T |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 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 "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame^] | 24 | release: {{ include "common.release" . }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 25 | heritage: {{ .Release.Service }} |
| 26 | spec: |
| 27 | replicas: {{ .Values.replicaCount }} |
| 28 | template: |
| 29 | metadata: |
| 30 | labels: |
| 31 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame^] | 32 | release: {{ include "common.release" . }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 33 | spec: |
| 34 | initContainers: |
| 35 | - command: |
| 36 | - /root/ready.py |
| 37 | args: |
| 38 | - --container-name |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame^] | 39 | - {{ include "common.release" . }}-galera-config |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 40 | env: |
| 41 | - name: NAMESPACE |
| 42 | valueFrom: |
| 43 | fieldRef: |
| 44 | apiVersion: v1 |
| 45 | fieldPath: metadata.namespace |
| 46 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 47 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 48 | name: {{ include "common.name" . }}-readiness |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 49 | containers: |
| 50 | - command: |
| 51 | - /bin/bash |
| 52 | - ./do-start.sh |
| 53 | - pap |
| 54 | name: {{ include "common.name" . }} |
BorislavG | df11cd5 | 2018-05-06 12:55:20 +0000 | [diff] [blame] | 55 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 56 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
vaibhavjayas | 4136f5d | 2018-08-17 07:01:05 +0000 | [diff] [blame] | 57 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 58 | {{ include "common.resources" . | indent 12 }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 59 | ports: |
| 60 | - containerPort: {{ .Values.service.externalPort }} |
| 61 | - containerPort: {{ .Values.service.externalPort2 }} |
| 62 | {{- if eq .Values.liveness.enabled true }} |
| 63 | livenessProbe: |
| 64 | tcpSocket: |
| 65 | port: {{ .Values.service.externalPort }} |
| 66 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 67 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 68 | {{ end -}} |
| 69 | readinessProbe: |
| 70 | tcpSocket: |
| 71 | port: {{ .Values.service.externalPort }} |
| 72 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 73 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 74 | env: |
| 75 | - name: PRELOAD_POLICIES |
| 76 | value: "{{ .Values.config.preloadPolicies }}" |
| 77 | volumeMounts: |
| 78 | - mountPath: /etc/localtime |
| 79 | name: localtime |
| 80 | readOnly: true |
mayankg2703 | 583b43e | 2018-04-17 05:10:56 +0000 | [diff] [blame] | 81 | - mountPath: /tmp/policy-install/config/push-policies.sh |
| 82 | name: pe-pap |
| 83 | subPath: push-policies.sh |
| 84 | - mountPath: /tmp/policy-install/config/pap-tweaks.sh |
| 85 | name: pe-pap |
| 86 | subPath: pap-tweaks.sh |
| 87 | - mountPath: /tmp/policy-install/config/paplp.conf |
| 88 | name: pe-pap |
| 89 | subPath: paplp.conf |
| 90 | - mountPath: /tmp/policy-install/config/pap.conf |
| 91 | name: pe-pap |
| 92 | subPath: pap.conf |
| 93 | - mountPath: /tmp/policy-install/config/mysql.conf |
| 94 | name: pe-pap |
| 95 | subPath: mysql.conf |
| 96 | - mountPath: /tmp/policy-install/config/elk.conf |
| 97 | name: pe-pap |
| 98 | subPath: elk.conf |
| 99 | - mountPath: /tmp/policy-install/config/console.conf |
| 100 | name: pe-pap |
| 101 | subPath: console.conf |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 102 | - mountPath: /tmp/policy-install/config/base.conf |
| 103 | name: pe |
| 104 | subPath: base.conf |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 105 | - mountPath: /tmp/policy-install/do-start.sh |
| 106 | name: pe-scripts |
| 107 | subPath: do-start.sh |
| 108 | - mountPath: /var/log/onap |
| 109 | name: policy-logs |
| 110 | - mountPath: /tmp/policy-install/logback.xml |
| 111 | name: policy-sdk-logback |
| 112 | subPath: logback.xml |
| 113 | - mountPath: /tmp/logback.xml |
| 114 | name: policy-logback |
| 115 | subPath: logback.xml |
| 116 | lifecycle: |
| 117 | postStart: |
| 118 | exec: |
| 119 | command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/opt/app/policy/servers/pap/webapps/pap/WEB-INF/classes/; while [ ! -e $DST ]; do echo 'Waiting for $DST...' >> $LOG; sleep 5; done; sleep 2; /bin/cp -f $SRC $DST; export SRC=/tmp/policy-install/logback.xml; export DST=/opt/app/policy/servers/console/webapps/onap/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"] |
| 120 | - image: "{{ .Values.global.loggingRepository | default .Values.loggingRepository }}/{{ .Values.global.loggingImage | default .Values.loggingImage }}" |
dkamdocs | 6ad3a1c | 2018-12-21 09:25:53 +0000 | [diff] [blame] | 121 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 122 | name: filebeat-onap |
| 123 | volumeMounts: |
| 124 | - mountPath: /usr/share/filebeat/filebeat.yml |
| 125 | name: filebeat-conf |
| 126 | subPath: filebeat.yml |
| 127 | - mountPath: /var/log/onap |
| 128 | name: policy-logs |
| 129 | - mountPath: /usr/share/filebeat/data |
| 130 | name: policy-data-filebeat |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 131 | volumes: |
| 132 | - name: localtime |
| 133 | hostPath: |
| 134 | path: /etc/localtime |
| 135 | - name: filebeat-conf |
| 136 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame^] | 137 | name: {{ include "common.release" . }}-filebeat-configmap |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 138 | - name: policy-logs |
| 139 | emptyDir: {} |
| 140 | - name: policy-data-filebeat |
| 141 | emptyDir: {} |
| 142 | - name: policy-logback |
| 143 | configMap: |
| 144 | name: {{ include "common.fullname" . }}-log-configmap |
| 145 | - name: policy-sdk-logback |
| 146 | configMap: |
| 147 | name: {{ include "common.fullname" . }}-sdk-log-configmap |
| 148 | - name: pe |
| 149 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame^] | 150 | name: {{ include "common.release" . }}-pe-configmap |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 151 | defaultMode: 0755 |
| 152 | - name: pe-scripts |
| 153 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame^] | 154 | name: {{ include "common.release" . }}-pe-scripts-configmap |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 155 | defaultMode: 0777 |
| 156 | - name: pe-pap |
| 157 | configMap: |
| 158 | name: {{ include "common.fullname" . }}-pe-configmap |
| 159 | defaultMode: 0755 |
| 160 | imagePullSecrets: |
| 161 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |