blob: 2f46a6d667cf09f655e1c6e5225fa2ea647d0f15 [file] [log] [blame]
Jakub Latusek544ded22020-10-21 13:36:29 +02001{{/*
Ikram Ikramullah40b120b2018-05-01 11:35:40 -04002# Copyright © 2017 Amdocs, Bell Canada
Nishukumar376ba1e2018-08-03 09:17:23 +00003# Modifications Copyright © 2018 AT&T,VMware
krishnaa9699406132020-09-24 20:39:49 +05304# Modifications Copyright (C) 2020 Wipro Limited.
Ikram Ikramullah40b120b2018-05-01 11:35:40 -04005#
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 Latusek544ded22020-10-21 13:36:29 +020017*/}}
Ikram Ikramullah40b120b2018-05-01 11:35:40 -040018
Grzegorz-Lis7a152ac2020-07-30 11:55:24 +020019apiVersion: apps/v1
Ikram Ikramullah40b120b2018-05-01 11:35:40 -040020kind: Deployment
21metadata:
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 Opasiak137d7cc2020-01-24 23:49:11 +010027 release: {{ include "common.release" . }}
Ikram Ikramullah40b120b2018-05-01 11:35:40 -040028 heritage: {{ .Release.Service }}
29spec:
Grzegorz-Lis7a152ac2020-07-30 11:55:24 +020030 selector:
31 matchLabels:
32 app: {{ include "common.name" . }}
Ikram Ikramullah40b120b2018-05-01 11:35:40 -040033 replicas: {{ .Values.replicaCount }}
34 template:
35 metadata:
36 labels:
37 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010038 release: {{ include "common.release" . }}
Ikram Ikramullah40b120b2018-05-01 11:35:40 -040039 spec:
40 initContainers:
41 - command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020042 - /app/ready.py
Ikram Ikramullah40b120b2018-05-01 11:35:40 -040043 args:
44 - --container-name
Krzysztof Opasiak1cddd1d2020-04-16 20:06:50 +020045 - policy-xacml-pdp
Ikram Ikramullah40b120b2018-05-01 11:35:40 -040046 env:
47 - name: NAMESPACE
48 valueFrom:
49 fieldRef:
50 apiVersion: v1
51 fieldPath: metadata.namespace
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020052 image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
Ikram Ikramullah40b120b2018-05-01 11:35:40 -040053 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
54 name: {{ include "common.name" . }}-readiness
Dileep Ranganathan61225cb2018-10-01 08:14:16 -070055 - command:
56 - sh
57 - -c
58 - resp="FAILURE";
59 until [ $resp = "200" ]; do
60 resp=$(curl -s -o /dev/null -k --write-out %{http_code} https://aaf-sms.{{ include "common.namespace" . }}:10443/v1/sms/domain/osdf/secret);
61 echo $resp;
62 sleep 2;
63 done
64 env:
65 - name: NAMESPACE
66 valueFrom:
67 fieldRef:
68 apiVersion: v1
69 fieldPath: metadata.namespace
Sylvain Desbureauxcc7d35a2020-04-20 12:05:56 +020070 image: "{{ .Values.global.dockerHubRepository }}/{{ .Values.global.curlImage }}"
Dileep Ranganathan61225cb2018-10-01 08:14:16 -070071 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
72 name: {{ include "common.name" . }}-osdf-sms-readiness
krishnaa96dbcd1ca2020-08-11 10:26:50 +053073{{ include "common.certInitializer.initContainer" . | indent 6 }}
Ikram Ikramullah40b120b2018-05-01 11:35:40 -040074 containers:
75 - name: {{ include "common.name" . }}
76 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
77 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
krishnaa9624a7ef32020-10-09 12:01:05 +053078 command:
79 - /bin/sh
80 args:
81 - "-c"
82 - |
83 grep -v '^$' /opt/osdf/osaaf/local/org.onap.oof.crt > /tmp/oof.crt
84 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
85 ./osdfapp.sh -x osdfapp.py
Ikram Ikramullah40b120b2018-05-01 11:35:40 -040086 ports:
87 - containerPort: {{ .Values.service.internalPort }}
88 # disable liveness probe when breakpoints set in debugger
89 # so K8s doesn't restart unresponsive container
90 {{- if .Values.liveness.enabled }}
91 livenessProbe:
92 tcpSocket:
93 port: {{ .Values.service.internalPort }}
94 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
95 periodSeconds: {{ .Values.liveness.periodSeconds }}
96 {{ end -}}
97 readinessProbe:
98 tcpSocket:
99 port: {{ .Values.service.internalPort }}
100 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
101 periodSeconds: {{ .Values.readiness.periodSeconds }}
102 env:
103 volumeMounts:
krishnaa96dbcd1ca2020-08-11 10:26:50 +0530104{{ include "common.certInitializer.volumeMount" . | indent 10 }}
Ikram Ikramullah40b120b2018-05-01 11:35:40 -0400105 - mountPath: /etc/localtime
106 name: localtime
107 readOnly: true
Krzysztof Opasiak1cddd1d2020-04-16 20:06:50 +0200108 - mountPath: /opt/osdf/config/osdf_config.yaml
Ikram Ikramullah40b120b2018-05-01 11:35:40 -0400109 name: {{ include "common.fullname" . }}-config
110 subPath: osdf_config.yaml
Dileep Ranganathanf706ae12018-10-01 04:27:13 -0700111 - mountPath: /opt/app/ssl_cert/aaf_root_ca.cer
krishnaa9624a7ef32020-10-09 12:01:05 +0530112 name: {{ include "common.fullname" . }}-onap-certs
Dileep Ranganathanf706ae12018-10-01 04:27:13 -0700113 subPath: aaf_root_ca.cer
krishnaa9624a7ef32020-10-09 12:01:05 +0530114 - mountPath: /opt/app/ssl_cert/intermediate_root_ca.pem
115 name: {{ include "common.fullname" . }}-onap-certs
116 subPath: intermediate_root_ca.pem
vrvarma8f500492019-04-25 23:08:01 -0400117 - mountPath: /opt/osdf/config/common_config.yaml
118 name: {{ include "common.fullname" . }}-config
119 subPath: common_config.yaml
krishnaa9699406132020-09-24 20:39:49 +0530120 - mountPath: /opt/osdf/config/log.yml
121 name: {{ include "common.fullname" . }}-config
122 subPath: log.yml
Ikram Ikramullah40b120b2018-05-01 11:35:40 -0400123 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000124{{ include "common.resources" . | indent 12 }}
Ikram Ikramullah40b120b2018-05-01 11:35:40 -0400125 {{- if .Values.nodeSelector }}
126 nodeSelector:
127{{ toYaml .Values.nodeSelector | indent 10 }}
128 {{- end -}}
129 {{- if .Values.affinity }}
130 affinity:
131{{ toYaml .Values.affinity | indent 10 }}
132 {{- end }}
133
134 volumes:
krishnaa96dbcd1ca2020-08-11 10:26:50 +0530135 {{ include "common.certInitializer.volumes" . | nindent 8 }}
Ikram Ikramullah40b120b2018-05-01 11:35:40 -0400136 - name: localtime
137 hostPath:
138 path: /etc/localtime
139 - name: {{ include "common.fullname" . }}-config
140 configMap:
141 name: {{ include "common.fullname" . }}-configmap
142 items:
143 - key: osdf_config.yaml
144 path: osdf_config.yaml
vrvarma8f500492019-04-25 23:08:01 -0400145 - key: common_config.yaml
146 path: common_config.yaml
krishnaa9699406132020-09-24 20:39:49 +0530147 - key: log.yml
148 path: log.yml
krishnaa9624a7ef32020-10-09 12:01:05 +0530149{{ include "oof.certificate.volume" . | indent 8 }}
Ikram Ikramullah40b120b2018-05-01 11:35:40 -0400150 imagePullSecrets:
151 - name: "{{ include "common.namespace" . }}-docker-registry-key"