/
deployment.yaml
132 lines (132 loc) · 5.28 KB
/
deployment.yaml
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
120
121
122
123
124
125
126
127
128
129
130
131
132
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "alfresco-share.fullname" . }}
labels:
{{- include "alfresco-share.labels" . | nindent 4 }}
annotations:
checkov.io/skip1: CKV_K8S_20=Requires APPS-1832
checkov.io/skip2: CKV_K8S_23=Requires APPS-1832
checkov.io/skip3: CKV_K8S_40=Requires APPS-1832
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "alfresco-share.selectorLabels" . | nindent 6 }}
strategy:
{{- toYaml (.Values.strategy | default .Values.global.strategy) | nindent 4 }}
template:
metadata:
annotations:
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "alfresco-share.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "alfresco-share.serviceAccountName" . }}
{{- include "component-pod-security-context" .Values | indent 4 }}
{{- include "alfresco-common.imagePullSecrets" . | indent 6 }}
containers:
- name: alfresco-share
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- include "alfresco-common.component-security-context" .Values | indent 8 }}
{{- if .Values.command }}
command:
{{- toYaml .Values.command | nindent 12 }}
args:
{{- toYaml .Values.args | nindent 12 }}
{{- end }}
ports:
- name: tomcat-shutdown
containerPort: 8005
protocol: TCP
- name: http
containerPort: {{ .Values.image.port }}
protocol: TCP
{{- if gt (int .Values.replicaCount) 1 }}
- name: hz
containerPort: {{ .Values.hazelcast.port }}
protocol: TCP
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- $repo_details_cm := coalesce .Values.repository.existingConfigMap.name (include "alfresco-share.fullname" .) }}
env:
- name: CSRF_FILTER_REFERER
value: {{ include "alfresco-common.csrf.referer" . }}
- name: CSRF_FILTER_ORIGIN
value: {{ include "alfresco-common.csrf.origin" . }}
- name: BASEURL
value: {{ include "alfresco-common.external.url" . }}
- name: JAVA_OPTS
value: >-
{{ (printf "%s %s" (.Values.environment.JAVA_OPTS | default "") "-Dalfresco.proxy=$BASEURL") }}
- name: REPO_HOST
valueFrom:
configMapKeyRef:
name: {{ $repo_details_cm }}
key: {{ .Values.repository.existingConfigMap.keys.host }}
- name: REPO_PORT
valueFrom:
configMapKeyRef:
name: {{ $repo_details_cm }}
key: {{ .Values.repository.existingConfigMap.keys.port }}
{{- range $key, $value := (omit .Values.environment "JAVA_OPTS") }}
- name: {{ $key }}
value: {{ $value }}
{{- end }}
volumeMounts:
{{- if and (gt (int .Values.replicaCount) 1) .Values.managedApplicationContext.enabled }}
- name: custom-application-context-volume
mountPath: /usr/local/tomcat/shared/classes/alfresco/web-extension/custom-slingshot-application-context.xml
subPath: custom-slingshot-application-context.xml
{{- end }}
{{- with .Values.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
readinessProbe:
httpGet:
path: /share
port: {{ .Values.image.port }}
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
livenessProbe:
httpGet:
path: /share
port: {{ .Values.image.port }}
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
{{- if .Values.extraSideContainers }}
{{- toYaml .Values.extraSideContainers | nindent 8 }}
{{- end }}
initContainers:
{{- toYaml .Values.extraInitContainers | nindent 8 }}
volumes:
{{- if and (gt (int .Values.replicaCount) 1) .Values.managedApplicationContext.enabled }}
- name: custom-application-context-volume
configMap:
name: {{ template "alfresco-share.custom-application-context.name" . }}
{{- end }}
{{- if .Values.extraVolumes }}
{{- toYaml .Values.extraVolumes | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}