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