Skip to content

Kubernetes

Gerrit Gogel edited this page Jan 9, 2024 · 5 revisions

Kubernetes manifests are provided as a starting point for a deployment on Kubernetes. The manifest files can be found in the folder k8s. The manifests were tested using Kubernetes on Docker Desktop and ingress-nginx. Depending on your Kubernetes setup and requirements, configuration changes are required.

Configuration

  1. In seafile-server-deployment.yaml, configure the environments variables spec.template.spec.containers.env:
  • SEAFILE_URL: The domain you intend to use for Seafile
  • HTTPS: Set to true if you plan to use a HTTPS ingress
  1. In seahub-deployment.yaml, configure the environments variables spec.template.spec.containers.env:
  • SEAFILE_ADMIN_EMAIL: Username / E-Mail of the first admin user.
  • SEAFILE_ADMIN_PASSWORD: Password of the first admin user.
  1. Configure the ingress in seafile-ingress.yaml according to your ingress controller and requirements. The provided file is configured for ingress-nginx. Set host to SEAFILE_URL.

  2. Configure the PVCs according to your storage class and requirements in seafile-data-persistentvolumeclaim.yaml, seafile-mariadb-persistentvolumeclaim.yaml, seafile-avatars-persistentvolumeclaim.yaml and seafile-custom-persistentvolumeclaim.yaml. See PVC Access Modes for more information.

Installation

Run the following command to install all manifests in the namespace seafile:

kubectl apply -f ./k8s -n seafile

PVC Access Modes

The pods of seafile-server and seahub share the same data volume. Further seahub shares volumes with seahub-media. The respective PVCs are therefore configured with access mode ReadWriteMany. This allows the pods to be scheduled on different nodes and still share those volumes.

If you encounter an error resembling the one below, it indicates that your storage driver does not support the specified access mode:

failed to provision volume with StorageClass "harvester": rpc error: code = InvalidArgument desc = access mode MULTI_NODE_MULTI_WRITER is not supported

In response to this error, it becomes necessary to adjust the access mode of the PVCs from ReadWriteMany to ReadWriteOnce. Then it becomes crucial to coordinate the scheduling of the associated pods on the same nodes. To achieve this coordination, refer to the methods outlined in the Kubernetes documentation: Assigning Pods to Nodes.

If you run a single node cluster, the pod scheduling is not relevant.

Clone this wiki locally