blob: c0614b255eff4b8fe6644b6e624e9758b6550919 [file] [log] [blame]
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +02001{*/
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" -}}
18apiVersion: apps/v1
19kind: Deployment
20metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
21spec:
22 selector: {{- include "common.selectors" . | nindent 4 }}
23 replicas: {{ .Values.replicaCount }}
24 template:
25 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
Andreas Geissler6a5cefa2022-04-29 09:22:02 +020026 {{- if (include "common.onServiceMesh" .) }}
27 annotations:
28 sidecar.istio.io/inject: "false"
29 {{- end }}
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020030 spec: {{ include "aaf.initContainers" . | nindent 6 }}
31 containers:
32 - name: {{ include "common.name" . }}
33 workingDir: /opt/app/aaf
34 command: ["bin/{{ .Values.binary }}"]
Sylvain Desbureaux0dfa3872020-11-21 21:29:17 +010035 image: {{ include "repositoryGenerator.repository" . }}/{{.Values.global.aaf.image}}
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020036 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
37 ports: {{ include "common.containerPorts" . | nindent 10 }}
38 volumeMounts:
39 - mountPath: "/opt/app/osaaf"
40 name: aaf-config-vol
41 - mountPath: /etc/localtime
42 name: localtime
43 readOnly: true
Sylvain Desbureaux9e2ca9d2021-01-11 08:15:10 +000044 - mountPath: /opt/app/osaaf/etc/org.osaaf.aaf.log4j.props
45 name: aaf-log
46 subPath: org.osaaf.aaf.log4j.props
Sylvain Desbureauxef766402021-02-11 18:12:46 +010047 - mountPath: /opt/app/osaaf/data/
48 name: config-identity
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020049 {{- if eq .Values.liveness.enabled true }}
50 livenessProbe:
51 tcpSocket:
52 port: {{.Values.liveness.port }}
53 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
54 periodSeconds: {{ .Values.liveness.periodSeconds }}
55 {{ end -}}
56 readinessProbe:
57 tcpSocket:
58 port: {{ .Values.readiness.port }}
59 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
60 periodSeconds: {{ .Values.readiness.periodSeconds }}
61 resources: {{ include "common.resources" . | nindent 12 }}
62 {{- if .Values.nodeSelector }}
63 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }}
64 {{- end -}}
65 {{- if .Values.affinity }}
66 affinity: {{ toYaml .Values.affinity | nindent 10 }}
67 {{- end }}
68 volumes:
69 - name: localtime
70 hostPath:
71 path: /etc/localtime
72 - name: aaf-config-vol
73 emptyDir: {}
Sylvain Desbureaux9e2ca9d2021-01-11 08:15:10 +000074 - name: aaf-log
75 configMap:
76 name: {{ include "common.release" . }}-aaf-log
Sylvain Desbureauxef766402021-02-11 18:12:46 +010077 - name: config-init-identity
78 configMap:
79 name: {{ include "common.release" . }}-aaf-identity
80 - name: config-identity
81 emptyDir: {}
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020082 imagePullSecrets:
83 - name: "{{ include "common.namespace" . }}-docker-registry-key"
84{{- end -}}