rameshiyer27 | 01b8cc0 | 2021-09-21 15:07:50 +0100 | [diff] [blame] | 1 | {{/* |
| 2 | # ============LICENSE_START======================================================= |
efiacor | 6910bbe | 2023-03-03 14:53:16 +0000 | [diff] [blame] | 3 | # Copyright (C) 2021-2023 Nordix Foundation. |
Andreas Geissler | 5768113 | 2024-07-29 10:18:26 +0200 | [diff] [blame^] | 4 | # Modifications Copyright © 2024 Deutsche Telekom |
rameshiyer27 | 01b8cc0 | 2021-09-21 15:07:50 +0100 | [diff] [blame] | 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 | # |
| 18 | # SPDX-License-Identifier: Apache-2.0 |
| 19 | # ============LICENSE_END========================================================= |
| 20 | */}} |
| 21 | |
| 22 | apiVersion: apps/v1 |
| 23 | kind: Deployment |
| 24 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
| 25 | spec: |
| 26 | selector: {{- include "common.selectors" . | nindent 4 }} |
| 27 | replicas: {{ .Values.replicaCount }} |
| 28 | template: |
| 29 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
| 30 | spec: |
Andreas Geissler | 5768113 | 2024-07-29 10:18:26 +0200 | [diff] [blame^] | 31 | {{ include "common.podSecurityContext" . | indent 6 | trim }} |
rameshiyer27 | 01b8cc0 | 2021-09-21 15:07:50 +0100 | [diff] [blame] | 32 | initContainers: |
| 33 | - command: |
| 34 | - sh |
| 35 | args: |
| 36 | - -c |
| 37 | - "cd /config-input && for PFILE in `ls -1`; do envsubst <${PFILE} >/config/${PFILE}; done" |
| 38 | env: |
| 39 | - name: RESTSERVER_USER |
| 40 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-secret" "key" "login") | indent 10 }} |
| 41 | - name: RESTSERVER_PASSWORD |
| 42 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-secret" "key" "password") | indent 10 }} |
efiacor | 6910bbe | 2023-03-03 14:53:16 +0000 | [diff] [blame] | 43 | - name: SASL_JAAS_CONFIG |
| 44 | valueFrom: |
| 45 | secretKeyRef: |
| 46 | name: {{ include "common.name" . }}-ku |
| 47 | key: sasl.jaas.config |
rameshiyer27 | 01b8cc0 | 2021-09-21 15:07:50 +0100 | [diff] [blame] | 48 | volumeMounts: |
| 49 | - mountPath: /config-input |
FrancescoFioraEst | 9c79e26 | 2022-02-22 13:12:19 +0000 | [diff] [blame] | 50 | name: ac-k8s-ppnt-config |
rameshiyer27 | 01b8cc0 | 2021-09-21 15:07:50 +0100 | [diff] [blame] | 51 | - mountPath: /config |
FrancescoFioraEst | 9c79e26 | 2022-02-22 13:12:19 +0000 | [diff] [blame] | 52 | name: ac-k8s-ppnt-config-processed |
rameshiyer27 | 01b8cc0 | 2021-09-21 15:07:50 +0100 | [diff] [blame] | 53 | image: {{ include "repositoryGenerator.image.envsubst" . }} |
| 54 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Andreas Geissler | 5768113 | 2024-07-29 10:18:26 +0200 | [diff] [blame^] | 55 | {{ include "common.containerSecurityContext" . | indent 8 | trim }} |
rameshiyer27 | 01b8cc0 | 2021-09-21 15:07:50 +0100 | [diff] [blame] | 56 | name: {{ include "common.name" . }}-update-config |
rameshiyer27 | 01b8cc0 | 2021-09-21 15:07:50 +0100 | [diff] [blame] | 57 | containers: |
| 58 | - name: {{ include "common.name" . }} |
Andreas Geissler | 5768113 | 2024-07-29 10:18:26 +0200 | [diff] [blame^] | 59 | {{ include "common.containerSecurityContext" . | indent 10 | trim }} |
rameshiyer27 | 01b8cc0 | 2021-09-21 15:07:50 +0100 | [diff] [blame] | 60 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
| 61 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
rameshiyer27 | 01b8cc0 | 2021-09-21 15:07:50 +0100 | [diff] [blame] | 62 | command: ["/opt/app/policy/clamp/bin/kubernetes-participant.sh"] |
| 63 | args: ["/opt/app/policy/clamp/etc/mounted/KubernetesParticipantParameters.yaml"] |
rameshiyer27 | 01b8cc0 | 2021-09-21 15:07:50 +0100 | [diff] [blame] | 64 | ports: {{ include "common.containerPorts" . | nindent 12 }} |
| 65 | # disable liveness probe when breakpoints set in debugger |
| 66 | # so K8s doesn't restart unresponsive container |
| 67 | {{- if eq .Values.liveness.enabled true }} |
| 68 | livenessProbe: |
| 69 | tcpSocket: |
| 70 | port: {{ .Values.liveness.port }} |
| 71 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 72 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 73 | {{ end -}} |
| 74 | readinessProbe: |
| 75 | tcpSocket: |
| 76 | port: {{ .Values.readiness.port }} |
| 77 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 78 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 79 | volumeMounts: |
rameshiyer27 | 01b8cc0 | 2021-09-21 15:07:50 +0100 | [diff] [blame] | 80 | - mountPath: /opt/app/policy/clamp/etc/mounted |
FrancescoFioraEst | 9c79e26 | 2022-02-22 13:12:19 +0000 | [diff] [blame] | 81 | name: ac-k8s-ppnt-config-processed |
Andreas Geissler | 5768113 | 2024-07-29 10:18:26 +0200 | [diff] [blame^] | 82 | - name: logs |
| 83 | mountPath: /var/log/onap |
| 84 | - name: empty-dir |
| 85 | mountPath: /tmp |
| 86 | subPath: tmp-dir |
| 87 | - mountPath: /opt/app/policy/clamp/etc/logback.xml |
| 88 | subPath: logback.xml |
| 89 | name: ac-k8s-ppnt-config-processed |
miroslavmasaryk | a7ac7f0 | 2023-03-01 14:12:26 +0100 | [diff] [blame] | 90 | resources: {{ include "common.resources" . | nindent 12 }} |
rameshiyer27 | 01b8cc0 | 2021-09-21 15:07:50 +0100 | [diff] [blame] | 91 | {{- if .Values.nodeSelector }} |
| 92 | nodeSelector: |
| 93 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 94 | {{- end -}} |
| 95 | {{- if .Values.affinity }} |
| 96 | affinity: |
| 97 | {{ toYaml .Values.affinity | indent 10 }} |
| 98 | {{- end }} |
| 99 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "create" "dot" . )}} |
| 100 | volumes: |
FrancescoFioraEst | 9c79e26 | 2022-02-22 13:12:19 +0000 | [diff] [blame] | 101 | - name: ac-k8s-ppnt-config |
rameshiyer27 | 01b8cc0 | 2021-09-21 15:07:50 +0100 | [diff] [blame] | 102 | configMap: |
| 103 | name: {{ include "common.fullname" . }}-configmap |
| 104 | defaultMode: 0755 |
FrancescoFioraEst | 9c79e26 | 2022-02-22 13:12:19 +0000 | [diff] [blame] | 105 | - name: ac-k8s-ppnt-config-processed |
rameshiyer27 | 01b8cc0 | 2021-09-21 15:07:50 +0100 | [diff] [blame] | 106 | emptyDir: |
| 107 | medium: Memory |
Andreas Geissler | 5768113 | 2024-07-29 10:18:26 +0200 | [diff] [blame^] | 108 | sizeLimit: 64Mi |
| 109 | - name: empty-dir |
| 110 | emptyDir: |
| 111 | sizeLimit: {{ .Values.dirSizes.emptyDir.sizeLimit }} |
| 112 | - name: logs |
| 113 | emptyDir: |
| 114 | sizeLimit: {{ .Values.dirSizes.logDir.sizeLimit }} |
Andreas Geissler | bd0d31a | 2024-03-20 09:51:32 +0100 | [diff] [blame] | 115 | {{- include "common.imagePullSecrets" . | nindent 6 }} |