blob: 7277db6cf6263b884775b5d1867520325034ad73 [file] [log] [blame]
Jakub Latusekdf233a82020-10-21 13:36:29 +02001{{/*
Jack Lucas6fae7632019-01-25 11:46:00 -05002#============LICENSE_START========================================================
3# ================================================================================
4# Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
5# ================================================================================
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 Lucas6fae7632019-01-25 11:46:00 -050019
Krzysztof Kuzmickiaef70072020-07-24 14:47:43 +020020apiVersion: apps/v1
Jack Lucas6fae7632019-01-25 11:46:00 -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 Lucas6fae7632019-01-25 11:46:00 -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 Lucas6fae7632019-01-25 11:46:00 -050035 template:
36 metadata:
37 labels:
38 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010039 release: {{ include "common.release" . }}
Jack Lucas6fae7632019-01-25 11:46:00 -050040 spec:
41 initContainers:
42 - name: {{ include "common.name" . }}-readiness
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020043 image: {{ include "common.repository" . }}/{{ .Values.global.readinessImage }}
Jack Lucas6fae7632019-01-25 11:46:00 -050044 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
45 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020046 - /app/ready.py
Jack Lucas6fae7632019-01-25 11:46:00 -050047 args:
48 - --container-name
49 - consul-server
Jack Lucas8c3463e2020-06-12 18:36:55 -040050 - --container-name
51 - aaf-cm
Jack Lucas6fae7632019-01-25 11:46:00 -050052 - "-t"
53 - "15"
54 env:
55 - name: NAMESPACE
56 valueFrom:
57 fieldRef:
58 apiVersion: v1
59 fieldPath: metadata.namespace
Jack Lucasc70bc7e2019-09-23 09:02:31 -040060 - name: aaf_locator_fqdn
61 value: dcae
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000062 {{- if .Values.service.secure.enabled }}
63 - name: init-tls
64 env:
65 - name: POD_IP
66 valueFrom:
67 fieldRef:
68 apiVersion: v1
69 fieldPath: status.podIP
70 image: {{ .Values.global.tlsRepository }}/{{ .Values.global.tlsImage }}
71 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
72 resources: {}
73 volumeMounts:
Jack Lucasc70bc7e2019-09-23 09:02:31 -040074 - mountPath: /opt/app/osaaf
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000075 name: tls-info
76 {{ end }}
Jack Lucas6fae7632019-01-25 11:46:00 -050077 containers:
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000078 {{- if .Values.service.secure.enabled }}
Jack Lucas6fae7632019-01-25 11:46:00 -050079 - name: {{ include "common.name" . }}
80 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
81 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
82 resources:
83{{ include "common.resources" . | indent 12 }}
84 ports:
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000085 - containerPort: {{ .Values.service.secure.internalPort }}
Jack Lucas6fae7632019-01-25 11:46:00 -050086 # disable liveness probe when breakpoints set in debugger
87 # so K8s doesn't restart unresponsive container
88 {{- if eq .Values.liveness.enabled true }}
89 livenessProbe:
90 tcpSocket:
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000091 port: {{ .Values.service.secure.internalPort }}
Jack Lucas6fae7632019-01-25 11:46:00 -050092 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
93 periodSeconds: {{ .Values.liveness.periodSeconds }}
Jakub Latusek3c75b9e2020-09-25 15:39:57 +020094 {{ end }}
Jack Lucas6fae7632019-01-25 11:46:00 -050095 readinessProbe:
96 httpGet:
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000097 scheme: "HTTPS"
Jack Lucas6fae7632019-01-25 11:46:00 -050098 path: {{ .Values.readiness.path }}
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000099 port: {{ .Values.service.secure.internalPort }}
Jack Lucas6fae7632019-01-25 11:46:00 -0500100 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
101 periodSeconds: {{ .Values.readiness.periodSeconds }}
102 volumeMounts:
103 - name: {{ include "common.fullname" . }}-logs
104 mountPath: /opt/logs
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000105 - name: tls-info
106 mountPath: /opt/tls
Jack Lucas6fae7632019-01-25 11:46:00 -0500107 env:
108 - name: CONSUL_HOST
109 value: consul.{{ include "common.namespace" . }}
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000110 - name: USE_HTTPS
111 value: "1"
112 - name: HTTPS_CERT_PATH
113 value: "/opt/tls/cert.pem"
114 - name: HTTPS_KEY_PATH
115 value: "/opt/tls/key.pem"
Jack Lucas128c0ad2019-09-04 15:44:33 -0400116 - name: {{ include "common.name" . }}-fb-onap
Jack Lucas6fae7632019-01-25 11:46:00 -0500117 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
118 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
119 volumeMounts:
Jack Lucas128c0ad2019-09-04 15:44:33 -0400120 - name: {{ include "common.fullname" . }}-fb-conf
Jack Lucas6fae7632019-01-25 11:46:00 -0500121 mountPath: /usr/share/filebeat/filebeat.yml
122 subPath: filebeat.yml
Jack Lucas128c0ad2019-09-04 15:44:33 -0400123 - name: {{ include "common.fullname" . }}-data-fb
Jack Lucas6fae7632019-01-25 11:46:00 -0500124 mountPath: /usr/share/filebeat/data
125 - name: {{ include "common.fullname" . }}-logs
Jack Lucas128c0ad2019-09-04 15:44:33 -0400126 mountPath: /var/log/onap/config-binding-service
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000127 {{ end }}
128 {{- if .Values.service.insecure.enabled }}
129 - name: {{ include "common.name" . }}-insecure
130 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
131 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
132 resources:
133{{ include "common.resources" . | indent 12 }}
134 ports:
135 - containerPort: {{ .Values.service.insecure.internalPort }}
136 # disable liveness probe when breakpoints set in debugger
137 # so K8s doesn't restart unresponsive container
138 {{- if eq .Values.liveness.enabled true }}
139 livenessProbe:
140 tcpSocket:
141 port: {{ .Values.service.insecure.internalPort }}
142 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
143 periodSeconds: {{ .Values.liveness.periodSeconds }}
Jakub Latusek3c75b9e2020-09-25 15:39:57 +0200144 {{ end }}
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000145 readinessProbe:
146 httpGet:
147 scheme: "HTTP"
148 path: {{ .Values.readiness.path }}
149 port: {{ .Values.service.insecure.internalPort }}
150 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
151 periodSeconds: {{ .Values.readiness.periodSeconds }}
152 volumeMounts:
Jack Lucas128c0ad2019-09-04 15:44:33 -0400153 - name: {{ include "common.fullname" . }}-logs-i
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000154 mountPath: /opt/logs
155 env:
156 - name: CONSUL_HOST
157 value: consul.{{ include "common.namespace" . }}
Jack Lucas128c0ad2019-09-04 15:44:33 -0400158 - name: {{ include "common.name" . }}-fb-onap-i
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000159 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
160 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
161 volumeMounts:
Jack Lucas128c0ad2019-09-04 15:44:33 -0400162 - name: {{ include "common.fullname" . }}-fb-conf
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000163 mountPath: /usr/share/filebeat/filebeat.yml
164 subPath: filebeat.yml
Jack Lucas128c0ad2019-09-04 15:44:33 -0400165 - name: {{ include "common.fullname" . }}-data-fb-i
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000166 mountPath: /usr/share/filebeat/data
Jack Lucas128c0ad2019-09-04 15:44:33 -0400167 - name: {{ include "common.fullname" . }}-logs-i
168 mountPath: /var/log/onap/config-binding-service
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000169 {{ end }}
Jack Lucas6fae7632019-01-25 11:46:00 -0500170 volumes:
Jack Lucas128c0ad2019-09-04 15:44:33 -0400171 - name: {{ include "common.fullname" . }}-fb-conf
Jack Lucas6fae7632019-01-25 11:46:00 -0500172 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100173 name: {{ include "common.release" . }}-cbs-filebeat-configmap
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000174 {{- if .Values.service.secure.enabled }}
Jack Lucas128c0ad2019-09-04 15:44:33 -0400175 - name: {{ include "common.fullname" . }}-data-fb
Jack Lucas6fae7632019-01-25 11:46:00 -0500176 emptyDir: {}
177 - name: {{ include "common.fullname" . }}-logs
178 emptyDir: {}
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000179 - name: tls-info
180 emptyDir: {}
181 {{ end }}
182 {{- if .Values.service.insecure.enabled }}
Jack Lucas128c0ad2019-09-04 15:44:33 -0400183 - name: {{ include "common.fullname" . }}-data-fb-i
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000184 emptyDir: {}
Jack Lucas128c0ad2019-09-04 15:44:33 -0400185 - name: {{ include "common.fullname" . }}-logs-i
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000186 emptyDir: {}
187 {{ end }}
188
Jack Lucas6fae7632019-01-25 11:46:00 -0500189 imagePullSecrets:
190 - name: "{{ include "common.namespace" . }}-docker-registry-key"