priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 1 | # Copyright © 2018 Amdocs, Bell Canada |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
kwasiel | 59cc6a4 | 2020-07-23 10:02:49 +0000 | [diff] [blame] | 15 | apiVersion: apps/v1 |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 16 | kind: Deployment |
| 17 | metadata: |
| 18 | name: {{ include "common.fullname" . }} |
| 19 | namespace: {{ include "common.namespace" . }} |
| 20 | labels: |
| 21 | app: {{ include "common.name" . }} |
| 22 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 23 | release: {{ include "common.release" . }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 24 | heritage: {{ .Release.Service }} |
| 25 | spec: |
kwasiel | 59cc6a4 | 2020-07-23 10:02:49 +0000 | [diff] [blame] | 26 | selector: |
| 27 | matchLabels: |
| 28 | app: {{ include "common.name" . }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 29 | replicas: {{ .Values.replicaCount }} |
| 30 | template: |
| 31 | metadata: |
| 32 | labels: |
| 33 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 34 | release: {{ include "common.release" . }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 35 | spec: |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 36 | initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 37 | - name: {{ include "common.name" . }}-readiness |
| 38 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 39 | - /app/ready.py |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 40 | args: |
| 41 | - --container-name |
| 42 | - "sdc-wfd-be" |
| 43 | env: |
| 44 | - name: NAMESPACE |
| 45 | valueFrom: |
| 46 | fieldRef: |
| 47 | apiVersion: v1 |
| 48 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 49 | image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}" |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 50 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 51 | resources: |
| 52 | limits: |
| 53 | cpu: 100m |
| 54 | memory: 100Mi |
| 55 | requests: |
| 56 | cpu: 3m |
| 57 | memory: 20Mi |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 58 | {{- if .Values.global.aafEnabled }} |
| 59 | - name: {{ include "common.fullname" . }}-move-cert |
| 60 | command: |
| 61 | - /bin/sh |
| 62 | args: |
| 63 | - -c |
| 64 | - | |
| 65 | cp {{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.keystoreFile }} /sdc-certs/{{ .Values.certInitializer.keystoreFile }} |
| 66 | cp {{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.truststoreFile }} /sdc-certs/{{ .Values.certInitializer.truststoreFile }} |
| 67 | cp {{ .Values.certInitializer.credsPath }}/mycreds.prop /sdc-certs/mycreds.prop |
| 68 | image: "{{ .Values.global.busyboxRepository }}/{{ .Values.global.busyboxImage }}" |
| 69 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 70 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }} |
| 71 | - name: sdc-certs |
| 72 | mountPath: /sdc-certs |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 73 | resources: |
| 74 | limits: |
| 75 | cpu: 100m |
| 76 | memory: 100Mi |
| 77 | requests: |
| 78 | cpu: 3m |
| 79 | memory: 20Mi |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 80 | {{- end }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 81 | containers: |
| 82 | - name: {{ include "common.name" . }} |
| 83 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
| 84 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 85 | {{- if .Values.global.aafEnabled }} |
| 86 | command: |
| 87 | - sh |
| 88 | args: |
| 89 | - "-c" |
| 90 | - | |
| 91 | export $(grep '^c' /sdc-certs/mycreds.prop | xargs -0) |
| 92 | export KEYSTORE_PASS=$cadi_keystore_password_p12 |
| 93 | export TRUSTSTORE_PASS=$cadi_truststore_password |
| 94 | export KEYSTORE_PATH=/etc/{{ .Values.certInitializer.keystoreFile }} |
| 95 | export TRUSTSTORE_PATH=/etc/{{ .Values.certInitializer.truststoreFile }} |
| 96 | ./startup.sh |
| 97 | {{- end }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 98 | ports: |
IlanaP | c80bff9 | 2019-11-18 21:10:08 +0200 | [diff] [blame] | 99 | - containerPort: {{ template "wfd-fe.internalPort" . }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 100 | {{ if .Values.liveness.enabled }} |
| 101 | livenessProbe: |
| 102 | tcpSocket: |
IlanaP | c80bff9 | 2019-11-18 21:10:08 +0200 | [diff] [blame] | 103 | port: {{ template "wfd-fe.internalPort" . }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 104 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 105 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 106 | {{ end }} |
| 107 | readinessProbe: |
| 108 | tcpSocket: |
IlanaP | c80bff9 | 2019-11-18 21:10:08 +0200 | [diff] [blame] | 109 | port: {{ template "wfd-fe.internalPort" . }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 110 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 111 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 112 | env: |
| 113 | - name: ENVNAME |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 114 | value: {{ .Values.env.name }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 115 | - name: JAVA_OPTIONS |
| 116 | value: {{ .Values.config.javaOptions }} |
| 117 | - name: BACKEND |
| 118 | value: {{ .Values.config.backendServerURL }} |
dfx1971 | b2734ed | 2019-05-07 10:35:58 +0300 | [diff] [blame] | 119 | - name: IS_HTTPS |
| 120 | value: "{{ .Values.config.isHttpsEnabled}}" |
| 121 | {{ if and .Values.config.isHttpsEnabled (eq .Values.security.isDefaultStore false) }} |
IlanaP | c80bff9 | 2019-11-18 21:10:08 +0200 | [diff] [blame] | 122 | - name: TRUST_ALL |
| 123 | value: "{{ .Values.config.isTrustAll}}" |
dfx1971 | b2734ed | 2019-05-07 10:35:58 +0300 | [diff] [blame] | 124 | {{ end }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 125 | volumeMounts: |
| 126 | - name: {{ include "common.fullname" . }}-localtime |
| 127 | mountPath: /etc/localtime |
| 128 | readOnly: true |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 129 | {{- if .Values.global.aafEnabled }} |
| 130 | - name: sdc-certs |
Jakub Latusek | d06aa1f | 2020-09-24 18:48:18 +0200 | [diff] [blame] | 131 | mountPath: /sdc-certs/mycreds.prop |
| 132 | subPath: mycreds.prop |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 133 | - name: sdc-certs |
| 134 | mountPath: /var/lib/jetty/etc/{{ .Values.certInitializer.keystoreFile }} |
| 135 | subPath: {{ .Values.certInitializer.keystoreFile }} |
| 136 | - name: sdc-certs |
| 137 | mountPath: /var/lib/jetty/etc/{{ .Values.certInitializer.truststoreFile }} |
| 138 | subPath: {{ .Values.certInitializer.truststoreFile }} |
| 139 | {{ end }} |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 140 | resources: {{ include "common.resources" . | nindent 12 }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 141 | {{- if .Values.nodeSelector }} |
| 142 | nodeSelector: |
| 143 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 144 | {{- end -}} |
| 145 | {{- if .Values.affinity }} |
| 146 | affinity: |
| 147 | {{ toYaml .Values.affinity | indent 10 }} |
| 148 | {{- end }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 149 | # side car containers |
| 150 | - name: {{ include "common.name" . }}-filebeat-onap |
| 151 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 152 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 153 | volumeMounts: |
| 154 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 155 | mountPath: /usr/share/filebeat/filebeat.yml |
| 156 | subPath: filebeat.yml |
| 157 | - name: {{ include "common.fullname" . }}-logs |
| 158 | mountPath: /var/log/onap |
| 159 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 160 | mountPath: /usr/share/filebeat/data |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 161 | resources: |
| 162 | limits: |
| 163 | cpu: 100m |
| 164 | memory: 100Mi |
| 165 | requests: |
| 166 | cpu: 3m |
| 167 | memory: 20Mi |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 168 | volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 169 | - name: {{ include "common.fullname" . }}-localtime |
| 170 | hostPath: |
| 171 | path: /etc/localtime |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 172 | {{- if .Values.global.aafEnabled }} |
| 173 | - name: sdc-certs |
| 174 | emptyDir: |
| 175 | medium: "Memory" |
| 176 | {{- end }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 177 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 178 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 179 | name: {{ include "common.release" . }}-sdc-filebeat-configmap |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 180 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 181 | emptyDir: {} |
| 182 | - name: {{ include "common.fullname" . }}-logs |
| 183 | emptyDir: {} |
| 184 | imagePullSecrets: |
kwasiel | 59cc6a4 | 2020-07-23 10:02:49 +0000 | [diff] [blame] | 185 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |