blob: 76d1a626043ba1830491302725f34976528edcfb [file] [log] [blame]
Ikram Ikramullah40b120b2018-05-01 11:35:40 -04001# Copyright © 2017 Amdocs, Bell Canada
Nishukumar376ba1e2018-08-03 09:17:23 +00002# Modifications Copyright © 2018 AT&T,VMware
krishnaa9699406132020-09-24 20:39:49 +05303# Modifications Copyright (C) 2020 Wipro Limited.
Ikram Ikramullah40b120b2018-05-01 11:35:40 -04004#
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-Lis7a152ac2020-07-30 11:55:24 +020017apiVersion: apps/v1
Ikram Ikramullah40b120b2018-05-01 11:35:40 -040018kind: Deployment
19metadata:
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 Opasiak137d7cc2020-01-24 23:49:11 +010025 release: {{ include "common.release" . }}
Ikram Ikramullah40b120b2018-05-01 11:35:40 -040026 heritage: {{ .Release.Service }}
27spec:
Grzegorz-Lis7a152ac2020-07-30 11:55:24 +020028 selector:
29 matchLabels:
30 app: {{ include "common.name" . }}
Ikram Ikramullah40b120b2018-05-01 11:35:40 -040031 replicas: {{ .Values.replicaCount }}
32 template:
33 metadata:
34 labels:
35 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010036 release: {{ include "common.release" . }}
Ikram Ikramullah40b120b2018-05-01 11:35:40 -040037 spec:
38 initContainers:
39 - command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020040 - /app/ready.py
Ikram Ikramullah40b120b2018-05-01 11:35:40 -040041 args:
42 - --container-name
Krzysztof Opasiak1cddd1d2020-04-16 20:06:50 +020043 - policy-xacml-pdp
Ikram Ikramullah40b120b2018-05-01 11:35:40 -040044 env:
45 - name: NAMESPACE
46 valueFrom:
47 fieldRef:
48 apiVersion: v1
49 fieldPath: metadata.namespace
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020050 image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
Ikram Ikramullah40b120b2018-05-01 11:35:40 -040051 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
52 name: {{ include "common.name" . }}-readiness
Dileep Ranganathan61225cb2018-10-01 08:14:16 -070053 - 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 Desbureauxcc7d35a2020-04-20 12:05:56 +020068 image: "{{ .Values.global.dockerHubRepository }}/{{ .Values.global.curlImage }}"
Dileep Ranganathan61225cb2018-10-01 08:14:16 -070069 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
70 name: {{ include "common.name" . }}-osdf-sms-readiness
krishnaa96dbcd1ca2020-08-11 10:26:50 +053071{{ include "common.certInitializer.initContainer" . | indent 6 }}
Ikram Ikramullah40b120b2018-05-01 11:35:40 -040072 containers:
73 - name: {{ include "common.name" . }}
74 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
75 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
76 ports:
77 - containerPort: {{ .Values.service.internalPort }}
78 # disable liveness probe when breakpoints set in debugger
79 # so K8s doesn't restart unresponsive container
80 {{- if .Values.liveness.enabled }}
81 livenessProbe:
82 tcpSocket:
83 port: {{ .Values.service.internalPort }}
84 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
85 periodSeconds: {{ .Values.liveness.periodSeconds }}
86 {{ end -}}
87 readinessProbe:
88 tcpSocket:
89 port: {{ .Values.service.internalPort }}
90 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
91 periodSeconds: {{ .Values.readiness.periodSeconds }}
92 env:
93 volumeMounts:
krishnaa96dbcd1ca2020-08-11 10:26:50 +053094{{ include "common.certInitializer.volumeMount" . | indent 10 }}
Ikram Ikramullah40b120b2018-05-01 11:35:40 -040095 - mountPath: /etc/localtime
96 name: localtime
97 readOnly: true
Krzysztof Opasiak1cddd1d2020-04-16 20:06:50 +020098 - mountPath: /opt/osdf/config/osdf_config.yaml
Ikram Ikramullah40b120b2018-05-01 11:35:40 -040099 name: {{ include "common.fullname" . }}-config
100 subPath: osdf_config.yaml
Dileep Ranganathanf706ae12018-10-01 04:27:13 -0700101 - mountPath: /opt/app/ssl_cert/aaf_root_ca.cer
102 name: {{ include "common.fullname" . }}-config
103 subPath: aaf_root_ca.cer
vrvarma8f500492019-04-25 23:08:01 -0400104 - mountPath: /opt/osdf/config/common_config.yaml
105 name: {{ include "common.fullname" . }}-config
106 subPath: common_config.yaml
krishnaa9699406132020-09-24 20:39:49 +0530107 - mountPath: /opt/osdf/config/log.yml
108 name: {{ include "common.fullname" . }}-config
109 subPath: log.yml
Ikram Ikramullah40b120b2018-05-01 11:35:40 -0400110 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000111{{ include "common.resources" . | indent 12 }}
Ikram Ikramullah40b120b2018-05-01 11:35:40 -0400112 {{- if .Values.nodeSelector }}
113 nodeSelector:
114{{ toYaml .Values.nodeSelector | indent 10 }}
115 {{- end -}}
116 {{- if .Values.affinity }}
117 affinity:
118{{ toYaml .Values.affinity | indent 10 }}
119 {{- end }}
120
121 volumes:
krishnaa96dbcd1ca2020-08-11 10:26:50 +0530122 {{ include "common.certInitializer.volumes" . | nindent 8 }}
Ikram Ikramullah40b120b2018-05-01 11:35:40 -0400123 - name: localtime
124 hostPath:
125 path: /etc/localtime
126 - name: {{ include "common.fullname" . }}-config
127 configMap:
128 name: {{ include "common.fullname" . }}-configmap
129 items:
130 - key: osdf_config.yaml
131 path: osdf_config.yaml
Dileep Ranganathanf706ae12018-10-01 04:27:13 -0700132 - key: aaf_root_ca.cer
133 path: aaf_root_ca.cer
vrvarma8f500492019-04-25 23:08:01 -0400134 - key: common_config.yaml
135 path: common_config.yaml
krishnaa9699406132020-09-24 20:39:49 +0530136 - key: log.yml
137 path: log.yml
Ikram Ikramullah40b120b2018-05-01 11:35:40 -0400138 imagePullSecrets:
139 - name: "{{ include "common.namespace" . }}-docker-registry-key"