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