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: apps/v1beta1 |
| 17 | kind: StatefulSet |
| 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: |
Mahendra Raghuwanshi | c1395ec | 2018-04-26 03:19:03 +0000 | [diff] [blame] | 27 | serviceName: {{ include "common.servicename" . }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 28 | replicas: {{ .Values.replicaCount }} |
| 29 | selector: |
| 30 | matchLabels: |
| 31 | app: {{ include "common.name" . }} |
| 32 | template: |
| 33 | metadata: |
| 34 | labels: |
| 35 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 36 | release: {{ include "common.release" . }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 37 | spec: |
| 38 | initContainers: |
| 39 | - command: |
Krzysztof Opasiak | 98a79cc | 2020-04-01 22:33:58 +0200 | [diff] [blame] | 40 | - sh |
| 41 | args: |
| 42 | - -c |
| 43 | - "cd /config-input && for PFILE in `ls -1 *.conf`; do envsubst <${PFILE} >/config/${PFILE}; done" |
| 44 | env: |
| 45 | - name: JDBC_USER |
| 46 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }} |
| 47 | - name: JDBC_PASSWORD |
| 48 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }} |
Dominik Mizyn | 165a22d | 2020-04-16 11:21:23 +0200 | [diff] [blame^] | 49 | - name: PDP_HTTP_USER_ID |
| 50 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pdp-http-creds" "key" "login") | indent 10 }} |
| 51 | - name: PDP_HTTP_PASSWORD |
| 52 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pdp-http-creds" "key" "password") | indent 10 }} |
| 53 | - name: PDP_PAP_PDP_HTTP_USER_ID |
| 54 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pap-http-creds" "key" "login") | indent 10 }} |
| 55 | - name: PDP_PAP_PDP_HTTP_PASSWORD |
| 56 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pap-http-creds" "key" "password") | indent 10 }} |
Krzysztof Opasiak | 98a79cc | 2020-04-01 22:33:58 +0200 | [diff] [blame] | 57 | volumeMounts: |
| 58 | - mountPath: /config-input |
| 59 | name: pe |
| 60 | - mountPath: /config |
| 61 | name: pe-processed |
| 62 | image: "{{ .Values.global.envsubstImage }}" |
| 63 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 64 | name: {{ include "common.name" . }}-update-config |
| 65 | - command: |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 66 | - /root/ready.py |
| 67 | args: |
| 68 | - --container-name |
| 69 | - {{ .Values.global.pap.nameOverride }} |
| 70 | env: |
| 71 | - name: NAMESPACE |
| 72 | valueFrom: |
| 73 | fieldRef: |
| 74 | apiVersion: v1 |
| 75 | fieldPath: metadata.namespace |
| 76 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 77 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 78 | name: {{ include "common.name" . }}-readiness |
| 79 | containers: |
| 80 | - command: |
| 81 | - /bin/bash |
| 82 | - ./do-start.sh |
| 83 | - pdp |
| 84 | name: {{ include "common.name" . }} |
BorislavG | df11cd5 | 2018-05-06 12:55:20 +0000 | [diff] [blame] | 85 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 86 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Krzysztof Opasiak | e0784a9 | 2020-04-01 00:46:48 +0200 | [diff] [blame] | 87 | env: |
| 88 | - name: JDBC_USER |
| 89 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }} |
| 90 | - name: JDBC_PASSWORD |
| 91 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }} |
Dominik Mizyn | 165a22d | 2020-04-16 11:21:23 +0200 | [diff] [blame^] | 92 | - name: PDP_HTTP_USER_ID |
| 93 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pdp-http-creds" "key" "login") | indent 10 }} |
| 94 | - name: PDP_HTTP_PASSWORD |
| 95 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pdp-http-creds" "key" "password") | indent 10 }} |
| 96 | - name: PDP_PAP_PDP_HTTP_USER_ID |
| 97 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pap-http-creds" "key" "login") | indent 10 }} |
| 98 | - name: PDP_PAP_PDP_HTTP_PASSWORD |
| 99 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pap-http-creds" "key" "password") | indent 10 }} |
vaibhavjayas | 4136f5d | 2018-08-17 07:01:05 +0000 | [diff] [blame] | 100 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 101 | {{ include "common.resources" . | indent 12 }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 102 | ports: |
| 103 | - containerPort: {{ .Values.service.externalPort }} |
| 104 | {{- if eq .Values.liveness.enabled true }} |
| 105 | livenessProbe: |
| 106 | tcpSocket: |
| 107 | port: {{ .Values.service.externalPort }} |
| 108 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 109 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 110 | {{- end }} |
| 111 | readinessProbe: |
| 112 | tcpSocket: |
| 113 | port: {{ .Values.service.externalPort }} |
| 114 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 115 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 116 | volumeMounts: |
| 117 | - mountPath: /etc/localtime |
| 118 | name: localtime |
| 119 | readOnly: true |
| 120 | - mountPath: /tmp/policy-install/config/base.conf |
Krzysztof Opasiak | 98a79cc | 2020-04-01 22:33:58 +0200 | [diff] [blame] | 121 | name: pe-processed |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 122 | subPath: base.conf |
mayankg2703 | 583b43e | 2018-04-17 05:10:56 +0000 | [diff] [blame] | 123 | - mountPath: /tmp/policy-install/config/pdp-tweaks.sh |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 124 | name: pe-pdp |
mayankg2703 | 583b43e | 2018-04-17 05:10:56 +0000 | [diff] [blame] | 125 | subPath: pdp-tweaks.sh |
| 126 | - mountPath: /tmp/policy-install/config/pdplp.conf |
| 127 | name: pe-pdp |
| 128 | subPath: pdplp.conf |
| 129 | - mountPath: /tmp/policy-install/config/pdp.conf |
| 130 | name: pe-pdp |
| 131 | subPath: pdp.conf |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 132 | - mountPath: /tmp/policy-install/do-start.sh |
| 133 | name: pe-scripts |
| 134 | subPath: do-start.sh |
| 135 | - mountPath: /var/log/onap |
| 136 | name: policy-logs |
| 137 | - mountPath: /tmp/logback.xml |
| 138 | name: policy-logback |
| 139 | subPath: logback.xml |
| 140 | lifecycle: |
| 141 | postStart: |
| 142 | exec: |
| 143 | command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/opt/app/policy/servers/pdp/webapps/pdp/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"] |
| 144 | - image: {{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }} |
| 145 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 146 | name: filebeat-onap |
| 147 | volumeMounts: |
| 148 | - mountPath: /usr/share/filebeat/filebeat.yml |
| 149 | name: filebeat-conf |
| 150 | subPath: filebeat.yml |
| 151 | - mountPath: /var/log/onap |
| 152 | name: policy-logs |
| 153 | - mountPath: /usr/share/filebeat/data |
| 154 | name: policy-data-filebeat |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 155 | volumes: |
| 156 | - name: localtime |
| 157 | hostPath: |
| 158 | path: /etc/localtime |
| 159 | - name: filebeat-conf |
| 160 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 161 | name: {{ include "common.release" . }}-filebeat-configmap |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 162 | - name: policy-logs |
| 163 | emptyDir: {} |
| 164 | - name: policy-data-filebeat |
| 165 | emptyDir: {} |
| 166 | - name: policy-logback |
| 167 | configMap: |
| 168 | name: {{ include "common.fullname" . }}-log-configmap |
| 169 | - name: pe |
| 170 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 171 | name: {{ include "common.release" . }}-pe-configmap |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 172 | defaultMode: 0755 |
| 173 | - name: pe-scripts |
| 174 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 175 | name: {{ include "common.release" . }}-pe-scripts-configmap |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 176 | defaultMode: 0777 |
| 177 | - name: pe-pdp |
| 178 | configMap: |
| 179 | name: {{ include "common.fullname" . }}-pe-configmap |
| 180 | defaultMode: 0755 |
Krzysztof Opasiak | 98a79cc | 2020-04-01 22:33:58 +0200 | [diff] [blame] | 181 | - name: pe-processed |
| 182 | emptyDir: |
| 183 | medium: Memory |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 184 | imagePullSecrets: |
| 185 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |