Jakub Latusek | df233a8 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 2 | #============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 Latusek | df233a8 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 18 | */}} |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 19 | |
Krzysztof Kuzmicki | aef7007 | 2020-07-24 14:47:43 +0200 | [diff] [blame] | 20 | apiVersion: apps/v1 |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 21 | kind: Deployment |
| 22 | metadata: |
| 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 Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 28 | release: {{ include "common.release" . }} |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 29 | heritage: {{ .Release.Service }} |
| 30 | spec: |
| 31 | replicas: 1 |
Krzysztof Kuzmicki | aef7007 | 2020-07-24 14:47:43 +0200 | [diff] [blame] | 32 | selector: |
| 33 | matchLabels: |
| 34 | app: {{ include "common.name" . }} |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 35 | template: |
| 36 | metadata: |
| 37 | labels: |
| 38 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 39 | release: {{ include "common.release" . }} |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 40 | spec: |
| 41 | initContainers: |
Krzysztof Opasiak | bb48fc8 | 2020-05-05 11:36:30 +0200 | [diff] [blame] | 42 | - 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 Desbureaux | cad63e5 | 2020-11-21 22:17:40 +0100 | [diff] [blame] | 57 | image: {{ include "repositoryGenerator.image.envsubst" . }} |
Krzysztof Opasiak | bb48fc8 | 2020-05-05 11:36:30 +0200 | [diff] [blame] | 58 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 59 | name: {{ include "common.name" . }}-update-config |
| 60 | |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 61 | - name: {{ include "common.name" . }}-readiness |
Sylvain Desbureaux | cad63e5 | 2020-11-21 22:17:40 +0100 | [diff] [blame] | 62 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 63 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 64 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 65 | - /app/ready.py |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 66 | args: |
| 67 | - --container-name |
| 68 | - {{ .Values.postgres.nameOverride }} |
Jack Lucas | 8c3463e | 2020-06-12 18:36:55 -0400 | [diff] [blame] | 69 | - --container-name |
| 70 | - aaf-cm |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 71 | - "-t" |
| 72 | - "15" |
| 73 | env: |
| 74 | - name: NAMESPACE |
| 75 | valueFrom: |
| 76 | fieldRef: |
| 77 | apiVersion: v1 |
| 78 | fieldPath: metadata.namespace |
Vijay Venkatesh Kumar | a4535c9 | 2019-08-02 01:45:23 +0000 | [diff] [blame] | 79 | - name: init-tls |
| 80 | env: |
Jack Lucas | c686131 | 2020-03-03 15:57:59 -0500 | [diff] [blame] | 81 | - name: aaf_locator_fqdn |
| 82 | value: dcae |
Vijay Venkatesh Kumar | a4535c9 | 2019-08-02 01:45:23 +0000 | [diff] [blame] | 83 | - name: POD_IP |
| 84 | valueFrom: |
| 85 | fieldRef: |
| 86 | apiVersion: v1 |
| 87 | fieldPath: status.podIP |
Sylvain Desbureaux | cad63e5 | 2020-11-21 22:17:40 +0100 | [diff] [blame] | 88 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.global.tlsImage }} |
Vijay Venkatesh Kumar | a4535c9 | 2019-08-02 01:45:23 +0000 | [diff] [blame] | 89 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 90 | resources: {} |
| 91 | volumeMounts: |
Jack Lucas | c686131 | 2020-03-03 15:57:59 -0500 | [diff] [blame] | 92 | - mountPath: /opt/app/osaaf |
Vijay Venkatesh Kumar | a4535c9 | 2019-08-02 01:45:23 +0000 | [diff] [blame] | 93 | name: tls-info |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 94 | containers: |
| 95 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | cad63e5 | 2020-11-21 22:17:40 +0100 | [diff] [blame] | 96 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 97 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Jack Lucas | 4c4ba44 | 2019-02-12 17:09:46 -0500 | [diff] [blame] | 98 | # 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 Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 104 | args: |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 105 | - "/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 Kumar | a4535c9 | 2019-08-02 01:45:23 +0000 | [diff] [blame] | 123 | scheme: {{ .Values.readiness.scheme }} |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 124 | 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 Kumar | a4535c9 | 2019-08-02 01:45:23 +0000 | [diff] [blame] | 130 | - mountPath: /opt/cert/ |
| 131 | name: tls-info |
Vijay Venkatesh Kumar | 694394b | 2020-02-20 21:50:14 +0000 | [diff] [blame] | 132 | - mountPath: /opt/logs/ |
| 133 | name: component-log |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 134 | env: |
| 135 | - name: CONSUL_HOST |
| 136 | value: consul.{{ include "common.namespace" . }} |
Vijay Venkatesh Kumar | 694394b | 2020-02-20 21:50:14 +0000 | [diff] [blame] | 137 | - name: {{ include "common.name" . }}-filebeat |
| 138 | env: |
| 139 | - name: POD_IP |
| 140 | valueFrom: |
| 141 | fieldRef: |
| 142 | apiVersion: v1 |
| 143 | fieldPath: status.podIP |
Sylvain Desbureaux | cad63e5 | 2020-11-21 22:17:40 +0100 | [diff] [blame] | 144 | image: {{ include "repositoryGenerator.image.logging" . }} |
Vijay Venkatesh Kumar | 694394b | 2020-02-20 21:50:14 +0000 | [diff] [blame] | 145 | 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 azmy | 3748180 | 2021-04-11 15:41:32 +0200 | [diff] [blame] | 155 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 156 | volumes: |
Vijay Venkatesh Kumar | 694394b | 2020-02-20 21:50:14 +0000 | [diff] [blame] | 157 | - 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 Opasiak | bb48fc8 | 2020-05-05 11:36:30 +0200 | [diff] [blame] | 165 | - name: {{ include "common.fullname" . }}-inv-config-input |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 166 | configMap: |
| 167 | name: {{ include "common.fullname" . }}-configmap |
Krzysztof Opasiak | bb48fc8 | 2020-05-05 11:36:30 +0200 | [diff] [blame] | 168 | - name: {{ include "common.fullname" . }}-inv-config |
| 169 | emptyDir: |
| 170 | medium: Memory |
Vijay Venkatesh Kumar | a4535c9 | 2019-08-02 01:45:23 +0000 | [diff] [blame] | 171 | - emptyDir: {} |
| 172 | name: tls-info |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 173 | imagePullSecrets: |
| 174 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |