blob: a4becb5e4fd28e0e625e6e37ea589bd3d0dbc4f6 [file] [log] [blame]
Jakub Latusekdf233a82020-10-21 13:36:29 +02001{{/*
Jack Lucas332b5e72019-02-06 16:03:13 -05002#============LICENSE_START========================================================
3# ================================================================================
Schmalzried, Terry (ts862m)12db7892020-08-21 20:42:33 -04004# Copyright (c) 2019-2020 AT&T Intellectual Property. All rights reserved.
Jack Lucas332b5e72019-02-06 16:03:13 -05005# ================================================================================
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.
17# ============LICENSE_END=========================================================
Jakub Latusekdf233a82020-10-21 13:36:29 +020018*/}}
Jack Lucas332b5e72019-02-06 16:03:13 -050019
Krzysztof Kuzmickiaef70072020-07-24 14:47:43 +020020apiVersion: apps/v1
Jack Lucas332b5e72019-02-06 16:03:13 -050021kind: Deployment
22metadata:
23 name: {{ include "common.fullname" . }}
24 namespace: {{ include "common.namespace" . }}
25 labels:
26 app: {{ include "common.name" . }}
27 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010028 release: {{ include "common.release" . }}
Jack Lucas332b5e72019-02-06 16:03:13 -050029 heritage: {{ .Release.Service }}
30spec:
31 replicas: 1
Krzysztof Kuzmickiaef70072020-07-24 14:47:43 +020032 selector:
33 matchLabels:
34 app: {{ include "common.name" . }}
Jack Lucas332b5e72019-02-06 16:03:13 -050035 template:
36 metadata:
37 labels:
38 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010039 release: {{ include "common.release" . }}
Jack Lucas332b5e72019-02-06 16:03:13 -050040 spec:
41 initContainers:
42 - name: {{ include "common.name" . }}-readiness
Sylvain Desbureauxcad63e52020-11-21 22:17:40 +010043 image: {{ include "repositoryGenerator.image.readiness" . }}
Jack Lucas332b5e72019-02-06 16:03:13 -050044 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
45 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020046 - /app/ready.py
Jack Lucas332b5e72019-02-06 16:03:13 -050047 args:
48 - --container-name
49 - dcae-deployment-handler
50 - --container-name
51 - consul-server
52 - --container-name
jhhd4258672020-08-09 12:08:08 -050053 - policy-xacml-pdp
Jack Lucas332b5e72019-02-06 16:03:13 -050054 - "-t"
55 - "45"
56 env:
57 - name: NAMESPACE
58 valueFrom:
59 fieldRef:
60 apiVersion: v1
61 fieldPath: metadata.namespace
62 - name: init-tls
63 env:
64 - name: POD_IP
65 valueFrom:
66 fieldRef:
67 apiVersion: v1
68 fieldPath: status.podIP
Jack Lucasc70bc7e2019-09-23 09:02:31 -040069 - name: aaf_locator_fqdn
70 value: dcae
Sylvain Desbureauxcad63e52020-11-21 22:17:40 +010071 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.global.tlsImage }}
Jack Lucas332b5e72019-02-06 16:03:13 -050072 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
73 resources: {}
74 volumeMounts:
Jack Lucasc70bc7e2019-09-23 09:02:31 -040075 - mountPath: /opt/app/osaaf
Jack Lucas332b5e72019-02-06 16:03:13 -050076 name: tls-info
77 - name: init-consul
Sylvain Desbureauxcad63e52020-11-21 22:17:40 +010078 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.global.consulLoaderImage }}
Jack Lucas332b5e72019-02-06 16:03:13 -050079 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
80 args:
81 - --key
82 - policy_handler|/phconfig/config.json
83 resources: {}
84 volumeMounts:
85 - mountPath: /phconfig
86 name: ph-config
87 containers:
88 - name: {{ include "common.name" . }}
Sylvain Desbureauxcad63e52020-11-21 22:17:40 +010089 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Jack Lucas332b5e72019-02-06 16:03:13 -050090 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
91 resources:
92{{ include "common.resources" . | indent 12 }}
93 ports:
94 - containerPort: {{ .Values.service.internalPort }}
95 # disable liveness probe when breakpoints set in debugger
96 # so K8s doesn't restart unresponsive container
97 {{- if eq .Values.liveness.enabled true }}
98 livenessProbe:
99 tcpSocket:
100 port: {{ .Values.service.internalPort }}
101 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
102 periodSeconds: {{ .Values.liveness.periodSeconds }}
103 {{ end }}
104 readinessProbe:
105 httpGet:
106 path: {{ .Values.readiness.path }}
107 port: {{ .Values.service.internalPort }}
108 scheme: {{ .Values.readiness.scheme }}
109 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
110 periodSeconds: {{ .Values.readiness.periodSeconds }}
111 volumeMounts:
112 - mountPath: /opt/app/policy_handler/logs
113 name: component-log
114 - mountPath: /opt/app/policy_handler/etc/tls/certs/
115 name: tls-info
116 env:
117 - name: CONSUL_HOST
118 value: consul-server.{{ include "common.namespace" . }}
119 - name: CLOUDIFY_USER
120 value: admin
121 - name: CLOUDIFY_PASSWORD
Schmalzried, Terry (ts862m)12db7892020-08-21 20:42:33 -0400122 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cm-pass" "key" "password") | indent 14 }}
Jack Lucas332b5e72019-02-06 16:03:13 -0500123 - name: CONFIG_BINDING_SERVICE
124 value: config-binding-service
125 - name: POD_IP
126 valueFrom:
127 fieldRef:
128 apiVersion: v1
129 fieldPath: status.podIP
130 - name: {{ include "common.name" . }}-filebeat
131 env:
132 - name: POD_IP
133 valueFrom:
134 fieldRef:
135 apiVersion: v1
136 fieldPath: status.podIP
Sylvain Desbureauxcad63e52020-11-21 22:17:40 +0100137 image: {{ include "repositoryGenerator.image.logging" . }}
Jack Lucas332b5e72019-02-06 16:03:13 -0500138 imagePullPolicy: IfNotPresent
139 resources: {}
140 volumeMounts:
Jack Lucas128c0ad2019-09-04 15:44:33 -0400141 - mountPath: /var/log/onap/policy-handler
Jack Lucas332b5e72019-02-06 16:03:13 -0500142 name: component-log
143 - mountPath: /usr/share/filebeat/data
144 name: filebeat-data
145 - mountPath: /usr/share/filebeat/filebeat.yml
146 name: filebeat-conf
147 subPath: filebeat.yml
148 volumes:
149 - emptyDir: {}
150 name: component-log
151 - emptyDir: {}
152 name: filebeat-data
153 - configMap:
154 defaultMode: 420
155 name: {{ include "common.fullname" . }}-filebeat-configmap
156 name: filebeat-conf
157 - emptyDir: {}
158 name: tls-info
159 - configMap:
160 defaultMode: 422
161 name: {{ include "common.fullname" . }}-configmap
162 name: ph-config
163 imagePullSecrets:
164 - name: "{{ include "common.namespace" . }}-docker-registry-key"