Jakub Latusek | 67f4e8d | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
Durgpal | 7ad4069 | 2018-08-03 07:28:36 +0000 | [diff] [blame] | 2 | # Modifications Copyright © 2018 Amdocs,Bell Canada |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
Jakub Latusek | 67f4e8d | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 15 | */}} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 16 | |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 17 | apiVersion: apps/v1 |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 18 | kind: Deployment |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 19 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 20 | spec: |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 21 | selector: {{- include "common.selectors" . | nindent 4 }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 22 | replicas: {{ .Values.replicaCount }} |
| 23 | template: |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 24 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 25 | spec: |
rope252 | f2db5c1 | 2022-01-10 14:15:16 +0000 | [diff] [blame] | 26 | {{ include "common.podSecurityContext" . | indent 6 | trim}} |
Andreas Geissler | 0d5c917 | 2022-04-19 18:10:52 +0200 | [diff] [blame^] | 27 | {{- if .Values.PG.enabled }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 28 | initContainers: |
Krzysztof Opasiak | 03a125a | 2020-05-05 02:11:09 +0200 | [diff] [blame] | 29 | - command: |
| 30 | - sh |
| 31 | args: |
| 32 | - -c |
| 33 | - "cd /config-input && for PFILE in `find . -not -type d | grep -v -F ..`; do envsubst <${PFILE} >/config/${PFILE}; done" |
| 34 | env: |
| 35 | - name: PG_USER |
| 36 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "login") | indent 10 }} |
| 37 | - name: PG_PASSWORD |
| 38 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 10 }} |
| 39 | volumeMounts: |
| 40 | - mountPath: /config-input |
| 41 | name: {{ include "common.name" . }}-config-input |
| 42 | - mountPath: /config |
| 43 | name: {{ include "common.name" . }}-config |
Sylvain Desbureaux | 6b09654 | 2020-11-21 22:51:24 +0100 | [diff] [blame] | 44 | image: {{ include "repositoryGenerator.image.envsubst" . }} |
Krzysztof Opasiak | 03a125a | 2020-05-05 02:11:09 +0200 | [diff] [blame] | 45 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 46 | name: {{ include "common.name" . }}-update-config |
Krzysztof Opasiak | c32ee22 | 2020-05-07 00:26:00 +0200 | [diff] [blame] | 47 | {{ include "common.certInitializer.initContainer" . | nindent 6 }} |
Andreas Geissler | 0d5c917 | 2022-04-19 18:10:52 +0200 | [diff] [blame^] | 48 | {{- if .Values.global.aafEnabled }} |
Dominic Lunanuova | de7a02b | 2020-03-12 16:36:09 +0000 | [diff] [blame] | 49 | - name: {{ include "common.name" . }}-permission-fixer |
rope252 | f2db5c1 | 2022-01-10 14:15:16 +0000 | [diff] [blame] | 50 | securityContext: |
| 51 | runAsUser: 0 |
Sylvain Desbureaux | 6b09654 | 2020-11-21 22:51:24 +0100 | [diff] [blame] | 52 | image: {{ include "repositoryGenerator.image.busybox" . }} |
Dominic Lunanuova | de7a02b | 2020-03-12 16:36:09 +0000 | [diff] [blame] | 53 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Krzysztof Opasiak | c32ee22 | 2020-05-07 00:26:00 +0200 | [diff] [blame] | 54 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 8 }} |
Dominic Lunanuova | de7a02b | 2020-03-12 16:36:09 +0000 | [diff] [blame] | 55 | command: ["chown","-Rf","1000:1001", "/opt/app/"] |
| 56 | # See AAF-425 for explanation of why this is needed. |
| 57 | # This artifact is provisioned in AAF for both pks12 and jks format and apparently |
| 58 | # the cadi library is not using the jks password on the jks keystore. |
| 59 | # So, this attempts to "fix" the credential property file until this is fixed properly. |
| 60 | - name: {{ include "common.name" . }}-cred-fixer |
Sylvain Desbureaux | 6b09654 | 2020-11-21 22:51:24 +0100 | [diff] [blame] | 61 | image: {{ include "repositoryGenerator.image.busybox" . }} |
Dominic Lunanuova | de7a02b | 2020-03-12 16:36:09 +0000 | [diff] [blame] | 62 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Krzysztof Opasiak | c32ee22 | 2020-05-07 00:26:00 +0200 | [diff] [blame] | 63 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 8 }} |
Dominic Lunanuova | de7a02b | 2020-03-12 16:36:09 +0000 | [diff] [blame] | 64 | command: ["/bin/sh"] |
| 65 | args: [ "-c", "sed -i -e '/cadi_keystore_password=/d' -e '/cadi_keystore_password_jks/p' -e 's/cadi_keystore_password_jks/cadi_keystore_password/' -e 's/dmaap-bc.p12/dmaap-bc.jks/' /opt/app/osaaf/local/org.onap.dmaap-bc.cred.props" ] |
Andreas Geissler | 0d5c917 | 2022-04-19 18:10:52 +0200 | [diff] [blame^] | 66 | {{- end }} |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 67 | - name: {{ include "common.name" . }}-postgres-readiness |
rope252 | f2db5c1 | 2022-01-10 14:15:16 +0000 | [diff] [blame] | 68 | securityContext: |
| 69 | runAsUser: 100 |
| 70 | runAsGroup: 65533 |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 71 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 72 | - /app/ready.py |
dglFromAtt | fb58a9d | 2019-04-12 20:12:26 +0000 | [diff] [blame] | 73 | args: |
| 74 | - --container-name |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 75 | - {{ .Values.postgres.nameOverride }} |
efiacor | c75eacb | 2020-04-24 14:29:17 +0100 | [diff] [blame] | 76 | - --container-name |
| 77 | - message-router |
| 78 | - --container-name |
| 79 | - dmaap-dr-node |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 80 | env: |
| 81 | - name: NAMESPACE |
| 82 | valueFrom: |
| 83 | fieldRef: |
| 84 | apiVersion: v1 |
| 85 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 6b09654 | 2020-11-21 22:51:24 +0100 | [diff] [blame] | 86 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 87 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 88 | {{- end }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 89 | containers: |
| 90 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 6b09654 | 2020-11-21 22:51:24 +0100 | [diff] [blame] | 91 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 92 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 93 | ports: {{ include "common.containerPorts" . | nindent 10 }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 94 | {{ if eq .Values.liveness.enabled true -}} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 95 | livenessProbe: |
| 96 | httpGet: |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 97 | port: {{ .Values.liveness.port }} |
| 98 | path: /webapi/topics |
| 99 | scheme: {{ if (include "common.needTLS" .) }}HTTPS{{ else }}HTTP{{ end }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 100 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
dglFromAtt | ec0918d | 2018-10-17 19:34:49 +0000 | [diff] [blame] | 101 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 102 | {{ end -}} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 103 | readinessProbe: |
| 104 | httpGet: |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 105 | port: {{ .Values.readiness.port }} |
| 106 | path: /webapi/topics |
| 107 | scheme: {{ if (include "common.needTLS" .) }}HTTPS{{ else }}HTTP{{ end }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 108 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 109 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Krzysztof Opasiak | c32ee22 | 2020-05-07 00:26:00 +0200 | [diff] [blame] | 110 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 111 | - mountPath: /etc/localtime |
| 112 | name: localtime |
| 113 | readOnly: true |
dglFromAtt | ec0918d | 2018-10-17 19:34:49 +0000 | [diff] [blame] | 114 | # NOTE: on the following several configMaps, careful to include / at end |
| 115 | # since there may be more than one file in each mountPath |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 116 | - name: {{ include "common.name" . }}-config |
dglFromAtt | 8234007 | 2018-10-16 21:53:34 +0000 | [diff] [blame] | 117 | mountPath: /opt/app/config/conf/ |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 118 | resources: {{ include "common.resources" . | nindent 12 }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 119 | {{- if .Values.nodeSelector }} |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 120 | nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 121 | {{- end -}} |
| 122 | {{- if .Values.affinity }} |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 123 | affinity: {{ toYaml .Values.affinity | nindent 10 }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 124 | {{- end }} |
farida azmy | 13388ba | 2021-03-17 11:33:28 +0200 | [diff] [blame] | 125 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Krzysztof Opasiak | c32ee22 | 2020-05-07 00:26:00 +0200 | [diff] [blame] | 126 | volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 127 | - name: localtime |
| 128 | hostPath: |
| 129 | path: /etc/localtime |
Krzysztof Opasiak | 03a125a | 2020-05-05 02:11:09 +0200 | [diff] [blame] | 130 | - name: {{ include "common.name" . }}-config-input |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 131 | configMap: |
| 132 | name: {{ include "common.fullname" . }}-config |
Krzysztof Opasiak | 03a125a | 2020-05-05 02:11:09 +0200 | [diff] [blame] | 133 | - name: {{ include "common.name" . }}-config |
| 134 | emptyDir: |
| 135 | medium: Memory |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 136 | imagePullSecrets: |
| 137 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |