Skip to content

Commit 6358a8d

Browse files
committed
test: add deployment file for thumbnails service
1 parent d9668c0 commit 6358a8d

File tree

1 file changed

+127
-0
lines changed

1 file changed

+127
-0
lines changed
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
{{- include "ocis.basicServiceTemplates" (dict "scope" . "appName" "appNameThumbnails" "appNameSuffix" "") -}}
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
{{ include "ocis.metadata" . }}
5+
spec:
6+
{{- include "ocis.selector" . | nindent 2 }}
7+
{{- if and (not .Values.autoscaling.enabled) (.Values.replicas) }}
8+
replicas: {{ .Values.replicas }}
9+
{{- end }}
10+
{{- include "ocis.deploymentStrategy" . | nindent 2 }}
11+
template:
12+
{{- include "ocis.templateMetadata" (dict "scope" $ "configCheck" false) | nindent 4 }}
13+
spec:
14+
{{- include "ocis.affinity" $ | nindent 6 }}
15+
{{- include "ocis.securityContextAndtopologySpreadConstraints" . | nindent 6 }}
16+
{{- if and $.Values.services.thumbnails.persistence.enabled $.Values.services.thumbnails.persistence.chownInitContainer }}
17+
initContainers:
18+
- name: init-chown-data
19+
{{- include "ocis.initContainerImage" $ | nindent 10 }}
20+
securityContext:
21+
runAsNonRoot: false
22+
runAsUser: 0
23+
{{- include "ocis.initChownDataCommand" $ | nindent 10 }}
24+
volumeMounts:
25+
- name: {{ include "ocis.persistence.dataVolumeName" . }}
26+
mountPath: /var/lib/ocis
27+
{{ end }}
28+
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
29+
{{- include "ocis.hostAliases" $ | nindent 6 }}
30+
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
31+
containers:
32+
- name: {{ .appName }}
33+
{{- include "ocis.image" $ | nindent 10 }}
34+
command: ["ocis"]
35+
args: ["thumbnails", "server"]
36+
{{- include "ocis.containerSecurityContext" . | nindent 10 }}
37+
env:
38+
{{- include "ocis.serviceRegistry" . | nindent 12 }}
39+
{{- include "ocis.cors" . |nindent 12 }}
40+
41+
- name: THUMBNAILS_TXT_FONTMAP_FILE
42+
value: /etc/ocis/fontsMap.json
43+
44+
- name: THUMBNAILS_LOG_COLOR
45+
value: {{ .Values.logging.color | quote }}
46+
- name: THUMBNAILS_LOG_LEVEL
47+
value: {{ .Values.logging.level | quote }}
48+
- name: THUMBNAILS_LOG_PRETTY
49+
value: {{ .Values.logging.pretty | quote }}
50+
51+
- name: THUMBNAILS_TRACING_ENABLED
52+
value: "{{ .Values.tracing.enabled }}"
53+
- name: THUMBNAILS_TRACING_TYPE
54+
value: {{ .Values.tracing.type | quote }}
55+
- name: THUMBNAILS_TRACING_ENDPOINT
56+
value: {{ .Values.tracing.endpoint | quote }}
57+
- name: THUMBNAILS_TRACING_COLLECTOR
58+
value: {{ .Values.tracing.collector | quote }}
59+
60+
- name: THUMBNAILS_DEBUG_PPROF
61+
value: {{ .Values.debug.profiling | quote }}
62+
63+
- name: THUMBNAILS_GRPC_ADDR
64+
value: 0.0.0.0:9185
65+
- name: THUMBNAILS_HTTP_ADDR
66+
value: 0.0.0.0:9186
67+
- name: THUMBNAILS_DEBUG_ADDR
68+
value: 0.0.0.0:9189
69+
70+
- name: THUMBNAILS_DATA_ENDPOINT
71+
value: http://{{ .appName }}:9186/thumbnails/data
72+
73+
- name: THUMBNAILS_MAX_CONCURRENT_REQUESTS
74+
value: {{ .Values.services.thumbnails.quota.maxConcurrencyRequests | quote }}
75+
- name: THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE
76+
value: {{ .Values.services.thumbnails.quota.maxFileSize | quote }}
77+
- name: THUMBNAILS_MAX_INPUT_WIDTH
78+
value: {{ .Values.services.thumbnails.quota.maxInputWidth | quote }}
79+
- name: THUMBNAILS_MAX_INPUT_HEIGHT
80+
value: {{ .Values.services.thumbnails.quota.maxInputHeight | quote }}
81+
82+
- name: THUMBNAILS_WEBDAVSOURCE_INSECURE
83+
value: {{ .Values.insecure.ocisHttpApiInsecure | quote }}
84+
85+
- name: THUMBNAILS_CS3SOURCE_INSECURE
86+
value: {{ .Values.insecure.ocisHttpApiInsecure | quote }}
87+
88+
- name: THUMBNAILS_TRANSFER_TOKEN
89+
valueFrom:
90+
secretKeyRef:
91+
name: {{ include "secrets.thumbnailsSecret" . }}
92+
key: thumbnails-transfer-secret
93+
94+
{{- include "ocis.caEnv" $ | nindent 12}}
95+
96+
{{- include "ocis.livenessProbe" . | nindent 10 }}
97+
98+
resources: {{ toYaml .resources | nindent 12 }}
99+
100+
ports:
101+
- name: grpc
102+
containerPort: 9185
103+
- name: http
104+
containerPort: 9186
105+
- name: metrics-debug
106+
containerPort: 9189
107+
108+
volumeMounts:
109+
- name: {{ include "ocis.persistence.dataVolumeName" . }}
110+
mountPath: /var/lib/ocis
111+
- name: ocis-fonts-ttf
112+
mountPath: /etc/ocis/fonts
113+
- name: ocis-fonts-map
114+
mountPath: /etc/ocis/fontsMap.json
115+
subPath: fontsMap.json
116+
{{- include "ocis.caPath" $ | nindent 12}}
117+
118+
{{- include "ocis.imagePullSecrets" $ | nindent 6 }}
119+
volumes:
120+
- name: ocis-fonts-ttf
121+
configMap:
122+
name: ocis-fonts-ttf
123+
- name: ocis-fonts-map
124+
configMap:
125+
name: ocis-fonts-map
126+
{{- include "ocis.caVolume" $ | nindent 8}}
127+
{{- include "ocis.persistence.dataVolume" . | nindent 8 }}

0 commit comments

Comments
 (0)