aboutsummaryrefslogtreecommitdiffstats
path: root/helm/ves-client/templates/deployment.yaml
blob: 090cee63698d4d9fd2ff68154c73b46e92470555 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "ves-client.fullname" . }}
  labels:
    {{- include "ves-client.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
  replicas: {{ .Values.replicaCount }}
{{- end }}
  selector:
    matchLabels:
      {{- include "ves-client.selectorLabels" . | nindent 6 }}
  template:
    metadata:
    {{- with .Values.podAnnotations }}
      annotations:
        {{- toYaml . | nindent 8 }}
    {{- end }}
      labels:
        {{- include "ves-client.selectorLabels" . | nindent 8 }}
    spec:
      {{- with .Values.imagePullSecrets }}
      imagePullSecrets:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      securityContext:
        {{- toYaml .Values.podSecurityContext | nindent 8 }}
      initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }}
        {{ if eq .Values.certMethod "aaf" }}
        - name: {{ include "common.name" . }}-readiness
          env:
          - name: NAMESPACE
            valueFrom:
              fieldRef:
                apiVersion: v1
                fieldPath: metadata.namespace
          image: {{ .Values.certInitializer.image }}
          imagePullPolicy: {{ .Values.pullPolicy | default .Values.pullPolicy }}
          volumeMounts:
            - name: {{ .Values.aafVolumeName }}
              mountPath: /opt/app/osaaf
        {{- end }}
      containers:
        - env: 
          - name: MONGO_HOSTNAME
            value: {{ .Values.config.mongoDbName | quote }}
          - name: USE_CERTIFICATE_FOR_AUTHORIZATION
            value: {{ .Values.config.useCerts | quote }}
          - name: STRICT_HOSTNAME_VERIFICATION
            value: {{ .Values.config.strictHost | quote }}
          name: {{ .Values.configMapName }}
          securityContext:
            {{- toYaml .Values.securityContext | nindent 12 }}
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          ports:
            - containerPort: {{ .Values.service.port }}
              protocol: TCP
          livenessProbe:
            httpGet:
              path: /simulator/config
              port: 5000
            initialDelaySeconds: 10
            periodSeconds: 30
            timeoutSeconds: 1
            successThreshold: 1 
            failureThreshold: 3
          readinessProbe:
            httpGet:
              path: /simulator/config
              port: 5000
            initialDelaySeconds: 60
            periodSeconds: 15
            timeoutSeconds: 1
            successThreshold: 1
            failureThreshold: 3
          resources:
            {{- toYaml .Values.resources | nindent 12 }}
          volumeMounts:
            - name: templates
              mountPath: {{ .Values.templatesDir }}
            {{ if eq .Values.certMethod "cmpv2" }}
            - name: certstore
              mountPath: {{ .Values.certsDir }}
            {{- end }}
            {{ if eq .Values.certMethod "aaf" }}
            - name: {{ .Values.aafVolumeName }}
              mountPath: /app/store
            {{- end }}
                                          
      volumes:
        - name: templates
          configMap:
            name: {{ .Values.configMapName }}
            defaultMode: 0755
        {{ if eq .Values.certMethod "cmpv2" }}
        - name: certstore
          secret:
            secretName: {{.Values.certificates.secretName}}
            defaultMode: 0400
        {{- end }}
        {{ if eq .Values.certMethod "aaf" }}
        {{ include "common.certInitializer.volumes" . | nindent 8 }}
        - name: {{ .Values.aafVolumeName }}
          emptyDir: {}
        {{- end }} 
      {{- with .Values.nodeSelector }}
      nodeSelector:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      {{- with .Values.affinity }}
      affinity:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      {{- with .Values.tolerations }}
      tolerations:
        {{- toYaml . | nindent 8 }}
      {{- end }}