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