blob: 7c3746a0a3340442b73cda22b1949ba23cbb1af9 [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:
Krzysztof Opasiakbb48fc82020-05-05 11:36:30 +020042 - command:
43 - sh
44 args:
45 - -c
46 - "cd /config-input && for PFILE in `find . -not -type d | grep -v -F ..`; do envsubst <${PFILE} >/config/${PFILE}; done"
47 env:
48 - name: PG_USER
49 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "login") | indent 12 }}
50 - name: PG_PASSWORD
51 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 12 }}
52 volumeMounts:
53 - mountPath: /config-input
54 name: {{ include "common.fullname" . }}-inv-config-input
55 - mountPath: /config
56 name: {{ include "common.fullname" . }}-inv-config
Sylvain Desbureauxcad63e52020-11-21 22:17:40 +010057 image: {{ include "repositoryGenerator.image.envsubst" . }}
Krzysztof Opasiakbb48fc82020-05-05 11:36:30 +020058 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
59 name: {{ include "common.name" . }}-update-config
60
Jack Lucas6fae7632019-01-25 11:46:00 -050061 - name: {{ include "common.name" . }}-readiness
Sylvain Desbureauxcad63e52020-11-21 22:17:40 +010062 image: {{ include "repositoryGenerator.image.readiness" . }}
Jack Lucas6fae7632019-01-25 11:46:00 -050063 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
64 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020065 - /app/ready.py
Jack Lucas6fae7632019-01-25 11:46:00 -050066 args:
67 - --container-name
68 - {{ .Values.postgres.nameOverride }}
Jack Lucas8c3463e2020-06-12 18:36:55 -040069 - --container-name
70 - aaf-cm
Jack Lucas6fae7632019-01-25 11:46:00 -050071 - "-t"
72 - "15"
73 env:
74 - name: NAMESPACE
75 valueFrom:
76 fieldRef:
77 apiVersion: v1
78 fieldPath: metadata.namespace
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000079 - name: init-tls
80 env:
Jack Lucasc6861312020-03-03 15:57:59 -050081 - name: aaf_locator_fqdn
82 value: dcae
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000083 - name: POD_IP
84 valueFrom:
85 fieldRef:
86 apiVersion: v1
87 fieldPath: status.podIP
Sylvain Desbureauxcad63e52020-11-21 22:17:40 +010088 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.global.tlsImage }}
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000089 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
90 resources: {}
91 volumeMounts:
Jack Lucasc6861312020-03-03 15:57:59 -050092 - mountPath: /opt/app/osaaf
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000093 name: tls-info
Jack Lucas6fae7632019-01-25 11:46:00 -050094 containers:
95 - name: {{ include "common.name" . }}
Sylvain Desbureauxcad63e52020-11-21 22:17:40 +010096 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Jack Lucas6fae7632019-01-25 11:46:00 -050097 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Jack Lucas4c4ba442019-02-12 17:09:46 -050098 # Assumes that the Docker image is built with ENTRYPOINT set to
99 # ["java", "-jar", "/opt/inventory-api-x.y.z.jar", "server"]
100 # where "x.y.z" is the version number (matches the Docker image version number)
101 # The arg below adds a parameter, the path to a config file.
102 # This tells the inventory-api app to get its configuration from the file
103 # rather than querying Consul.
Jack Lucas6fae7632019-01-25 11:46:00 -0500104 args:
Jack Lucas6fae7632019-01-25 11:46:00 -0500105 - "/opt/config.json"
106 resources:
107{{ include "common.resources" . | indent 12 }}
108 ports:
109 - containerPort: {{ .Values.service.internalPort }}
110 # disable liveness probe when breakpoints set in debugger
111 # so K8s doesn't restart unresponsive container
112 {{- if eq .Values.liveness.enabled true }}
113 livenessProbe:
114 tcpSocket:
115 port: {{ .Values.service.internalPort }}
116 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
117 periodSeconds: {{ .Values.liveness.periodSeconds }}
118 {{ end }}
119 readinessProbe:
120 httpGet:
121 path: {{ .Values.readiness.path }}
122 port: {{ .Values.service.internalPort }}
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000123 scheme: {{ .Values.readiness.scheme }}
Jack Lucas6fae7632019-01-25 11:46:00 -0500124 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
125 periodSeconds: {{ .Values.readiness.periodSeconds }}
126 volumeMounts:
127 - name: {{ include "common.fullname" . }}-inv-config
128 mountPath: /opt/config.json
129 subPath: config.json
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000130 - mountPath: /opt/cert/
131 name: tls-info
Vijay Venkatesh Kumar694394b2020-02-20 21:50:14 +0000132 - mountPath: /opt/logs/
133 name: component-log
Jack Lucas6fae7632019-01-25 11:46:00 -0500134 env:
135 - name: CONSUL_HOST
136 value: consul.{{ include "common.namespace" . }}
Vijay Venkatesh Kumar694394b2020-02-20 21:50:14 +0000137 - name: {{ include "common.name" . }}-filebeat
138 env:
139 - name: POD_IP
140 valueFrom:
141 fieldRef:
142 apiVersion: v1
143 fieldPath: status.podIP
Sylvain Desbureauxcad63e52020-11-21 22:17:40 +0100144 image: {{ include "repositoryGenerator.image.logging" . }}
Vijay Venkatesh Kumar694394b2020-02-20 21:50:14 +0000145 imagePullPolicy: IfNotPresent
146 resources: {}
147 volumeMounts:
148 - mountPath: /var/log/onap/inventory
149 name: component-log
150 - mountPath: /usr/share/filebeat/data
151 name: filebeat-data
152 - mountPath: /usr/share/filebeat/filebeat.yml
153 name: filebeat-conf
154 subPath: filebeat.yml
farida azmy37481802021-04-11 15:41:32 +0200155 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Jack Lucas6fae7632019-01-25 11:46:00 -0500156 volumes:
Vijay Venkatesh Kumar694394b2020-02-20 21:50:14 +0000157 - emptyDir: {}
158 name: component-log
159 - emptyDir: {}
160 name: filebeat-data
161 - configMap:
162 defaultMode: 420
163 name: {{ include "common.fullname" . }}-filebeat-configmap
164 name: filebeat-conf
Krzysztof Opasiakbb48fc82020-05-05 11:36:30 +0200165 - name: {{ include "common.fullname" . }}-inv-config-input
Jack Lucas6fae7632019-01-25 11:46:00 -0500166 configMap:
167 name: {{ include "common.fullname" . }}-configmap
Krzysztof Opasiakbb48fc82020-05-05 11:36:30 +0200168 - name: {{ include "common.fullname" . }}-inv-config
169 emptyDir:
170 medium: Memory
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000171 - emptyDir: {}
172 name: tls-info
Jack Lucas6fae7632019-01-25 11:46:00 -0500173 imagePullSecrets:
174 - name: "{{ include "common.namespace" . }}-docker-registry-key"