Jakub Latusek | d8eaff6 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 2 | # Copyright © 2018 Amdocs, Bell Canada |
| 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. |
Jakub Latusek | d8eaff6 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 15 | */}} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 16 | |
kwasiel | 59cc6a4 | 2020-07-23 10:02:49 +0000 | [diff] [blame] | 17 | apiVersion: apps/v1 |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 18 | kind: Deployment |
| 19 | metadata: |
| 20 | name: {{ include "common.fullname" . }} |
| 21 | namespace: {{ include "common.namespace" . }} |
| 22 | labels: |
| 23 | app: {{ include "common.name" . }} |
| 24 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 25 | release: {{ include "common.release" . }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 26 | heritage: {{ .Release.Service }} |
| 27 | spec: |
kwasiel | 59cc6a4 | 2020-07-23 10:02:49 +0000 | [diff] [blame] | 28 | selector: |
| 29 | matchLabels: |
| 30 | app: {{ include "common.name" . }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 31 | replicas: {{ .Values.replicaCount }} |
| 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" . }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 37 | spec: |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 38 | initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 39 | - name: {{ include "common.name" . }}-readiness |
| 40 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 41 | - /app/ready.py |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 42 | args: |
| 43 | - --container-name |
| 44 | - "sdc-wfd-be" |
| 45 | env: |
| 46 | - name: NAMESPACE |
| 47 | valueFrom: |
| 48 | fieldRef: |
| 49 | apiVersion: v1 |
| 50 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 0a1eaf3 | 2020-11-19 17:56:08 +0100 | [diff] [blame] | 51 | image: {{ include "repositoryGenerator.image.readiness" . }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 52 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 53 | resources: |
| 54 | limits: |
| 55 | cpu: 100m |
| 56 | memory: 100Mi |
| 57 | requests: |
| 58 | cpu: 3m |
| 59 | memory: 20Mi |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 60 | {{- if .Values.global.aafEnabled }} |
| 61 | - name: {{ include "common.fullname" . }}-move-cert |
| 62 | command: |
| 63 | - /bin/sh |
| 64 | args: |
| 65 | - -c |
| 66 | - | |
| 67 | cp {{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.keystoreFile }} /sdc-certs/{{ .Values.certInitializer.keystoreFile }} |
| 68 | cp {{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.truststoreFile }} /sdc-certs/{{ .Values.certInitializer.truststoreFile }} |
| 69 | cp {{ .Values.certInitializer.credsPath }}/mycreds.prop /sdc-certs/mycreds.prop |
Sylvain Desbureaux | 0a1eaf3 | 2020-11-19 17:56:08 +0100 | [diff] [blame] | 70 | image: {{ include "repositoryGenerator.image.busybox" . }} |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 71 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 72 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }} |
| 73 | - name: sdc-certs |
| 74 | mountPath: /sdc-certs |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 75 | resources: |
| 76 | limits: |
| 77 | cpu: 100m |
| 78 | memory: 100Mi |
| 79 | requests: |
| 80 | cpu: 3m |
| 81 | memory: 20Mi |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 82 | {{- end }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 83 | containers: |
| 84 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 0a1eaf3 | 2020-11-19 17:56:08 +0100 | [diff] [blame] | 85 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 86 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 87 | {{- if .Values.global.aafEnabled }} |
| 88 | command: |
| 89 | - sh |
| 90 | args: |
| 91 | - "-c" |
| 92 | - | |
| 93 | export $(grep '^c' /sdc-certs/mycreds.prop | xargs -0) |
| 94 | export KEYSTORE_PASS=$cadi_keystore_password_p12 |
| 95 | export TRUSTSTORE_PASS=$cadi_truststore_password |
| 96 | export KEYSTORE_PATH=/etc/{{ .Values.certInitializer.keystoreFile }} |
| 97 | export TRUSTSTORE_PATH=/etc/{{ .Values.certInitializer.truststoreFile }} |
| 98 | ./startup.sh |
| 99 | {{- end }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 100 | ports: |
IlanaP | c80bff9 | 2019-11-18 21:10:08 +0200 | [diff] [blame] | 101 | - containerPort: {{ template "wfd-fe.internalPort" . }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 102 | {{ if .Values.liveness.enabled }} |
| 103 | livenessProbe: |
| 104 | tcpSocket: |
IlanaP | c80bff9 | 2019-11-18 21:10:08 +0200 | [diff] [blame] | 105 | port: {{ template "wfd-fe.internalPort" . }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 106 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 107 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
Sylvain Desbureaux | 8c9416b | 2021-05-05 11:12:48 +0200 | [diff] [blame] | 108 | successThreshold: {{ .Values.liveness.successThreshold }} |
| 109 | failureThreshold: {{ .Values.liveness.failureThreshold }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 110 | {{ end }} |
| 111 | readinessProbe: |
| 112 | tcpSocket: |
IlanaP | c80bff9 | 2019-11-18 21:10:08 +0200 | [diff] [blame] | 113 | port: {{ template "wfd-fe.internalPort" . }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 114 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 115 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Sylvain Desbureaux | 8c9416b | 2021-05-05 11:12:48 +0200 | [diff] [blame] | 116 | successThreshold: {{ .Values.readiness.successThreshold }} |
| 117 | failureThreshold: {{ .Values.readiness.failureThreshold }} |
| 118 | startupProbe: |
| 119 | tcpSocket: |
| 120 | port: {{ template "wfd-fe.internalPort" . }} |
| 121 | initialDelaySeconds: {{ .Values.startup.initialDelaySeconds }} |
| 122 | periodSeconds: {{ .Values.startup.periodSeconds }} |
| 123 | successThreshold: {{ .Values.startup.successThreshold }} |
| 124 | failureThreshold: {{ .Values.startup.failureThreshold }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 125 | env: |
| 126 | - name: ENVNAME |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 127 | value: {{ .Values.env.name }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 128 | - name: JAVA_OPTIONS |
| 129 | value: {{ .Values.config.javaOptions }} |
| 130 | - name: BACKEND |
| 131 | value: {{ .Values.config.backendServerURL }} |
dfx1971 | b2734ed | 2019-05-07 10:35:58 +0300 | [diff] [blame] | 132 | - name: IS_HTTPS |
| 133 | value: "{{ .Values.config.isHttpsEnabled}}" |
| 134 | {{ if and .Values.config.isHttpsEnabled (eq .Values.security.isDefaultStore false) }} |
IlanaP | c80bff9 | 2019-11-18 21:10:08 +0200 | [diff] [blame] | 135 | - name: TRUST_ALL |
| 136 | value: "{{ .Values.config.isTrustAll}}" |
dfx1971 | b2734ed | 2019-05-07 10:35:58 +0300 | [diff] [blame] | 137 | {{ end }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 138 | volumeMounts: |
| 139 | - name: {{ include "common.fullname" . }}-localtime |
| 140 | mountPath: /etc/localtime |
| 141 | readOnly: true |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 142 | {{- if .Values.global.aafEnabled }} |
| 143 | - name: sdc-certs |
Jakub Latusek | d06aa1f | 2020-09-24 18:48:18 +0200 | [diff] [blame] | 144 | mountPath: /sdc-certs/mycreds.prop |
| 145 | subPath: mycreds.prop |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 146 | - name: sdc-certs |
| 147 | mountPath: /var/lib/jetty/etc/{{ .Values.certInitializer.keystoreFile }} |
| 148 | subPath: {{ .Values.certInitializer.keystoreFile }} |
| 149 | - name: sdc-certs |
| 150 | mountPath: /var/lib/jetty/etc/{{ .Values.certInitializer.truststoreFile }} |
| 151 | subPath: {{ .Values.certInitializer.truststoreFile }} |
| 152 | {{ end }} |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 153 | resources: {{ include "common.resources" . | nindent 12 }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 154 | {{- if .Values.nodeSelector }} |
| 155 | nodeSelector: |
| 156 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 157 | {{- end -}} |
| 158 | {{- if .Values.affinity }} |
| 159 | affinity: |
| 160 | {{ toYaml .Values.affinity | indent 10 }} |
| 161 | {{- end }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 162 | # side car containers |
| 163 | - name: {{ include "common.name" . }}-filebeat-onap |
Sylvain Desbureaux | 0a1eaf3 | 2020-11-19 17:56:08 +0100 | [diff] [blame] | 164 | image: {{ include "repositoryGenerator.image.logging" . }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 165 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 166 | volumeMounts: |
| 167 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 168 | mountPath: /usr/share/filebeat/filebeat.yml |
| 169 | subPath: filebeat.yml |
| 170 | - name: {{ include "common.fullname" . }}-logs |
| 171 | mountPath: /var/log/onap |
| 172 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 173 | mountPath: /usr/share/filebeat/data |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 174 | resources: |
| 175 | limits: |
| 176 | cpu: 100m |
| 177 | memory: 100Mi |
| 178 | requests: |
| 179 | cpu: 3m |
| 180 | memory: 20Mi |
farida azmy | 1383b4c | 2021-04-06 12:33:31 +0200 | [diff] [blame] | 181 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 182 | volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 183 | - name: {{ include "common.fullname" . }}-localtime |
| 184 | hostPath: |
| 185 | path: /etc/localtime |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 186 | {{- if .Values.global.aafEnabled }} |
| 187 | - name: sdc-certs |
| 188 | emptyDir: |
| 189 | medium: "Memory" |
| 190 | {{- end }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 191 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 192 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 193 | name: {{ include "common.release" . }}-sdc-filebeat-configmap |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 194 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 195 | emptyDir: {} |
| 196 | - name: {{ include "common.fullname" . }}-logs |
| 197 | emptyDir: {} |
| 198 | imagePullSecrets: |
kwasiel | 59cc6a4 | 2020-07-23 10:02:49 +0000 | [diff] [blame] | 199 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |