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