Mandeep Khinda | b1f9efe | 2018-03-28 19:01:55 +0000 | [diff] [blame] | 1 | # Copyright © 2017 Amdocs, AT&T, Bell Canada |
toshrajbhardwaj | f4fc1c6 | 2018-08-06 07:35:14 +0000 | [diff] [blame] | 2 | # Modifications Copyright © 2018 ZTE |
Mandeep Khinda | b1f9efe | 2018-03-28 19:01:55 +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 | |
gummar | a72e6de | 2020-03-12 11:15:56 +0000 | [diff] [blame] | 16 | apiVersion: apps/v1 |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 17 | kind: Deployment |
gummar | a72e6de | 2020-03-12 11:15:56 +0000 | [diff] [blame] | 18 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 19 | spec: |
gummar | a72e6de | 2020-03-12 11:15:56 +0000 | [diff] [blame] | 20 | selector: {{- include "common.selectors" . | nindent 4 }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 21 | replicas: {{ .Values.replicaCount }} |
| 22 | template: |
gummar | a72e6de | 2020-03-12 11:15:56 +0000 | [diff] [blame] | 23 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 24 | spec: |
| 25 | initContainers: |
| 26 | - name: {{ include "common.name" . }}-readiness |
| 27 | command: |
| 28 | - /root/ready.py |
| 29 | args: |
| 30 | - --container-name |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 31 | - "sdc-onboarding-be" |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 32 | env: |
| 33 | - name: NAMESPACE |
| 34 | valueFrom: |
| 35 | fieldRef: |
| 36 | apiVersion: v1 |
| 37 | fieldPath: metadata.namespace |
| 38 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 39 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 40 | - name: {{ include "common.name" . }}-job-completion |
| 41 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 42 | imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}" |
| 43 | command: |
| 44 | - /root/job_complete.py |
| 45 | args: |
| 46 | - --job-name |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 47 | - {{ include "common.release" . }}-sdc-onboarding-be-cassandra-init |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 48 | env: |
| 49 | - name: NAMESPACE |
| 50 | valueFrom: |
| 51 | fieldRef: |
| 52 | apiVersion: v1 |
| 53 | fieldPath: metadata.namespace |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 54 | - name: {{ include "common.name" . }}-update-config |
| 55 | image: "{{ .Values.global.envsubstImage }}" |
| 56 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 57 | command: |
| 58 | - sh |
| 59 | args: |
| 60 | - -c |
| 61 | - "cd /config-input && for PFILE in `find . -not -type d | grep -v -F ..`; do envsubst <${PFILE} >/config-output/${PFILE}; chmod 0755 /config-output/${PFILE}; done" |
| 62 | env: |
| 63 | - name: KEYSTORE_PASS |
| 64 | valueFrom: |
| 65 | secretKeyRef: |
| 66 | name: {{ include "common.release" . }}-sdc-cs-secrets |
| 67 | key: keystore_password |
| 68 | - name: TRUSTSTORE_PASS |
| 69 | valueFrom: |
| 70 | secretKeyRef: |
| 71 | name: {{ include "common.release" . }}-sdc-cs-secrets |
| 72 | key: truststore_password |
| 73 | volumeMounts: |
| 74 | - name: {{ include "common.fullname" . }}-environments |
| 75 | mountPath: /config-input/ |
| 76 | - name: sdc-environments-output |
| 77 | mountPath: /config-output/ |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 78 | containers: |
| 79 | - name: {{ include "common.name" . }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 80 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 81 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
gummar | a72e6de | 2020-03-12 11:15:56 +0000 | [diff] [blame] | 82 | ports: {{ include "common.containerPorts" . | nindent 10 }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 83 | {{ if eq .Values.liveness.enabled true }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 84 | livenessProbe: |
Yang Xu | e5d5e68 | 2019-06-19 18:20:31 -0400 | [diff] [blame] | 85 | httpGet: |
shrek2000 | f336f6d | 2020-02-25 16:11:26 +0200 | [diff] [blame] | 86 | path: /sdc2/rest/healthCheck |
gummar | a72e6de | 2020-03-12 11:15:56 +0000 | [diff] [blame] | 87 | port: {{ .Values.liveness.port }} |
| 88 | scheme: {{ if (include "common.needTLS" .) }}HTTPS{{ else }}HTTP{{ end }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 89 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 90 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
Yang Xu | 8560854 | 2019-06-16 23:25:32 -0400 | [diff] [blame] | 91 | timeoutSeconds: {{ .Values.liveness.timeoutSeconds }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 92 | {{ end }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 93 | readinessProbe: |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 94 | exec: |
| 95 | command: |
MichaelMorris | b137f7e | 2020-03-15 17:44:48 +0000 | [diff] [blame] | 96 | - "/var/lib/jetty/ready-probe.sh" |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 97 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 98 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Yang Xu | 8560854 | 2019-06-16 23:25:32 -0400 | [diff] [blame] | 99 | timeoutSeconds: {{ .Values.readiness.timeoutSeconds }} |
gummar | a72e6de | 2020-03-12 11:15:56 +0000 | [diff] [blame] | 100 | resources: {{ include "common.resources" . | nindent 12 }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 101 | env: |
| 102 | - name: ENVNAME |
| 103 | value: {{ .Values.global.env.name }} |
| 104 | - name: JAVA_OPTIONS |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 105 | value: {{ .Values.config.javaOptions }} |
| 106 | - name: cassandra_ssl_enabled |
| 107 | value: {{ .Values.config.cassandraSslEnabled | quote }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 108 | - name: HOST_IP |
| 109 | valueFrom: |
| 110 | fieldRef: |
| 111 | fieldPath: status.podIP |
| 112 | volumeMounts: |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 113 | - name: sdc-environments-output |
MichaelMorris | b137f7e | 2020-03-15 17:44:48 +0000 | [diff] [blame] | 114 | mountPath: /var/lib/jetty/chef-solo/environments/ |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 115 | - name: sdc-cert |
| 116 | mountPath: /var/lib/jetty/chef-solo/cookbooks/sdc-catalog-be/files/default/org.onap.sdc.p12 |
| 117 | subPath: org.onap.sdc.p12 |
| 118 | - name: sdc-cert |
| 119 | mountPath: /var/lib/jetty/chef-solo/cookbooks/sdc-catalog-be/files/default/org.onap.sdc.trust.jks |
| 120 | subPath: org.onap.sdc.trust.jks |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 121 | - name: {{ include "common.fullname" . }}-localtime |
| 122 | mountPath: /etc/localtime |
| 123 | readOnly: true |
| 124 | - name: {{ include "common.fullname" . }}-logs |
| 125 | mountPath: /var/log/onap |
| 126 | - name: {{ include "common.fullname" . }}-logback |
| 127 | mountPath: /tmp/logback.xml |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 128 | subPath: logback.xml |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 129 | lifecycle: |
| 130 | postStart: |
| 131 | exec: |
| 132 | command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/var/lib/jetty/config/catalog-be/; while [ ! -e $DST ]; do echo 'Waiting for $DST...' >> $LOG; sleep 5; done; sleep 2; /bin/cp -f $SRC $DST; echo 'Done' >> $LOG"] |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 133 | # side car containers |
| 134 | - name: {{ include "common.name" . }}-filebeat-onap |
| 135 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 136 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 137 | volumeMounts: |
| 138 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 139 | mountPath: /usr/share/filebeat/filebeat.yml |
| 140 | subPath: filebeat.yml |
| 141 | - name: {{ include "common.fullname" . }}-logs |
| 142 | mountPath: /var/log/onap |
| 143 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 144 | mountPath: /usr/share/filebeat/data |
| 145 | volumes: |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 146 | - name: {{ include "common.fullname" . }}-localtime |
| 147 | hostPath: |
| 148 | path: /etc/localtime |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 149 | - name: sdc-cert |
| 150 | secret: |
| 151 | secretName: sdc-cert |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 152 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 153 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 154 | name: {{ include "common.release" . }}-sdc-filebeat-configmap |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 155 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 156 | emptyDir: {} |
| 157 | - name: {{ include "common.fullname" . }}-logback |
| 158 | configMap: |
| 159 | name : {{ include "common.fullname" . }}-logging-configmap |
| 160 | - name: {{ include "common.fullname" . }}-environments |
| 161 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 162 | name: {{ include "common.release" . }}-sdc-environments-configmap |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 163 | defaultMode: 0755 |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 164 | - name: sdc-environments-output |
| 165 | emptyDir: { medium: "Memory" } |
| 166 | - name: {{ include "common.fullname" . }}-logs |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 167 | emptyDir: {} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 168 | imagePullSecrets: |
toshrajbhardwaj | f4fc1c6 | 2018-08-06 07:35:14 +0000 | [diff] [blame] | 169 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |