Skip to content

Commit 8dbe1c0

Browse files
authored
Merge pull request opencloud-eu#50 from ferenc-hechler/feature/registry-split-11-38
feat: Add registry/repository split and global image overrides
2 parents 02bcc96 + 2bb522d commit 8dbe1c0

File tree

12 files changed

+174
-48
lines changed

12 files changed

+174
-48
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,24 @@ You can list available versions with:
158158
helm search repo oci://ghcr.io/opencloud-eu/helm-charts --versions
159159
```
160160

161+
## 🔒 Private Registry Support
162+
163+
The **production chart** (`charts/opencloud`) supports using private container registries for all images. This is useful for:
164+
- Air-gapped environments
165+
- Corporate registry mirrors
166+
- Pull-through caches
167+
168+
Simply use the global override:
169+
```bash
170+
helm install opencloud ./charts/opencloud \
171+
--set global.image.registry=my-registry.com \
172+
--set global.image.pullPolicy=Always
173+
```
174+
175+
See the [production chart documentation](./charts/opencloud/README.md#using-private-registries) for detailed configuration.
176+
177+
**Note:** This feature is currently only available in the production chart.
178+
161179
## Architecture
162180

163181
The production chart (`charts/opencloud`) deploys the following components:

charts/opencloud/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,25 @@ Key interactions:
191191

192192
The following table lists the configurable parameters of the OpenCloud chart and their default values.
193193

194+
### Using Private Registries
195+
196+
The chart supports using private container registries through global overrides. This is useful for:
197+
- Air-gapped environments
198+
- Corporate registry mirrors
199+
- Pull-through caches
200+
201+
To use a private registry for all images:
202+
203+
```bash
204+
helm install opencloud ./charts/opencloud \
205+
--set global.image.registry=my-registry.com \
206+
--set global.image.pullPolicy=Always
207+
```
208+
209+
This will prepend `my-registry.com/` to all image references in the chart. For example:
210+
- `keycloak/keycloak:26.1.4` becomes `my-registry.com/keycloak/keycloak:26.1.4`
211+
- `opencloudeu/opencloud-rolling:latest` becomes `my-registry.com/opencloudeu/opencloud-rolling:latest`
212+
194213
### Global Settings
195214

196215
| Parameter | Description | Default |
@@ -205,11 +224,14 @@ The following table lists the configurable parameters of the OpenCloud chart and
205224
| `global.tls.enabled` | Enable TLS (set to false when using gateway TLS termination externally) | `false` |
206225
| `global.tls.secretName` | secretName for TLS certificate | `""` |
207226
| `global.storage.storageClass` | Storage class for persistent volumes | `""` |
227+
| `global.image.registry` | Global registry override for all images (e.g., `my-registry.com`) | `""` |
228+
| `global.image.pullPolicy` | Global pull policy override for all images (`Always`, `IfNotPresent`, `Never`) | `""` |
208229

209230
### Image Settings
210231

211232
| Parameter | Description | Default |
212233
| --------- | ----------- | ------- |
234+
| `image.registry` | OpenCloud image registry | `docker.io` |
213235
| `image.repository` | OpenCloud image repository | `opencloudeu/opencloud-rolling` |
214236
| `image.tag` | OpenCloud image tag | `latest` |
215237
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |

charts/opencloud/templates/_helpers/tpl.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,32 @@ Create a fully qualified Tika name.
148148

149149
{{/* namespace helper removed - use .Release.Namespace directly */}}
150150

151+
{{/*
152+
Return the image registry, using global override if set
153+
*/}}
154+
{{- define "opencloud.image.registry" -}}
155+
{{- coalesce .global.image.registry .registry -}}
156+
{{- end -}}
157+
158+
{{/*
159+
Return the image pull policy, using global override if set
160+
*/}}
161+
{{- define "opencloud.image.pullPolicy" -}}
162+
{{- coalesce .global.image.pullPolicy .pullPolicy -}}
163+
{{- end -}}
164+
165+
{{/*
166+
Return the full image name with registry
167+
*/}}
168+
{{- define "opencloud.image" -}}
169+
{{- $registry := include "opencloud.image.registry" (dict "registry" .imageValues.registry "global" .global) -}}
170+
{{- if $registry -}}
171+
{{- printf "%s/%s:%s" $registry .imageValues.repository .imageValues.tag -}}
172+
{{- else -}}
173+
{{- printf "%s:%s" .imageValues.repository .imageValues.tag -}}
174+
{{- end -}}
175+
{{- end -}}
176+
151177
{{/*
152178
Return the appropriate apiVersion for ingress
153179
*/}}

charts/opencloud/templates/collabora/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ spec:
2020
spec:
2121
containers:
2222
- name: collabora
23-
image: {{ .Values.collabora.image.repository }}:{{ .Values.collabora.image.tag }}
24-
imagePullPolicy: {{ .Values.collabora.image.pullPolicy | default "IfNotPresent" }}
23+
image: {{ include "opencloud.image" (dict "imageValues" .Values.collabora.image "global" .Values.global) | quote }}
24+
imagePullPolicy: {{ include "opencloud.image.pullPolicy" (dict "pullPolicy" .Values.collabora.image.pullPolicy "global" .Values.global) }}
2525
command: ['/bin/bash', '-c']
2626
args:
2727
- 'coolconfig generate-proof-key && /start-collabora-online.sh'

charts/opencloud/templates/collaboration/deployment.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,15 @@ spec:
2626
initContainers:
2727
# Wait for OpenCloud to be ready
2828
- name: wait-for-opencloud
29-
image: busybox
29+
image: {{ include "opencloud.image" (dict "imageValues" .Values.busybox.image "global" .Values.global) | quote }}
30+
imagePullPolicy: {{ include "opencloud.image.pullPolicy" (dict "pullPolicy" .Values.busybox.image.pullPolicy "global" .Values.global) | quote }}
3031
command: ['sh', '-c', 'until wget -q -O- http://{{ include "opencloud.opencloud.fullname" . }}:9200/health; do echo waiting for opencloud; sleep 5; done;']
3132

3233
{{- if not .Values.opencloud.persistence.enabled }}
3334
# Copy config from OpenCloud API if persistence is disabled
3435
- name: copy-config
35-
image: busybox
36+
image: {{ include "opencloud.image" (dict "imageValues" .Values.busybox.image "global" .Values.global) | quote }}
37+
imagePullPolicy: {{ include "opencloud.image.pullPolicy" (dict "pullPolicy" .Values.busybox.image.pullPolicy "global" .Values.global) | quote }}
3638
command: ['sh', '-c', 'mkdir -p /etc/opencloud && wget -q -O /etc/opencloud/config.json http://{{ include "opencloud.opencloud.fullname" . }}:9200/api/v1/config/secrets || echo "Failed to get config from OpenCloud"']
3739
volumeMounts:
3840
- name: etc-opencloud
@@ -42,19 +44,21 @@ spec:
4244
{{- if .Values.onlyoffice.enabled }}
4345
# Wait for OnlyOffice to be ready
4446
- name: wait-for-onlyoffice
45-
image: busybox
47+
image: {{ include "opencloud.image" (dict "imageValues" .Values.busybox.image "global" .Values.global) | quote }}
48+
imagePullPolicy: {{ include "opencloud.image.pullPolicy" (dict "pullPolicy" .Values.busybox.image.pullPolicy "global" .Values.global) | quote }}
4649
command: ['sh', '-c', 'until wget -q -O- http://{{ include "opencloud.fullname" . }}-onlyoffice:80/hosting/discovery; do echo waiting for onlyoffice; sleep 2; done;']
4750
{{- end }}
4851
{{- if .Values.collabora.enabled }}
4952
# Wait for Collabora to be ready
5053
- name: wait-for-collabora
51-
image: busybox
54+
image: {{ include "opencloud.image" (dict "imageValues" .Values.busybox.image "global" .Values.global) | quote }}
55+
imagePullPolicy: {{ include "opencloud.image.pullPolicy" (dict "pullPolicy" .Values.busybox.image.pullPolicy "global" .Values.global) | quote }}
5256
command: ['sh', '-c', 'until wget -q -O- http://{{ include "opencloud.fullname" . }}-collabora:9980/hosting/discovery; do echo waiting for collabora; sleep 2; done;']
5357
{{- end }}
5458
containers:
5559
- name: collaboration
56-
image: {{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}
57-
imagePullPolicy: {{ .Values.image.pullPolicy }}
60+
image: {{ include "opencloud.image" (dict "imageValues" .Values.image "global" .Values.global) | quote }}
61+
imagePullPolicy: {{ include "opencloud.image.pullPolicy" (dict "pullPolicy" .Values.image.pullPolicy "global" .Values.global) }}
5862
command: ["/bin/sh"]
5963
args: ["-c", "opencloud collaboration server"]
6064
env:

charts/opencloud/templates/keycloak/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ spec:
2424
fsGroup: 1000
2525
containers:
2626
- name: keycloak
27-
image: {{ .Values.keycloak.image.repository }}:{{ .Values.keycloak.image.tag }}
28-
imagePullPolicy: {{ .Values.keycloak.image.pullPolicy }}
27+
image: {{ include "opencloud.image" (dict "imageValues" .Values.keycloak.image "global" .Values.global) | quote }}
28+
imagePullPolicy: {{ include "opencloud.image.pullPolicy" (dict "pullPolicy" .Values.keycloak.image.pullPolicy "global" .Values.global) }}
2929
securityContext:
3030
allowPrivilegeEscalation: false
3131
capabilities:

charts/opencloud/templates/minio/deployment.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ spec:
2424
fsGroup: 1000
2525
initContainers:
2626
- name: init-minio-bucket
27-
image: busybox
27+
image: {{ include "opencloud.image" (dict "imageValues" .Values.busybox.image "global" .Values.global) | quote }}
28+
imagePullPolicy: {{ include "opencloud.image.pullPolicy" (dict "pullPolicy" .Values.busybox.image.pullPolicy "global" .Values.global) | quote }}
2829
securityContext:
2930
runAsUser: 1000
3031
runAsGroup: 1000
@@ -37,7 +38,8 @@ spec:
3738
mountPath: /data
3839
containers:
3940
- name: minio
40-
image: minio/minio:latest
41+
image: {{ include "opencloud.image" (dict "imageValues" .Values.opencloud.storage.s3.internal.image "global" .Values.global) | quote }}
42+
imagePullPolicy: {{ include "opencloud.image.pullPolicy" (dict "pullPolicy" .Values.opencloud.storage.s3.internal.image.pullPolicy "global" .Values.global) }}
4143
securityContext:
4244
runAsUser: 1000
4345
runAsGroup: 1000

charts/opencloud/templates/onlyoffice/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ spec:
2020
spec:
2121
containers:
2222
- name: onlyoffice
23-
image: {{ .Values.onlyoffice.repository }}:{{ .Values.onlyoffice.tag | default "8.2.2" }}
24-
imagePullPolicy: {{ .Values.onlyoffice.pullPolicy | default "IfNotPresent" }}
23+
image: {{ include "opencloud.image" (dict "imageValues" .Values.onlyoffice.image "global" .Values.global) | quote }}
24+
imagePullPolicy: {{ include "opencloud.image.pullPolicy" (dict "pullPolicy" .Values.onlyoffice.image.pullPolicy "global" .Values.global) }}
2525
command: ["/bin/sh", "/entrypoint-override.sh"]
2626
env:
2727
- name: WOPI_ENABLED

charts/opencloud/templates/opencloud/deployment.yaml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ spec:
3939
fsGroup: 1000
4040
initContainers:
4141
- name: init-config
42-
image: busybox
42+
image: {{ include "opencloud.image" (dict "imageValues" .Values.busybox.image "global" .Values.global) | quote }}
43+
imagePullPolicy: {{ include "opencloud.image.pullPolicy" (dict "pullPolicy" .Values.busybox.image.pullPolicy "global" .Values.global) | quote }}
4344
command: ['sh', '-c', 'mkdir -p /etc/opencloud /var/lib/opencloud']
4445
volumeMounts:
4546
- name: config
@@ -50,55 +51,56 @@ spec:
5051
# Web extensions init containers
5152
{{- if .Values.webExtensions.extensions.drawio.enabled }}
5253
- name: init-drawio
53-
image: {{ .Values.webExtensions.extensions.drawio.repository }}:{{ .Values.webExtensions.extensions.drawio.tag }}
54+
image: {{ include "opencloud.image" (dict "imageValues" (merge (dict "tag" .Values.webExtensions.extensions.drawio.tag) .Values.webExtensions.image) "global" .Values.global) | quote }}
5455
command: ['sh', '-c', 'mkdir -p /extensions/draw-io && cp -R /usr/share/nginx/html/draw-io/ /extensions/']
5556
volumeMounts:
5657
- name: extensions
5758
mountPath: /extensions
5859
{{- end }}
5960
{{- if .Values.webExtensions.extensions.externalsites.enabled }}
6061
- name: init-externalsites
61-
image: {{ .Values.webExtensions.extensions.externalsites.repository }}:{{ .Values.webExtensions.extensions.externalsites.tag }}
62+
image: {{ include "opencloud.image" (dict "imageValues" (merge (dict "tag" .Values.webExtensions.extensions.externalsites.tag) .Values.webExtensions.image) "global" .Values.global) | quote }}
6263
command: ['sh', '-c', 'mkdir -p /extensions/external-sites && cp -R /usr/share/nginx/html/external-sites/ /extensions/']
6364
volumeMounts:
6465
- name: extensions
6566
mountPath: /extensions
6667
{{- end }}
6768
{{- if .Values.webExtensions.extensions.importer.enabled }}
6869
- name: init-importer
69-
image: {{ .Values.webExtensions.extensions.importer.repository }}:{{ .Values.webExtensions.extensions.importer.tag }}
70+
image: {{ include "opencloud.image" (dict "imageValues" (merge (dict "tag" .Values.webExtensions.extensions.importer.tag) .Values.webExtensions.image) "global" .Values.global) | quote }}
7071
command: ['sh', '-c', 'mkdir -p /extensions/importer && cp -R /usr/share/nginx/html/importer/ /extensions/']
7172
volumeMounts:
7273
- name: extensions
7374
mountPath: /extensions
7475
{{- end }}
7576
{{- if .Values.webExtensions.extensions.jsonviewer.enabled }}
7677
- name: init-jsonviewer
77-
image: {{ .Values.webExtensions.extensions.jsonviewer.repository }}:{{ .Values.webExtensions.extensions.jsonviewer.tag }}
78+
image: {{ include "opencloud.image" (dict "imageValues" (merge (dict "tag" .Values.webExtensions.extensions.jsonviewer.tag) .Values.webExtensions.image) "global" .Values.global) | quote }}
7879
command: ['sh', '-c', 'mkdir -p /extensions/json-viewer && cp -R /usr/share/nginx/html/json-viewer/ /extensions/']
7980
volumeMounts:
8081
- name: extensions
8182
mountPath: /extensions
8283
{{- end }}
8384
{{- if .Values.webExtensions.extensions.progressbars.enabled }}
8485
- name: init-progressbars
85-
image: {{ .Values.webExtensions.extensions.progressbars.repository }}:{{ .Values.webExtensions.extensions.progressbars.tag }}
86+
image: {{ include "opencloud.image" (dict "imageValues" (merge (dict "tag" .Values.webExtensions.extensions.progressbars.tag) .Values.webExtensions.image) "global" .Values.global) | quote }}
8687
command: ['sh', '-c', 'mkdir -p /extensions/progress-bars && cp -R /usr/share/nginx/html/progress-bars/ /extensions/']
8788
volumeMounts:
8889
- name: extensions
8990
mountPath: /extensions
9091
{{- end }}
9192
{{- if .Values.webExtensions.extensions.unzip.enabled }}
9293
- name: init-unzip
93-
image: {{ .Values.webExtensions.extensions.unzip.repository }}:{{ .Values.webExtensions.extensions.unzip.tag }}
94+
image: {{ include "opencloud.image" (dict "imageValues" (merge (dict "tag" .Values.webExtensions.extensions.unzip.tag) .Values.webExtensions.image) "global" .Values.global) | quote }}
9495
command: ['sh', '-c', 'mkdir -p /extensions/unzip && cp -R /usr/share/nginx/html/unzip/ /extensions/']
9596
volumeMounts:
9697
- name: extensions
9798
mountPath: /extensions
9899
{{- end }}
99100
# Final init container to copy all extensions to the apps directory
100101
- name: init-web-extensions
101-
image: busybox
102+
image: {{ include "opencloud.image" (dict "imageValues" .Values.busybox.image "global" .Values.global) | quote }}
103+
imagePullPolicy: {{ include "opencloud.image.pullPolicy" (dict "pullPolicy" .Values.busybox.image.pullPolicy "global" .Values.global) | quote }}
102104
command: ['sh', '/scripts/init-web-extensions.sh']
103105
volumeMounts:
104106
- name: extensions
@@ -110,7 +112,7 @@ spec:
110112
{{- end }}
111113
containers:
112114
- name: opencloud
113-
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
115+
image: {{ include "opencloud.image" (dict "imageValues" .Values.image "global" .Values.global) | quote }}
114116
securityContext:
115117
allowPrivilegeEscalation: false
116118
capabilities:
@@ -119,7 +121,7 @@ spec:
119121
runAsNonRoot: true
120122
seccompProfile:
121123
type: RuntimeDefault
122-
imagePullPolicy: {{ .Values.image.pullPolicy }}
124+
imagePullPolicy: {{ include "opencloud.image.pullPolicy" (dict "pullPolicy" .Values.image.pullPolicy "global" .Values.global) }}
123125
command: ["/bin/sh"]
124126
args: ["-c", "opencloud init || true; opencloud server"]
125127
{{- with .Values.opencloud.envFrom }}

charts/opencloud/templates/postgres/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ spec:
2424
fsGroup: 999 # Default PostgreSQL group ID
2525
containers:
2626
- name: postgres
27-
image: {{ .Values.postgres.image.repository }}:{{ .Values.postgres.image.tag }}
28-
imagePullPolicy: {{ .Values.postgres.image.pullPolicy }}
27+
image: {{ include "opencloud.image" (dict "imageValues" .Values.postgres.image "global" .Values.global) | quote }}
28+
imagePullPolicy: {{ include "opencloud.image.pullPolicy" (dict "pullPolicy" .Values.postgres.image.pullPolicy "global" .Values.global) }}
2929
env:
3030
- name: POSTGRES_DB
3131
value: {{ .Values.postgres.database | quote }}

0 commit comments

Comments
 (0)