Friday, 2021 June 18

Some time ago (2019 December), I tried to set up OwnCloud in my Kubernetes cluster. This went very poorly and I rage quit; I don't remember the exact issues I was having, but I think it largely boiled down to absolutely terrible documentation. I've been meaning to revisit this ever since.

I finally did. This time I decided to try NextCloud. I know that when I originally chose OwnCloud I was confused as to the relationship between these two projects. At the time, based on my own snarky comments on the ticket I was using to track the work, apparently I thought NextCloud was too enterprise-oriented.

This is surprising in hindsight. I now know that NextCloud, while being a well-established fork of OwnCloud, is incredibly easy to set up. To be fair OwnCloud may be as well at this point, but unless I run into a showstopper with NextCloud I'm unlikely to switch.

To set things up, I just created a database in my Digital Ocean Postgres instance and set up a connection pool. Then, based on this blog post I created a simple yaml definition file.

---
apiVersion: v1
kind: Service
metadata:
  name: nextcloud-service
spec:
  type: ClusterIP
  selector:
    component: nextcloud
  ports:
  - protocol: TCP
    port: 80
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nextcloud-deployment
  labels:
    component: nextcloud
  annotations:
    flux.weave.works/automated: 'true'
spec:
  replicas: 1
  selector:
    matchLabels:
      component: nextcloud
  template:
    metadata:
      labels:
        component: nextcloud
    spec:
      containers:
      - name: nextcloud
        image: nextcloud:production-apache
        volumeMounts:
        - name: nextcloud-volume
          mountPath: /var/www/html
          subPath: server-data
      volumes:
      - name: nextcloud-volume
        persistentVolumeClaim:
          claimName: nextcloud-data

I manually created a PersistentVolumeClaim named nextcloud-volume. I also created a Traefik ingress rule to route traffic.

And...everything worked! I was able to visit the site. It prompted me to create an administrator account and to configure my database. From there it took just long enough for me to worry that something wasn't working, but eventually it finished doing whatever setup it needed and dropped me into the main UI. So now I need to start playing around and configuring/adding the functionality that I'm really after.

Monday, 2021 June 07