Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 1 | {*/ |
| 2 | # Copyright © 2020 AT&T, Orange |
| 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. |
| 15 | */} |
| 16 | |
| 17 | {{- define "aaf.deployment" -}} |
| 18 | apiVersion: apps/v1 |
| 19 | kind: Deployment |
| 20 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
| 21 | spec: |
| 22 | selector: {{- include "common.selectors" . | nindent 4 }} |
| 23 | replicas: {{ .Values.replicaCount }} |
| 24 | template: |
| 25 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
| 26 | spec: {{ include "aaf.initContainers" . | nindent 6 }} |
| 27 | containers: |
| 28 | - name: {{ include "common.name" . }} |
| 29 | workingDir: /opt/app/aaf |
| 30 | command: ["bin/{{ .Values.binary }}"] |
Sylvain Desbureaux | 0dfa387 | 2020-11-21 21:29:17 +0100 | [diff] [blame] | 31 | image: {{ include "repositoryGenerator.repository" . }}/{{.Values.global.aaf.image}} |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 32 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 33 | ports: {{ include "common.containerPorts" . | nindent 10 }} |
| 34 | volumeMounts: |
| 35 | - mountPath: "/opt/app/osaaf" |
| 36 | name: aaf-config-vol |
| 37 | - mountPath: /etc/localtime |
| 38 | name: localtime |
| 39 | readOnly: true |
Sylvain Desbureaux | 9e2ca9d | 2021-01-11 08:15:10 +0000 | [diff] [blame] | 40 | - mountPath: /opt/app/osaaf/etc/org.osaaf.aaf.log4j.props |
| 41 | name: aaf-log |
| 42 | subPath: org.osaaf.aaf.log4j.props |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 43 | {{- if eq .Values.liveness.enabled true }} |
| 44 | livenessProbe: |
| 45 | tcpSocket: |
| 46 | port: {{.Values.liveness.port }} |
| 47 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 48 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 49 | {{ end -}} |
| 50 | readinessProbe: |
| 51 | tcpSocket: |
| 52 | port: {{ .Values.readiness.port }} |
| 53 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 54 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 55 | resources: {{ include "common.resources" . | nindent 12 }} |
| 56 | {{- if .Values.nodeSelector }} |
| 57 | nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }} |
| 58 | {{- end -}} |
| 59 | {{- if .Values.affinity }} |
| 60 | affinity: {{ toYaml .Values.affinity | nindent 10 }} |
| 61 | {{- end }} |
| 62 | volumes: |
| 63 | - name: localtime |
| 64 | hostPath: |
| 65 | path: /etc/localtime |
| 66 | - name: aaf-config-vol |
| 67 | emptyDir: {} |
Sylvain Desbureaux | 9e2ca9d | 2021-01-11 08:15:10 +0000 | [diff] [blame] | 68 | - name: aaf-log |
| 69 | configMap: |
| 70 | name: {{ include "common.release" . }}-aaf-log |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 71 | imagePullSecrets: |
| 72 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
| 73 | {{- end -}} |