Sylvain Desbureaux | 47eb4d2 | 2020-12-10 12:15:27 +0100 | [diff] [blame] | 1 | {{/* |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 2 | # Copyright (c) 2017 Amdocs, Bell Canada |
| 3 | # Modifications Copyright (c) 2018 AT&T |
| 4 | # Modifications Copyright (c) 2020 Nokia |
efiacor | d12c167 | 2023-03-23 12:10:50 +0000 | [diff] [blame] | 5 | # Modifications Copyright © 2023 Nordix Foundation |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 6 | # |
| 7 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | # you may not use this file except in compliance with the License. |
| 9 | # You may obtain a copy of the License at |
| 10 | # |
| 11 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | # |
| 13 | # Unless required by applicable law or agreed to in writing, software |
| 14 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | # See the License for the specific language governing permissions and |
| 17 | # limitations under the License. |
Sylvain Desbureaux | 47eb4d2 | 2020-12-10 12:15:27 +0100 | [diff] [blame] | 18 | */}} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 19 | |
| 20 | apiVersion: apps/v1 |
| 21 | kind: Deployment |
Andreas Geissler | 5846a6e | 2023-03-30 17:26:14 +0200 | [diff] [blame] | 22 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 23 | spec: |
Andreas Geissler | 5846a6e | 2023-03-30 17:26:14 +0200 | [diff] [blame] | 24 | selector: {{- include "common.selectors" . | nindent 4 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 25 | replicas: {{ .Values.replicaCount }} |
Rommel Pawar | 63db716 | 2022-11-16 10:11:24 -0800 | [diff] [blame] | 26 | strategy: |
| 27 | type: {{ .Values.updateStrategy.type }} |
| 28 | {{- if (eq "RollingUpdate" .Values.updateStrategy.type) }} |
| 29 | rollingUpdate: |
| 30 | maxUnavailable: {{ .Values.updateStrategy.maxUnavailable }} |
| 31 | maxSurge: {{ .Values.updateStrategy.maxSurge }} |
| 32 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 33 | template: |
Andreas Geissler | 5846a6e | 2023-03-30 17:26:14 +0200 | [diff] [blame] | 34 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 35 | spec: |
efiacor | d12c167 | 2023-03-23 12:10:50 +0000 | [diff] [blame] | 36 | initContainers: |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 37 | - command: |
| 38 | - /app/ready.py |
| 39 | args: |
| 40 | - --container-name |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 41 | - aai |
| 42 | env: |
| 43 | - name: NAMESPACE |
| 44 | valueFrom: |
| 45 | fieldRef: |
| 46 | apiVersion: v1 |
| 47 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 48 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 49 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 50 | name: {{ include "common.name" . }}-readiness |
Andreas Geissler | 4753743 | 2024-02-27 08:55:23 +0100 | [diff] [blame] | 51 | resources: |
| 52 | limits: |
| 53 | cpu: "100m" |
Andreas Geissler | 8cbb3d9 | 2024-03-12 16:44:56 +0100 | [diff] [blame] | 54 | memory: "500Mi" |
Andreas Geissler | 4753743 | 2024-02-27 08:55:23 +0100 | [diff] [blame] | 55 | requests: |
| 56 | cpu: "3m" |
Andreas Geissler | 8cbb3d9 | 2024-03-12 16:44:56 +0100 | [diff] [blame] | 57 | memory: "20Mi" |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 58 | containers: |
| 59 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 60 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 61 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 62 | command: |
| 63 | - sh |
| 64 | args: |
| 65 | - -c |
| 66 | - | |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 67 | echo "*** actual launch of AAI Sparky BE" |
| 68 | /opt/app/sparky/bin/start.sh |
efiacor | d12c167 | 2023-03-23 12:10:50 +0000 | [diff] [blame] | 69 | volumeMounts: |
Maciej Wereski | d523d12 | 2021-09-21 11:22:13 +0200 | [diff] [blame] | 70 | - mountPath: {{ .Values.log.path }} |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 71 | name: logs |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 72 | - mountPath: /opt/app/sparky/config/application.properties |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 73 | name: config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 74 | subPath: application.properties |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 75 | - mountPath: /opt/app/sparky/config/application-resources.properties |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 76 | name: config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 77 | subPath: application-resources.properties |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 78 | - mountPath: /opt/app/sparky/config/application-ssl.properties |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 79 | name: config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 80 | subPath: application-ssl.properties |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 81 | - mountPath: /opt/app/sparky/config/application-oxm-default.properties |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 82 | name: config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 83 | subPath: application-oxm-default.properties |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 84 | - mountPath: /opt/app/sparky/config/application-oxm-override.properties |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 85 | name: config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 86 | subPath: application-oxm-override.properties |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 87 | - mountPath: /opt/app/sparky/config/application-oxm-schema-prod.properties |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 88 | name: config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 89 | subPath: application-oxm-schema-prod.properties |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 90 | - mountPath: /opt/app/sparky/config/roles.config |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 91 | name: config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 92 | subPath: roles.config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 93 | - mountPath: /opt/app/sparky/config/users.config |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 94 | name: config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 95 | subPath: users.config |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 96 | - mountPath: /opt/app/sparky/config/logging/logback.xml |
| 97 | name: config |
| 98 | subPath: logback.xml |
Andreas Geissler | 5846a6e | 2023-03-30 17:26:14 +0200 | [diff] [blame] | 99 | ports: {{ include "common.containerPorts" . | nindent 10 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 100 | # disable liveness probe when breakpoints set in debugger |
| 101 | # so K8s doesn't restart unresponsive container |
| 102 | {{- if eq .Values.liveness.enabled true }} |
| 103 | livenessProbe: |
| 104 | tcpSocket: |
Andreas Geissler | 5846a6e | 2023-03-30 17:26:14 +0200 | [diff] [blame] | 105 | port: {{ .Values.service.internalPort }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 106 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 107 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 108 | {{ end -}} |
| 109 | readinessProbe: |
| 110 | tcpSocket: |
Andreas Geissler | 5846a6e | 2023-03-30 17:26:14 +0200 | [diff] [blame] | 111 | port: {{ .Values.service.internalPort }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 112 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 113 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
miroslavmasaryk | a7ac7f0 | 2023-03-01 14:12:26 +0100 | [diff] [blame] | 114 | resources: {{ include "common.resources" . | nindent 10 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 115 | {{- if .Values.nodeSelector }} |
| 116 | nodeSelector: |
| 117 | {{ toYaml .Values.nodeSelector | indent 8 }} |
| 118 | {{- end -}} |
| 119 | {{- if .Values.affinity }} |
| 120 | affinity: |
| 121 | {{ toYaml .Values.affinity | indent 8 }} |
| 122 | {{- end }} |
| 123 | |
| 124 | # side car containers |
Maciej Wereski | d523d12 | 2021-09-21 11:22:13 +0200 | [diff] [blame] | 125 | {{ include "common.log.sidecar" . | nindent 6 }} |
farida azmy | d893733 | 2021-03-09 12:20:42 +0200 | [diff] [blame] | 126 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
efiacor | d12c167 | 2023-03-23 12:10:50 +0000 | [diff] [blame] | 127 | volumes: |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 128 | - name: config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 129 | configMap: |
| 130 | name: {{ include "common.fullname" . }} |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 131 | - name: logs |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 132 | emptyDir: {} |
Maciej Wereski | d523d12 | 2021-09-21 11:22:13 +0200 | [diff] [blame] | 133 | {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 6 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 134 | - name: modeldir |
| 135 | emptyDir: {} |
| 136 | restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }} |
Andreas Geissler | bd0d31a | 2024-03-20 09:51:32 +0100 | [diff] [blame] | 137 | {{- include "common.imagePullSecrets" . | nindent 6 }} |