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 |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [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 | |
Grzegorz-Lis | 7a152ac | 2020-07-30 11:55:24 +0200 | [diff] [blame] | 16 | apiVersion: apps/v1 |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 17 | kind: Deployment |
| 18 | metadata: |
| 19 | name: {{ include "common.fullname" . }} |
| 20 | namespace: {{ include "common.namespace" . }} |
| 21 | labels: |
| 22 | app: {{ include "common.name" . }} |
| 23 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 24 | release: {{ include "common.release" . }} |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 25 | heritage: {{ .Release.Service }} |
| 26 | spec: |
Grzegorz-Lis | 7a152ac | 2020-07-30 11:55:24 +0200 | [diff] [blame] | 27 | selector: |
| 28 | matchLabels: |
| 29 | app: {{ include "common.name" . }} |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 30 | replicas: {{ .Values.replicaCount }} |
| 31 | template: |
| 32 | metadata: |
| 33 | labels: |
| 34 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 35 | release: {{ include "common.release" . }} |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 36 | spec: |
| 37 | initContainers: |
| 38 | - command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 39 | - /app/ready.py |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 40 | args: |
| 41 | - --container-name |
Krzysztof Opasiak | 1cddd1d | 2020-04-16 20:06:50 +0200 | [diff] [blame] | 42 | - policy-xacml-pdp |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 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 }}" |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 50 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 51 | name: {{ include "common.name" . }}-readiness |
Dileep Ranganathan | 61225cb | 2018-10-01 08:14:16 -0700 | [diff] [blame] | 52 | - command: |
| 53 | - sh |
| 54 | - -c |
| 55 | - resp="FAILURE"; |
| 56 | until [ $resp = "200" ]; do |
| 57 | resp=$(curl -s -o /dev/null -k --write-out %{http_code} https://aaf-sms.{{ include "common.namespace" . }}:10443/v1/sms/domain/osdf/secret); |
| 58 | echo $resp; |
| 59 | sleep 2; |
| 60 | done |
| 61 | env: |
| 62 | - name: NAMESPACE |
| 63 | valueFrom: |
| 64 | fieldRef: |
| 65 | apiVersion: v1 |
| 66 | fieldPath: metadata.namespace |
Sylvain Desbureaux | cc7d35a | 2020-04-20 12:05:56 +0200 | [diff] [blame] | 67 | image: "{{ .Values.global.dockerHubRepository }}/{{ .Values.global.curlImage }}" |
Dileep Ranganathan | 61225cb | 2018-10-01 08:14:16 -0700 | [diff] [blame] | 68 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 69 | name: {{ include "common.name" . }}-osdf-sms-readiness |
krishnaa96 | dbcd1ca | 2020-08-11 10:26:50 +0530 | [diff] [blame] | 70 | {{ include "common.certInitializer.initContainer" . | indent 6 }} |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 71 | containers: |
| 72 | - name: {{ include "common.name" . }} |
| 73 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
| 74 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 75 | ports: |
| 76 | - containerPort: {{ .Values.service.internalPort }} |
| 77 | # disable liveness probe when breakpoints set in debugger |
| 78 | # so K8s doesn't restart unresponsive container |
| 79 | {{- if .Values.liveness.enabled }} |
| 80 | livenessProbe: |
| 81 | tcpSocket: |
| 82 | port: {{ .Values.service.internalPort }} |
| 83 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 84 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 85 | {{ end -}} |
| 86 | readinessProbe: |
| 87 | tcpSocket: |
| 88 | port: {{ .Values.service.internalPort }} |
| 89 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 90 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 91 | env: |
| 92 | volumeMounts: |
krishnaa96 | dbcd1ca | 2020-08-11 10:26:50 +0530 | [diff] [blame] | 93 | {{ include "common.certInitializer.volumeMount" . | indent 10 }} |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 94 | - mountPath: /etc/localtime |
| 95 | name: localtime |
| 96 | readOnly: true |
Krzysztof Opasiak | 1cddd1d | 2020-04-16 20:06:50 +0200 | [diff] [blame] | 97 | - mountPath: /opt/osdf/config/osdf_config.yaml |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 98 | name: {{ include "common.fullname" . }}-config |
| 99 | subPath: osdf_config.yaml |
Dileep Ranganathan | f706ae1 | 2018-10-01 04:27:13 -0700 | [diff] [blame] | 100 | - mountPath: /opt/app/ssl_cert/aaf_root_ca.cer |
| 101 | name: {{ include "common.fullname" . }}-config |
| 102 | subPath: aaf_root_ca.cer |
vrvarma | 8f50049 | 2019-04-25 23:08:01 -0400 | [diff] [blame] | 103 | - mountPath: /opt/osdf/config/common_config.yaml |
| 104 | name: {{ include "common.fullname" . }}-config |
| 105 | subPath: common_config.yaml |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 106 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 107 | {{ include "common.resources" . | indent 12 }} |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 108 | {{- if .Values.nodeSelector }} |
| 109 | nodeSelector: |
| 110 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 111 | {{- end -}} |
| 112 | {{- if .Values.affinity }} |
| 113 | affinity: |
| 114 | {{ toYaml .Values.affinity | indent 10 }} |
| 115 | {{- end }} |
| 116 | |
| 117 | volumes: |
krishnaa96 | dbcd1ca | 2020-08-11 10:26:50 +0530 | [diff] [blame] | 118 | {{ include "common.certInitializer.volumes" . | nindent 8 }} |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 119 | - name: localtime |
| 120 | hostPath: |
| 121 | path: /etc/localtime |
| 122 | - name: {{ include "common.fullname" . }}-config |
| 123 | configMap: |
| 124 | name: {{ include "common.fullname" . }}-configmap |
| 125 | items: |
| 126 | - key: osdf_config.yaml |
| 127 | path: osdf_config.yaml |
Dileep Ranganathan | f706ae1 | 2018-10-01 04:27:13 -0700 | [diff] [blame] | 128 | - key: aaf_root_ca.cer |
| 129 | path: aaf_root_ca.cer |
vrvarma | 8f50049 | 2019-04-25 23:08:01 -0400 | [diff] [blame] | 130 | - key: common_config.yaml |
| 131 | path: common_config.yaml |
Ikram Ikramullah | 40b120b | 2018-05-01 11:35:40 -0400 | [diff] [blame] | 132 | imagePullSecrets: |
| 133 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |