blob: f7492e03c9c63dbf99a5087423e50b56ba62c777 [file] [log] [blame]
Jack Lucas332b5e72019-02-06 16:03:13 -05001#============LICENSE_START========================================================
2# ================================================================================
3# Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
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# ============LICENSE_END=========================================================
17
Krzysztof Kuzmickiaef70072020-07-24 14:47:43 +020018apiVersion: apps/v1
Jack Lucas332b5e72019-02-06 16:03:13 -050019kind: Deployment
20metadata:
21 name: {{ include "common.fullname" . }}
22 namespace: {{ include "common.namespace" . }}
23 labels:
24 app: {{ include "common.name" . }}
25 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010026 release: {{ include "common.release" . }}
Jack Lucas332b5e72019-02-06 16:03:13 -050027 heritage: {{ .Release.Service }}
28spec:
29 replicas: 1
Krzysztof Kuzmickiaef70072020-07-24 14:47:43 +020030 selector:
31 matchLabels:
32 app: {{ include "common.name" . }}
Jack Lucas332b5e72019-02-06 16:03:13 -050033 template:
34 metadata:
35 labels:
36 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010037 release: {{ include "common.release" . }}
Jack Lucas332b5e72019-02-06 16:03:13 -050038 spec:
39 initContainers:
40 - name: {{ include "common.name" . }}-readiness
41 image: {{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}
42 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
43 command:
44 - /root/ready.py
45 args:
46 - --container-name
47 - dcae-deployment-handler
48 - --container-name
49 - consul-server
50 - --container-name
jhhd4258672020-08-09 12:08:08 -050051 - policy-xacml-pdp
Jack Lucas332b5e72019-02-06 16:03:13 -050052 - "-t"
53 - "45"
54 env:
55 - name: NAMESPACE
56 valueFrom:
57 fieldRef:
58 apiVersion: v1
59 fieldPath: metadata.namespace
60 - name: init-tls
61 env:
62 - name: POD_IP
63 valueFrom:
64 fieldRef:
65 apiVersion: v1
66 fieldPath: status.podIP
Jack Lucasc70bc7e2019-09-23 09:02:31 -040067 - name: aaf_locator_fqdn
68 value: dcae
Jack Lucas332b5e72019-02-06 16:03:13 -050069 image: {{ .Values.global.tlsRepository }}/{{ .Values.global.tlsImage }}
70 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
71 resources: {}
72 volumeMounts:
Jack Lucasc70bc7e2019-09-23 09:02:31 -040073 - mountPath: /opt/app/osaaf
Jack Lucas332b5e72019-02-06 16:03:13 -050074 name: tls-info
75 - name: init-consul
76 image: {{ .Values.global.consulLoaderRepository }}/{{ .Values.global.consulLoaderImage }}
77 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
78 args:
79 - --key
80 - policy_handler|/phconfig/config.json
81 resources: {}
82 volumeMounts:
83 - mountPath: /phconfig
84 name: ph-config
85 containers:
86 - name: {{ include "common.name" . }}
87 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
88 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
89 resources:
90{{ include "common.resources" . | indent 12 }}
91 ports:
92 - containerPort: {{ .Values.service.internalPort }}
93 # disable liveness probe when breakpoints set in debugger
94 # so K8s doesn't restart unresponsive container
95 {{- if eq .Values.liveness.enabled true }}
96 livenessProbe:
97 tcpSocket:
98 port: {{ .Values.service.internalPort }}
99 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
100 periodSeconds: {{ .Values.liveness.periodSeconds }}
101 {{ end }}
102 readinessProbe:
103 httpGet:
104 path: {{ .Values.readiness.path }}
105 port: {{ .Values.service.internalPort }}
106 scheme: {{ .Values.readiness.scheme }}
107 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
108 periodSeconds: {{ .Values.readiness.periodSeconds }}
109 volumeMounts:
110 - mountPath: /opt/app/policy_handler/logs
111 name: component-log
112 - mountPath: /opt/app/policy_handler/etc/tls/certs/
113 name: tls-info
114 env:
115 - name: CONSUL_HOST
116 value: consul-server.{{ include "common.namespace" . }}
117 - name: CLOUDIFY_USER
118 value: admin
119 - name: CLOUDIFY_PASSWORD
120 value: admin
121 - name: CONFIG_BINDING_SERVICE
122 value: config-binding-service
123 - name: POD_IP
124 valueFrom:
125 fieldRef:
126 apiVersion: v1
127 fieldPath: status.podIP
128 - name: {{ include "common.name" . }}-filebeat
129 env:
130 - name: POD_IP
131 valueFrom:
132 fieldRef:
133 apiVersion: v1
134 fieldPath: status.podIP
135 image: {{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}
136 imagePullPolicy: IfNotPresent
137 resources: {}
138 volumeMounts:
Jack Lucas128c0ad2019-09-04 15:44:33 -0400139 - mountPath: /var/log/onap/policy-handler
Jack Lucas332b5e72019-02-06 16:03:13 -0500140 name: component-log
141 - mountPath: /usr/share/filebeat/data
142 name: filebeat-data
143 - mountPath: /usr/share/filebeat/filebeat.yml
144 name: filebeat-conf
145 subPath: filebeat.yml
146 volumes:
147 - emptyDir: {}
148 name: component-log
149 - emptyDir: {}
150 name: filebeat-data
151 - configMap:
152 defaultMode: 420
153 name: {{ include "common.fullname" . }}-filebeat-configmap
154 name: filebeat-conf
155 - emptyDir: {}
156 name: tls-info
157 - configMap:
158 defaultMode: 422
159 name: {{ include "common.fullname" . }}-configmap
160 name: ph-config
161 imagePullSecrets:
162 - name: "{{ include "common.namespace" . }}-docker-registry-key"