Skip to content

Commit e40ba3d

Browse files
authored
Merge pull request opencloud-eu#2 from suse-coder/main
Initial Release
2 parents 612cef3 + dbefd6d commit e40ba3d

40 files changed

+5402
-1
lines changed

Chart.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: v2
2+
name: opencloud
3+
description: OpenCloud Helm community chart
4+
keywords:
5+
- opencloud
6+
- owncloud
7+
- ocis
8+
maintainers:
9+
- name: OpenCloud EU
10+
11+
url: https://opencloud.eu
12+
type: application
13+
version: 0.1.0
14+
# renovate: datasource=docker depName=opencloudeu/opencloud-rolling
15+
appVersion: latest
16+
kubeVersion: ""
17+
sources:
18+
- https://github.com/opencloud-eu/opencloud
19+
- https://github.com/owncloud/ocis
20+
- https://github.com/cs3org/reva

README.md

Lines changed: 608 additions & 1 deletion
Large diffs are not rendered by default.

templates/NOTES.txt

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
Thank you for installing {{ .Chart.Name }}.
2+
3+
Your release is named {{ .Release.Name }}.
4+
5+
To learn more about the release, try:
6+
7+
$ helm status {{ .Release.Name }}
8+
$ helm get all {{ .Release.Name }}
9+
10+
IMPORTANT: This is a development deployment. For production use, you MUST change the following default credentials:
11+
12+
1. Keycloak Admin: adminUser: admin, adminPassword: admin
13+
2. OpenCloud Admin: adminPassword: admin
14+
3. PostgreSQL: user: keycloak, password: keycloak
15+
4. MinIO: rootUser: opencloud, rootPassword: opencloud-secret-key
16+
5. OnlyOffice Database: sql.dbUser: onlyoffice, sql.dbPass: onlyoffice
17+
6. OnlyOffice Secret Keys: secret.inbox/outbox/session.string: B8LjkNqGxn6gf8bkuBUiMwyuCFwFddnu
18+
7. RabbitMQ: url: amqp://guest:guest@localhost
19+
20+
Using default credentials in production environments poses significant security risks.
21+
22+
The following services have been deployed:
23+
24+
1. OpenCloud (Main Application):
25+
- Service: {{ include "opencloud.opencloud.fullname" . }}
26+
- Port: 9200
27+
- Storage Driver: decomposeds3
28+
- System Storage Driver: decomposed
29+
- S3 Storage: {{ if .Values.opencloud.storage.s3.external.enabled }}{{ .Values.opencloud.storage.s3.external.endpoint }}{{ else if .Values.opencloud.storage.s3.internal.enabled }}MinIO ({{ include "opencloud.minio.fullname" . }}){{ else }}Not configured{{ end }}
30+
- S3 Bucket: {{ if .Values.opencloud.storage.s3.external.enabled }}{{ .Values.opencloud.storage.s3.external.bucket }}{{ else if .Values.opencloud.storage.s3.internal.enabled }}{{ .Values.opencloud.storage.s3.internal.bucketName }}{{ else }}Not configured{{ end }}
31+
32+
{{- if .Values.keycloak.enabled }}
33+
2. Keycloak (Authentication):
34+
- Service: {{ include "opencloud.keycloak.fullname" . }}
35+
- Port: 8080
36+
- Username: {{ .Values.keycloak.adminUser }}
37+
- Password: {{ .Values.keycloak.adminPassword }}
38+
{{- end }}
39+
40+
{{- if .Values.opencloud.storage.s3.internal.enabled }}
41+
3. MinIO (Object Storage):
42+
- Service: {{ include "opencloud.minio.fullname" . }}
43+
- API Port: 9000
44+
- Console Port: 9001
45+
- Username: {{ .Values.opencloud.storage.s3.internal.rootUser }}
46+
- Password: {{ .Values.opencloud.storage.s3.internal.rootPassword }}
47+
{{- end }}
48+
49+
{{- if and .Values.onlyoffice.collaboration.enabled .Values.onlyoffice.enabled }}
50+
4. OnlyOffice Collaboration Service:
51+
- Service: {{ include "opencloud.fullname" . }}-collaboration
52+
- HTTP Port: 9300
53+
- gRPC Port: 9301
54+
{{- end }}
55+
56+
57+
{{- if .Values.cilium.httproute.enabled }}
58+
IMPORTANT: This chart includes Cilium HTTPRoute resources that route traffic to the OpenCloud, Keycloak, and MinIO services.
59+
All HTTPRoutes are configured to use the Gateway named "{{ .Values.cilium.httproute.gateway.name }}" in the
60+
{{ if .Values.cilium.httproute.gateway.namespace }}{{ .Values.cilium.httproute.gateway.namespace }}{{ else }}{{ .Values.namespace }}{{ end }} namespace.
61+
62+
Make sure the Gateway exists and is properly configured to accept traffic for the following domains:
63+
- OpenCloud: {{ include "opencloud.domain" . }} (Service: {{ include "opencloud.opencloud.fullname" . }}, Port: 9200)
64+
{{- if .Values.keycloak.enabled }}
65+
- Keycloak: {{ include "opencloud.keycloak.domain" . }} (Service: {{ include "opencloud.keycloak.fullname" . }}, Port: 8080)
66+
{{- end }}
67+
{{- if .Values.opencloud.storage.s3.internal.enabled }}
68+
- MinIO Console: {{ include "opencloud.minio.domain" . }} (Service: {{ include "opencloud.minio.fullname" . }}, Port: 9001)
69+
{{- end }}
70+
{{- if and .Values.onlyoffice.collaboration.enabled .Values.onlyoffice.enabled }}
71+
- OnlyOffice Collaboration: {{ .Values.global.domain.wopi }} (Service: {{ include "opencloud.fullname" . }}-collaboration, Port: 9300)
72+
{{- end }}
73+
74+
{{- else }}
75+
IMPORTANT: The Cilium HTTPRoutes are disabled. You need to configure your own ingress controller
76+
to expose these services externally.
77+
78+
Example domains for your ingress configuration:
79+
- OpenCloud: {{ include "opencloud.domain" . }} (Service: {{ include "opencloud.opencloud.fullname" . }}, Port: 9200)
80+
{{- if .Values.keycloak.enabled }}
81+
- Keycloak: {{ include "opencloud.keycloak.domain" . }} (Service: {{ include "opencloud.keycloak.fullname" . }}, Port: 8080)
82+
{{- end }}
83+
{{- if .Values.opencloud.storage.s3.internal.enabled }}
84+
- MinIO Console: {{ include "opencloud.minio.domain" . }} (Service: {{ include "opencloud.minio.fullname" . }}, Port: 9001)
85+
{{- end }}
86+
{{- if and .Values.onlyoffice.collaboration.enabled .Values.onlyoffice.enabled }}
87+
- OnlyOffice Collaboration: {{ .Values.global.domain.wopi }} (Service: {{ include "opencloud.fullname" . }}-collaboration, Port: 9300)
88+
{{- end }}
89+
{{- end }}
90+
91+
For more information, please refer to the OpenCloud documentation:
92+
https://docs.opencloud.eu/

templates/_helpers/tpl.yaml

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "opencloud.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "opencloud.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "opencloud.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "opencloud.labels" -}}
37+
helm.sh/chart: {{ include "opencloud.chart" . }}
38+
{{ include "opencloud.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "opencloud.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "opencloud.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "opencloud.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "opencloud.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
63+
64+
{{/*
65+
Create a fully qualified OpenCloud name.
66+
*/}}
67+
{{- define "opencloud.opencloud.fullname" -}}
68+
{{- printf "%s-opencloud" (include "opencloud.fullname" .) | trunc 63 | trimSuffix "-" }}
69+
{{- end }}
70+
71+
{{/*
72+
Create a fully qualified Keycloak name.
73+
*/}}
74+
{{- define "opencloud.keycloak.fullname" -}}
75+
{{- printf "%s-keycloak" (include "opencloud.fullname" .) | trunc 63 | trimSuffix "-" }}
76+
{{- end }}
77+
78+
{{/*
79+
Create a fully qualified PostgreSQL name.
80+
*/}}
81+
{{- define "opencloud.postgres.fullname" -}}
82+
{{- printf "%s-postgres" (include "opencloud.fullname" .) | trunc 63 | trimSuffix "-" }}
83+
{{- end }}
84+
85+
{{/*
86+
Create a fully qualified MinIO name.
87+
*/}}
88+
{{- define "opencloud.minio.fullname" -}}
89+
{{- printf "%s-minio" (include "opencloud.fullname" .) | trunc 63 | trimSuffix "-" }}
90+
{{- end }}
91+
92+
{{/*
93+
Return the OpenCloud domain
94+
*/}}
95+
{{- define "opencloud.domain" -}}
96+
{{- .Values.global.domain.opencloud }}
97+
{{- end }}
98+
99+
{{/*
100+
Return the Keycloak domain
101+
*/}}
102+
{{- define "opencloud.keycloak.domain" -}}
103+
{{- .Values.global.domain.keycloak }}
104+
{{- end }}
105+
106+
{{/*
107+
Return the MinIO domain
108+
*/}}
109+
{{- define "opencloud.minio.domain" -}}
110+
{{- .Values.global.domain.minio }}
111+
{{- end }}
112+
113+
114+
{{/*
115+
Return the OnlyOffice domain
116+
*/}}
117+
{{- define "opencloud.onlyoffice.domain" -}}
118+
{{- .Values.global.domain.onlyoffice }}
119+
{{- end }}
120+
121+
{{/*
122+
Return the Companion domain
123+
*/}}
124+
{{- define "opencloud.companion.domain" -}}
125+
{{- .Values.global.domain.companion }}
126+
{{- end }}
127+
128+
{{/*
129+
Return the WOPI domain
130+
*/}}
131+
{{- define "opencloud.wopi.domain" -}}
132+
{{- .Values.global.domain.wopi }}
133+
{{- end }}
134+
135+
{{/*
136+
Create a fully qualified Tika name.
137+
*/}}
138+
{{- define "opencloud.tika.fullname" -}}
139+
{{- printf "%s-tika" (include "opencloud.fullname" .) | trunc 63 | trimSuffix "-" }}
140+
{{- end }}
141+
142+
{{/*
143+
Return the namespace to use
144+
*/}}
145+
{{- define "opencloud.namespace" -}}
146+
{{- if .Values.namespace -}}
147+
{{- .Values.namespace -}}
148+
{{- else -}}
149+
{{- .Release.Namespace -}}
150+
{{- end -}}
151+
{{- end }}
152+
153+
{{/*
154+
Return the appropriate apiVersion for ingress
155+
*/}}
156+
{{- define "opencloud.ingress.apiVersion" -}}
157+
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" -}}
158+
{{- print "networking.k8s.io/v1" -}}
159+
{{- else -}}
160+
{{- print "networking.k8s.io/v1beta1" -}}
161+
{{- end -}}
162+
{{- end -}}
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
{{- if and .Values.onlyoffice.collaboration.enabled .Values.onlyoffice.enabled }}
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: {{ include "opencloud.fullname" . }}-collaboration
6+
namespace: {{ .Values.namespace }}
7+
labels:
8+
{{- include "opencloud.labels" . | nindent 4 }}
9+
app.kubernetes.io/component: collaboration
10+
spec:
11+
replicas: 1
12+
selector:
13+
matchLabels:
14+
{{- include "opencloud.selectorLabels" . | nindent 6 }}
15+
app.kubernetes.io/component: collaboration
16+
template:
17+
metadata:
18+
labels:
19+
{{- include "opencloud.selectorLabels" . | nindent 8 }}
20+
app.kubernetes.io/component: collaboration
21+
spec:
22+
securityContext:
23+
fsGroup: 1000
24+
initContainers:
25+
# Wait for OpenCloud to be ready
26+
- name: wait-for-opencloud
27+
image: busybox
28+
command: ['sh', '-c', 'until wget -q -O- http://{{ include "opencloud.opencloud.fullname" . }}:9200/health; do echo waiting for opencloud; sleep 5; done;']
29+
30+
{{- if not .Values.opencloud.persistence.enabled }}
31+
# Copy config from OpenCloud API if persistence is disabled
32+
- name: copy-config
33+
image: busybox
34+
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"']
35+
volumeMounts:
36+
- name: etc-opencloud
37+
mountPath: /etc/opencloud
38+
{{- end }}
39+
40+
# Wait for OnlyOffice to be ready
41+
- name: wait-for-onlyoffice
42+
image: busybox
43+
command: ['sh', '-c', 'until wget -q -O- http://{{ include "opencloud.fullname" . }}-onlyoffice:80/hosting/discovery; do echo waiting for onlyoffice; sleep 2; done;']
44+
containers:
45+
- name: collaboration
46+
image: {{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}
47+
imagePullPolicy: {{ .Values.image.pullPolicy }}
48+
command: ["/bin/sh"]
49+
args: ["-c", "opencloud collaboration server"]
50+
env:
51+
- name: COLLABORATION_GRPC_ADDR
52+
value: "0.0.0.0:9301"
53+
- name: COLLABORATION_HTTP_ADDR
54+
value: "0.0.0.0:9300"
55+
- name: MICRO_REGISTRY
56+
value: "nats-js-kv"
57+
- name: MICRO_REGISTRY_ADDRESS
58+
value: "{{ include "opencloud.opencloud.fullname" . }}.{{ include "opencloud.namespace" . }}.svc.cluster.local:9233"
59+
- name: COLLABORATION_WOPI_SRC
60+
value: "https://{{ include "opencloud.wopi.domain" . }}"
61+
- name: COLLABORATION_APP_NAME
62+
value: "OnlyOffice"
63+
- name: COLLABORATION_APP_PRODUCT
64+
value: "OnlyOffice"
65+
- name: COLLABORATION_APP_ADDR
66+
value: "https://{{ include "opencloud.onlyoffice.domain" . }}"
67+
- name: COLLABORATION_APP_ICON
68+
value: "https://{{ include "opencloud.onlyoffice.domain" . }}/web-apps/apps/documenteditor/main/resources/img/favicon.ico"
69+
- name: COLLABORATION_APP_PROOF_DISABLE
70+
value: "true"
71+
- name: COLLABORATION_APP_INSECURE
72+
value: "{{ .Values.opencloud.insecure }}"
73+
- name: COLLABORATION_CS3API_DATAGATEWAY_INSECURE
74+
value: "{{ .Values.opencloud.insecure }}"
75+
- name: COLLABORATION_LOG_LEVEL
76+
value: "{{ .Values.opencloud.logLevel }}"
77+
- name: OC_URL
78+
value: "https://{{ include "opencloud.domain" . }}"
79+
ports:
80+
- name: http
81+
containerPort: 9300
82+
protocol: TCP
83+
- name: grpc
84+
containerPort: 9301
85+
protocol: TCP
86+
volumeMounts:
87+
- name: etc-opencloud
88+
mountPath: /etc/opencloud
89+
livenessProbe:
90+
exec:
91+
command:
92+
- /bin/sh
93+
- -c
94+
- curl --silent --fail http://opencloud-opencloud:9200/app/list | grep '"name":"OnlyOffice"'
95+
timeoutSeconds: 10
96+
initialDelaySeconds: 200
97+
periodSeconds: 5
98+
failureThreshold: 1
99+
volumeMounts:
100+
- name: etc-opencloud
101+
mountPath: /etc/opencloud
102+
resources:
103+
{{- toYaml .Values.onlyoffice.collaboration.resources | nindent 12 }}
104+
volumes:
105+
- name: etc-opencloud
106+
{{- if .Values.opencloud.persistence.enabled }}
107+
persistentVolumeClaim:
108+
claimName: {{ include "opencloud.opencloud.fullname" . }}-config
109+
readOnly: true
110+
{{- else }}
111+
# If persistence is disabled, use an init container to copy the config
112+
emptyDir: {}
113+
{{- end }}
114+
{{- end }}

0 commit comments

Comments
 (0)