Jakub Latusek | 544ded2 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 2 | # Copyright © 2017 Amdocs, Bell Canada |
Nishukumar | 376ba1e | 2018-08-03 09:17:23 +0000 | [diff] [blame] | 3 | # Modifications Copyright © 2018 AT&T,VMware |
krishnaa96 | 9940613 | 2020-09-24 20:39:49 +0530 | [diff] [blame] | 4 | # Modifications Copyright (C) 2020 Wipro Limited. |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 5 | # |
| 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | # you may not use this file except in compliance with the License. |
| 8 | # You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | # See the License for the specific language governing permissions and |
| 16 | # limitations under the License. |
Jakub Latusek | 544ded2 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 17 | */}} |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 18 | |
Grzegorz-Lis | 7a152ac | 2020-07-30 11:55:24 +0200 | [diff] [blame] | 19 | apiVersion: apps/v1 |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 20 | kind: Deployment |
| 21 | metadata: |
| 22 | name: {{ include "common.fullname" . }} |
| 23 | namespace: {{ include "common.namespace" . }} |
| 24 | labels: |
| 25 | app: {{ include "common.name" . }} |
| 26 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 27 | release: {{ include "common.release" . }} |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 28 | heritage: {{ .Release.Service }} |
| 29 | spec: |
Grzegorz-Lis | 7a152ac | 2020-07-30 11:55:24 +0200 | [diff] [blame] | 30 | selector: |
| 31 | matchLabels: |
| 32 | app: {{ include "common.name" . }} |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 33 | replicas: {{ .Values.replicaCount }} |
| 34 | template: |
| 35 | metadata: |
| 36 | labels: |
| 37 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 38 | release: {{ include "common.release" . }} |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 39 | spec: |
| 40 | initContainers: |
| 41 | - command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 42 | - /app/ready.py |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 43 | args: |
| 44 | - --container-name |
Krzysztof Opasiak | 1cddd1d | 2020-04-16 20:06:50 +0200 | [diff] [blame] | 45 | - policy-xacml-pdp |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 46 | env: |
| 47 | - name: NAMESPACE |
| 48 | valueFrom: |
| 49 | fieldRef: |
| 50 | apiVersion: v1 |
| 51 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 01c711e | 2020-11-21 21:47:01 +0100 | [diff] [blame] | 52 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 53 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 54 | name: {{ include "common.name" . }}-readiness |
amatthews | 379daac | 2022-08-18 15:31:12 +0100 | [diff] [blame] | 55 | {{- if (include "common.needTLS" .) }} |
Dileep Ranganathan | 61225cb | 2018-10-01 08:14:16 -0700 | [diff] [blame] | 56 | - command: |
| 57 | - sh |
| 58 | - -c |
| 59 | - resp="FAILURE"; |
| 60 | until [ $resp = "200" ]; do |
amatthews | 379daac | 2022-08-18 15:31:12 +0100 | [diff] [blame] | 61 | resp=$(curl -s -o /dev/null -k --write-out %{http_code} http{{ if (include "common.needTLS" .) }}s{{ end }}://aaf-sms.{{ include "common.namespace" . }}:10443/v1/sms/domain/osdf/secret); |
Dileep Ranganathan | 61225cb | 2018-10-01 08:14:16 -0700 | [diff] [blame] | 62 | echo $resp; |
| 63 | sleep 2; |
| 64 | done |
| 65 | env: |
| 66 | - name: NAMESPACE |
| 67 | valueFrom: |
| 68 | fieldRef: |
| 69 | apiVersion: v1 |
| 70 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 01c711e | 2020-11-21 21:47:01 +0100 | [diff] [blame] | 71 | image: {{ include "repositoryGenerator.image.curl" . }} |
Dileep Ranganathan | 61225cb | 2018-10-01 08:14:16 -0700 | [diff] [blame] | 72 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 73 | name: {{ include "common.name" . }}-osdf-sms-readiness |
amatthews | 379daac | 2022-08-18 15:31:12 +0100 | [diff] [blame] | 74 | {{- end }} |
krishnaa96 | dbcd1ca | 2020-08-11 10:26:50 +0530 | [diff] [blame] | 75 | {{ include "common.certInitializer.initContainer" . | indent 6 }} |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 76 | containers: |
| 77 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 01c711e | 2020-11-21 21:47:01 +0100 | [diff] [blame] | 78 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 79 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
krishnaa96 | 24a7ef3 | 2020-10-09 12:01:05 +0530 | [diff] [blame] | 80 | command: |
| 81 | - /bin/sh |
| 82 | args: |
| 83 | - "-c" |
| 84 | - | |
amatthews | 379daac | 2022-08-18 15:31:12 +0100 | [diff] [blame] | 85 | {{- if (include "common.needTLS" .) }} |
krishnaa96 | 24a7ef3 | 2020-10-09 12:01:05 +0530 | [diff] [blame] | 86 | grep -v '^$' /opt/osdf/osaaf/local/org.onap.oof.crt > /tmp/oof.crt |
| 87 | cat /tmp/oof.crt /opt/app/ssl_cert/intermediate_root_ca.pem /opt/app/ssl_cert/aaf_root_ca.cer >> /opt/osdf/org.onap.oof.crt |
amatthews | 379daac | 2022-08-18 15:31:12 +0100 | [diff] [blame] | 88 | {{ end }} |
krishnaa96 | 07fc3ea | 2021-08-02 11:19:16 +0530 | [diff] [blame] | 89 | python osdfapp.py |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 90 | ports: |
| 91 | - containerPort: {{ .Values.service.internalPort }} |
| 92 | # disable liveness probe when breakpoints set in debugger |
| 93 | # so K8s doesn't restart unresponsive container |
| 94 | {{- if .Values.liveness.enabled }} |
| 95 | livenessProbe: |
| 96 | tcpSocket: |
| 97 | port: {{ .Values.service.internalPort }} |
| 98 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 99 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 100 | {{ end -}} |
| 101 | readinessProbe: |
| 102 | tcpSocket: |
| 103 | port: {{ .Values.service.internalPort }} |
| 104 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 105 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 106 | env: |
| 107 | volumeMounts: |
krishnaa96 | dbcd1ca | 2020-08-11 10:26:50 +0530 | [diff] [blame] | 108 | {{ include "common.certInitializer.volumeMount" . | indent 10 }} |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 109 | - mountPath: /etc/localtime |
| 110 | name: localtime |
| 111 | readOnly: true |
Krzysztof Opasiak | 1cddd1d | 2020-04-16 20:06:50 +0200 | [diff] [blame] | 112 | - mountPath: /opt/osdf/config/osdf_config.yaml |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 113 | name: {{ include "common.fullname" . }}-config |
| 114 | subPath: osdf_config.yaml |
amatthews | 379daac | 2022-08-18 15:31:12 +0100 | [diff] [blame] | 115 | {{- if (include "common.needTLS" .) }} |
Dileep Ranganathan | f706ae1 | 2018-10-01 04:27:13 -0700 | [diff] [blame] | 116 | - mountPath: /opt/app/ssl_cert/aaf_root_ca.cer |
krishnaa96 | 24a7ef3 | 2020-10-09 12:01:05 +0530 | [diff] [blame] | 117 | name: {{ include "common.fullname" . }}-onap-certs |
Dileep Ranganathan | f706ae1 | 2018-10-01 04:27:13 -0700 | [diff] [blame] | 118 | subPath: aaf_root_ca.cer |
krishnaa96 | 24a7ef3 | 2020-10-09 12:01:05 +0530 | [diff] [blame] | 119 | - mountPath: /opt/app/ssl_cert/intermediate_root_ca.pem |
| 120 | name: {{ include "common.fullname" . }}-onap-certs |
| 121 | subPath: intermediate_root_ca.pem |
amatthews | 379daac | 2022-08-18 15:31:12 +0100 | [diff] [blame] | 122 | {{- end }} |
vrvarma | 8f50049 | 2019-04-25 23:08:01 -0400 | [diff] [blame] | 123 | - mountPath: /opt/osdf/config/common_config.yaml |
| 124 | name: {{ include "common.fullname" . }}-config |
| 125 | subPath: common_config.yaml |
krishnaa96 | 9940613 | 2020-09-24 20:39:49 +0530 | [diff] [blame] | 126 | - mountPath: /opt/osdf/config/log.yml |
| 127 | name: {{ include "common.fullname" . }}-config |
| 128 | subPath: log.yml |
Lukasz Rajewski | d741772 | 2021-07-28 17:12:14 +0200 | [diff] [blame] | 129 | - mountPath: /opt/osdf/config/slicing_config.yaml |
| 130 | name: {{ include "common.fullname" . }}-config |
| 131 | subPath: slicing_config.yaml |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 132 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 133 | {{ include "common.resources" . | indent 12 }} |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 134 | {{- if .Values.nodeSelector }} |
| 135 | nodeSelector: |
| 136 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 137 | {{- end -}} |
| 138 | {{- if .Values.affinity }} |
| 139 | affinity: |
| 140 | {{ toYaml .Values.affinity | indent 10 }} |
| 141 | {{- end }} |
farida azmy | b3e25ca | 2021-10-27 15:56:35 +0200 | [diff] [blame] | 142 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 143 | volumes: |
krishnaa96 | dbcd1ca | 2020-08-11 10:26:50 +0530 | [diff] [blame] | 144 | {{ include "common.certInitializer.volumes" . | nindent 8 }} |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 145 | - name: localtime |
| 146 | hostPath: |
| 147 | path: /etc/localtime |
| 148 | - name: {{ include "common.fullname" . }}-config |
| 149 | configMap: |
| 150 | name: {{ include "common.fullname" . }}-configmap |
| 151 | items: |
| 152 | - key: osdf_config.yaml |
| 153 | path: osdf_config.yaml |
vrvarma | 8f50049 | 2019-04-25 23:08:01 -0400 | [diff] [blame] | 154 | - key: common_config.yaml |
| 155 | path: common_config.yaml |
krishnaa96 | 9940613 | 2020-09-24 20:39:49 +0530 | [diff] [blame] | 156 | - key: log.yml |
| 157 | path: log.yml |
Lukasz Rajewski | d741772 | 2021-07-28 17:12:14 +0200 | [diff] [blame] | 158 | - key: slicing_config.yaml |
| 159 | path: slicing_config.yaml |
krishnaa96 | 24a7ef3 | 2020-10-09 12:01:05 +0530 | [diff] [blame] | 160 | {{ include "oof.certificate.volume" . | indent 8 }} |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 161 | imagePullSecrets: |
| 162 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |