Skip to content

Commit 81ba57b

Browse files
committed
chore(ai-worker): using nextcloud.volumeMounts for ai-worker deployment
Signed-off-by: Daniel Hendricken <[email protected]>
1 parent 2636c7e commit 81ba57b

File tree

3 files changed

+61
-63
lines changed

3 files changed

+61
-63
lines changed

charts/nextcloud/Chart.yaml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,21 @@ maintainers:
2626
url: https://wrenix.eu
2727
- name: jessebot
2828
url: https://jessebot.work
29-
dependencies:
30-
- name: postgresql
31-
version: 15.5.0
32-
repository: oci://registry-1.docker.io/bitnamicharts
33-
condition: postgresql.enabled
34-
- name: mariadb
35-
version: 18.2.0
36-
repository: oci://registry-1.docker.io/bitnamicharts
37-
condition: mariadb.enabled
38-
- name: redis
39-
version: 19.6.4
40-
repository: oci://registry-1.docker.io/bitnamicharts
41-
condition: redis.enabled
42-
- name: collabora-online
43-
version: 1.1.20
44-
repository: https://collaboraonline.github.io/online
45-
condition: collabora.enabled
46-
alias: collabora
29+
# dependencies:
30+
# - name: postgresql
31+
# version: 15.5.0
32+
# repository: oci://registry-1.docker.io/bitnamicharts
33+
# condition: postgresql.enabled
34+
# - name: mariadb
35+
# version: 18.2.0
36+
# repository: oci://registry-1.docker.io/bitnamicharts
37+
# condition: mariadb.enabled
38+
# - name: redis
39+
# version: 19.6.4
40+
# repository: oci://registry-1.docker.io/bitnamicharts
41+
# condition: redis.enabled
42+
# - name: collabora-online
43+
# version: 1.1.20
44+
# repository: https://collaboraonline.github.io/online
45+
# condition: collabora.enabled
46+
# alias: collabora

charts/nextcloud/templates/_helpers.tpl

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -397,38 +397,4 @@ Create volume mounts for the nextcloud container as well as the cron sidecar con
397397
mountPath: {{ $nginxEnabled | ternary (printf "/usr/local/etc/php-fpm.d/%s" $key | quote) (printf "/usr/local/etc/php/conf.d/%s" $key | quote) }}
398398
subPath: {{ $key }}
399399
{{- end }}
400-
{{- end -}}
401-
402-
403-
{{/*
404-
Create volume mounts for the nextcloud-aiworker container.
405-
*/}}
406-
{{- define "aiWorker.volumeMounts" -}}
407-
- name: nextcloud-main
408-
mountPath: /var/www/
409-
subPath: {{ ternary "root" (printf "%s/root" .Values.nextcloud.persistence.subPath) (empty .Values.nextcloud.persistence.subPath) }}
410-
- name: nextcloud-main
411-
mountPath: /var/www/html
412-
subPath: {{ ternary "html" (printf "%s/html" .Values.nextcloud.persistence.subPath) (empty .Values.nextcloud.persistence.subPath) }}
413-
{{- if and .Values.persistence.nextcloudData.enabled .Values.persistence.enabled }}
414-
- name: nextcloud-data
415-
mountPath: {{ .Values.nextcloud.datadir }}
416-
subPath: {{ ternary "data" (printf "%s/data" .Values.persistence.nextcloudData.subPath) (empty .Values.persistence.nextcloudData.subPath) }}
417-
{{- else }}
418-
- name: nextcloud-main
419-
mountPath: {{ .Values.nextcloud.datadir }}
420-
subPath: {{ ternary "data" (printf "%s/data" .Values.persistence.subPath) (empty .Values.persistence.subPath) }}
421-
{{- end }}
422-
- name: nextcloud-main
423-
mountPath: /var/www/html/config
424-
subPath: {{ ternary "config" (printf "%s/config" .Values.nextcloud.persistence.subPath) (empty .Values.nextcloud.persistence.subPath) }}
425-
- name: nextcloud-main
426-
mountPath: /var/www/html/custom_apps
427-
subPath: {{ ternary "custom_apps" (printf "%s/custom_apps" .Values.nextcloud.persistence.subPath) (empty .Values.nextcloud.persistence.subPath) }}
428-
- name: nextcloud-main
429-
mountPath: /var/www/tmp
430-
subPath: {{ ternary "tmp" (printf "%s/tmp" .Values.nextcloud.persistence.subPath) (empty .Values.nextcloud.persistence.subPath) }}
431-
- name: nextcloud-main
432-
mountPath: /var/www/html/themes
433-
subPath: {{ ternary "themes" (printf "%s/themes" .Values.nextcloud.persistence.subPath) (empty .Values.nextcloud.persistence.subPath) }}
434-
{{- end }}
400+
{{- end -}}

charts/nextcloud/templates/nextcloud-ai-worker.yaml

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ spec:
4848
podSecurityContext:
4949
{{- toYaml .Values.aiWorker.podSecurityContext | nindent 8 }}
5050
initContainers:
51-
- name: wait-for-service
52-
image: {{ .Values.aiWorker.image.repository }}:{{ .Values.aiWorker.image.tag }}
53-
command:
54-
- sh
55-
- -c
56-
- >-
57-
until curl -sf https://{{ if .Values.aiWorker.useHostName }}{{ .Values.nextcloud.host }}/status.php {{- else }} http://{{ template "nextcloud.fullname" . }}:{{ .Values.service.port }}/status.php;{{- end }}
58-
do echo waiting for service; sleep 5;
59-
done
51+
- name: wait-for-service
52+
image: {{ .Values.aiWorker.image.repository }}:{{ .Values.aiWorker.image.tag }}
53+
command:
54+
- sh
55+
- -c
56+
- >-
57+
until curl -sf {{- if .Values.aiWorker.useHostName }}https://{{ .Values.nextcloud.host }}/status.php{{- else }}http://{{ template "nextcloud.fullname" . }}:{{ .Values.service.port }}/status.php{{- end }};
58+
do echo waiting for service; sleep 5;
59+
done
6060
containers:
6161
- name: nextcloud-aiworker
6262
image: {{ include "nextcloud.image" . }}
@@ -69,7 +69,15 @@ spec:
6969
resources:
7070
{{- toYaml .Values.aiWorker.resources | nindent 12 }}
7171
volumeMounts:
72-
{{- include "aiWorker.volumeMounts" . | trim | nindent 12 }}
72+
{{- include "nextcloud.volumeMounts" . | trim | nindent 12 }}
73+
{{- range $hook, $shell := .Values.nextcloud.hooks }}
74+
{{- if $shell }}
75+
- name: nextcloud-hooks
76+
mountPath: /docker-entrypoint-hooks.d/{{ $hook }}/helm.sh
77+
subPath: {{ $hook }}.sh
78+
readOnly: true
79+
{{- end }}
80+
{{- end }}
7381
volumes:
7482
- name: nextcloud-main
7583
{{- if .Values.persistence.enabled }}
@@ -83,5 +91,29 @@ spec:
8391
persistentVolumeClaim:
8492
claimName: {{ if .Values.persistence.nextcloudData.existingClaim }}{{ .Values.persistence.nextcloudData.existingClaim }}{{- else }}{{ template "nextcloud.fullname" . }}-nextcloud-data{{- end }}
8593
{{- end }}
94+
{{- if .Values.nextcloud.configs }}
95+
- name: nextcloud-config
96+
configMap:
97+
name: {{ template "nextcloud.fullname" . }}-config
98+
{{- end }}
99+
{{- if .Values.nextcloud.phpConfigs }}
100+
- name: nextcloud-phpconfig
101+
configMap:
102+
name: {{ template "nextcloud.fullname" . }}-phpconfig
103+
{{- end }}
104+
{{- if .Values.nginx.enabled }}
105+
- name: nextcloud-nginx-config
106+
configMap:
107+
name: {{ template "nextcloud.fullname" . }}-nginxconfig
108+
{{- end }}
109+
{{- if not (values .Values.nextcloud.hooks | compact | empty) }}
110+
- name: nextcloud-hooks
111+
configMap:
112+
name: {{ template "nextcloud.fullname" . }}-hooks
113+
defaultMode: 0o755
114+
{{- end }}
115+
{{- with .Values.nextcloud.extraVolumes }}
116+
{{- toYaml . | nindent 8 }}
117+
{{- end }}
86118
restartPolicy: Always
87119
{{- end }}

0 commit comments

Comments
 (0)