Skip to content

mrgian/kubernetes-nextcloud-deploy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nextcloud deploy on Kubernetes with MySQL

Kubernetes objects definitions for deploying Nextcloud with MySQL

How to deploy

Deploying example on a fresh Arch Linux install with Minikube

Preparation

Install Docker, Minikube, kubectl and nginx:

sudo pacman -S docker minikube kubectl nginx

Add user to docker group:

sudo gpasswd -a $USER docker

Reboot:

sudo reboot

Make persistent data directories

These dirs will be used as persistent volumes in Kubernetes.

cd
mkdir data
mkdir data/nextcloud
mkdir data/nextcloud/data
mkdir data/nextcloud/config
mkdir data/nextcloud/apps
mkdir data/mysql

Start Minikube

Start Minikube specifying in which dir persistent volumes will be mounted

minikube start --mount --mount-string="$HOME/data:/home/docker/data" --driver=docker

Apply configurations

git clone https://github.com/mrgian/kubernetes-nextcloud-deploy.git
cd kubernetes-nextcloud-deploy
kubectl apply -f mysql-config.yaml
kubectl apply -f mysql-secret.yaml
kubectl apply -f mysql.yaml
kubectl apply -f nextcloud.yaml

Check Nextcloud service URL

minikube service nextcloud-service

The Nextcloud instance will be available at the shown URL.

Configure reverse proxy in Nginx

If you are running Kubernetes in Minikube, you may want your Nextcloud instance to be accessible from outside. You can setup a reverse proxy with Nginx

Edit nginx.conf:

sudo nano /etc/nginx/nginx.conf

Configure the reverse proxy:

server {
    listen       80;
    server_name  localhost;
    
    location / {
        proxy_pass http://192.168.49.2:30001;
    }
}

Restart Nginx:

sudo systemctl restart nginx

About

☁️ Nexcloud deploy on Kubernetes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published