ktimoney | b3aef7b | 2021-09-13 08:27:58 +0100 | [diff] [blame] | 1 | {{/* |
| 2 | # ============LICENSE_START======================================================= |
danielhanrahan | 8832664 | 2022-02-28 14:08:08 +0000 | [diff] [blame] | 3 | # Copyright (C) 2021-2022 Nordix Foundation. |
ktimoney | b3aef7b | 2021-09-13 08:27:58 +0100 | [diff] [blame] | 4 | # ================================================================================ |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | # |
| 17 | # SPDX-License-Identifier: Apache-2.0 |
| 18 | # ============LICENSE_END========================================================= |
| 19 | */}} |
| 20 | |
| 21 | apiVersion: apps/v1 |
| 22 | kind: Deployment |
Andreas Geissler | f10c555 | 2023-03-21 18:09:46 +0100 | [diff] [blame] | 23 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
ktimoney | b3aef7b | 2021-09-13 08:27:58 +0100 | [diff] [blame] | 24 | spec: |
Andreas Geissler | f10c555 | 2023-03-21 18:09:46 +0100 | [diff] [blame] | 25 | selector: {{- include "common.selectors" . | nindent 4 }} |
ktimoney | b3aef7b | 2021-09-13 08:27:58 +0100 | [diff] [blame] | 26 | replicas: {{ .Values.replicaCount }} |
ktimoney | b3aef7b | 2021-09-13 08:27:58 +0100 | [diff] [blame] | 27 | template: |
Andreas Geissler | f10c555 | 2023-03-21 18:09:46 +0100 | [diff] [blame] | 28 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
ktimoney | b3aef7b | 2021-09-13 08:27:58 +0100 | [diff] [blame] | 29 | spec: |
| 30 | initContainers: |
| 31 | - command: |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 32 | - sh |
| 33 | args: |
| 34 | - -c |
| 35 | - "cd /config-input && for PFILE in `ls -1`; do envsubst <${PFILE} >/config/${PFILE}; done" |
| 36 | env: |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 37 | - name: POLICY_LOGS |
| 38 | value: {{ .Values.log.path }} |
| 39 | volumeMounts: |
| 40 | - mountPath: /config-input |
| 41 | name: policy-gui-config |
| 42 | - mountPath: /config |
| 43 | name: policy-gui-config-processed |
| 44 | image: {{ include "repositoryGenerator.image.envsubst" . }} |
| 45 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 46 | name: {{ include "common.name" . }}-update-config |
| 47 | - command: |
ktimoney | b3aef7b | 2021-09-13 08:27:58 +0100 | [diff] [blame] | 48 | - /app/ready.py |
| 49 | args: |
| 50 | - --container-name |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 51 | - policy-clamp-runtime-acm |
ktimoney | b3aef7b | 2021-09-13 08:27:58 +0100 | [diff] [blame] | 52 | env: |
| 53 | - name: NAMESPACE |
| 54 | valueFrom: |
| 55 | fieldRef: |
| 56 | apiVersion: v1 |
| 57 | fieldPath: metadata.namespace |
| 58 | image: {{ include "repositoryGenerator.image.readiness" . }} |
| 59 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 60 | name: {{ include "common.name" . }}-readiness |
ktimoney | b3aef7b | 2021-09-13 08:27:58 +0100 | [diff] [blame] | 61 | containers: |
| 62 | # side car containers |
| 63 | {{ if .Values.global.centralizedLoggingEnabled }}{{ include "common.log.sidecar" . | nindent 8 }}{{ end }} |
| 64 | # main container |
| 65 | - name: {{ include "common.name" . }} |
| 66 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
| 67 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
danielhanrahan | 8832664 | 2022-02-28 14:08:08 +0000 | [diff] [blame] | 68 | command: ["/opt/app/policy/gui/bin/policy-gui.sh"] |
| 69 | env: |
danielhanrahan | 8832664 | 2022-02-28 14:08:08 +0000 | [diff] [blame] | 70 | - name: CLAMP_URL |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 71 | value: http://policy-clamp-runtime-acm:6969 |
Andreas Geissler | fc55fbf | 2023-07-19 14:48:39 +0200 | [diff] [blame] | 72 | ports: {{ include "common.containerPorts" . | nindent 12 }} |
ktimoney | b3aef7b | 2021-09-13 08:27:58 +0100 | [diff] [blame] | 73 | # disable liveness probe when breakpoints set in debugger |
| 74 | # so K8s doesn't restart unresponsive container |
| 75 | {{- if eq .Values.liveness.enabled true }} |
| 76 | livenessProbe: |
| 77 | tcpSocket: |
| 78 | port: {{ .Values.service.internalPort }} |
| 79 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 80 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 81 | {{ end -}} |
| 82 | readinessProbe: |
| 83 | tcpSocket: |
| 84 | port: {{ .Values.service.internalPort }} |
| 85 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 86 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Andreas Geissler | f10c555 | 2023-03-21 18:09:46 +0100 | [diff] [blame] | 87 | volumeMounts: |
ktimoney | b3aef7b | 2021-09-13 08:27:58 +0100 | [diff] [blame] | 88 | - name: logs |
| 89 | mountPath: {{ .Values.log.path }} |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 90 | - mountPath: /opt/app/policy/gui/etc/application.yml |
| 91 | name: policy-gui-config-processed |
| 92 | subPath: application.yml |
| 93 | - mountPath: /opt/app/policy/gui/etc/logback.xml |
| 94 | name: policy-gui-config-processed |
| 95 | subPath: logback.xml |
miroslavmasaryk | a7ac7f0 | 2023-03-01 14:12:26 +0100 | [diff] [blame] | 96 | resources: {{ include "common.resources" . | nindent 12 }} |
ktimoney | b3aef7b | 2021-09-13 08:27:58 +0100 | [diff] [blame] | 97 | {{- if .Values.nodeSelector }} |
| 98 | nodeSelector: |
| 99 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 100 | {{- end -}} |
| 101 | {{- if .Values.affinity }} |
| 102 | affinity: |
| 103 | {{ toYaml .Values.affinity | indent 10 }} |
| 104 | {{- end }} |
| 105 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Andreas Geissler | f10c555 | 2023-03-21 18:09:46 +0100 | [diff] [blame] | 106 | volumes: |
ktimoney | b3aef7b | 2021-09-13 08:27:58 +0100 | [diff] [blame] | 107 | - name: {{ include "common.fullname" . }}-config |
| 108 | configMap: |
| 109 | name: {{ include "common.fullname" . }} |
ktimoney | b3aef7b | 2021-09-13 08:27:58 +0100 | [diff] [blame] | 110 | - name: logs |
| 111 | emptyDir: {} |
| 112 | {{ if .Values.global.centralizedLoggingEnabled }}{{ include "common.log.volumes" . | nindent 8 }}{{ end }} |
amatthews | 736bf37 | 2021-12-14 16:04:15 +0000 | [diff] [blame] | 113 | - name: policy-gui-config |
| 114 | configMap: |
| 115 | name: {{ include "common.fullname" . }}-configmap |
| 116 | defaultMode: 0755 |
| 117 | - name: policy-gui-config-processed |
| 118 | emptyDir: |
| 119 | medium: Memory |
ktimoney | b3aef7b | 2021-09-13 08:27:58 +0100 | [diff] [blame] | 120 | imagePullSecrets: |
| 121 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |