The goal of this set of templates and scripts is to rapidly deploy a Nextcloud Cluster that adheres to BC Gov standard Namespace conventions. It deploys builders and imagestreams to Tools as first time run, and deploys Nextcloud and MariaDB including Deployment Configs/services/Routes/Secrets/ConfigMaps/PVCs/CronJobs to the appropriate environment (dev/test/prod). Some additions to a standard docker image based nextcloud install:
- Uses supplied DockerHub Credentials to avoid docker pull rate failures on 3 source DockerImages (Nginx/MariaDB,Nextcloud)
- Fronted by Nginx rather than Apache
- Builder + Dockerfile strategy to customize the final Nextcloud container image composition and configuration
- A continuation of work done by (https://github.com/tobru) and (https://github.com/agahchen)
Pre Requisites:
- Docker Hub Username and credentials
- OpenShift Namespace to deploy into
- Valid OpenShift Login token
- first_time_run variable default to 1 (true), sets up imagestreams in tools first time.
./nextcloud.sh
- Navigate to http://nextcloud.example.com
- Fill in the form and finish the installation. The DB credentials can be
found in the secret
mysql. In the Webconsole it can be found underResources -> Secrets -> mysql -> Reveal Secret
Hints
- You might want to enable TLS for your instance
You can use the provided DB dump CronJob template:
oc process -f https://raw.githubusercontent.com/ChrisHoban/ssg-openshift-meta-templates/master/openshift/oc4-meta-templates/services/nextcloud/mariadb-backup.yaml | oc -n MYNAMESPACE create -f -
This script dumps the DB to the same PV as the database stores it's data. You must make sure that you copy these files away to a real backup location.
To backup files, a simple solution would be to run f.e. restic in a Pod
as a CronJob and mount the PVCs as volumes. Then use an S3 endpoint for restic
to backup data to.
- Nextcloud Cronjob is called from a
CronJobobject every 15 minutes - The Dockerfile just add the
nginx.confto the Alpine Nginx container
To use the occ CLI, you can use oc exec:
oc get pods
oc exec NEXTCLOUDPOD -c nextcloud -ti php occ
- Autoconfigure Nextcloud using
autoconfig.php - Provide restic Backup example
Execute the following command to get the available parameters:
oc process -f https://raw.githubusercontent.com/ChrisHoban/ssg-openshift-meta-templates/master/openshift/oc4-meta-templates/services/nextcloud/nextcloud.yaml --parameters

