webdav
by danuk
A Helm chart for Kubernetes
About this chart
WebDav server
WebDav server based on Apache.
The Apache server supports the WebDav protocol better than Nginx, which is especially important for Windows.
This chart uses only the official Apache docker image (httpd), and you don't need to build your own image. All the configuration files make by helm on the installation.
It has been tested on Linux and Windows.
Setup Instructions
This chart only works with helm3, because of htpasswd function has been available since helm3.
Deployment
To deploy to Kubernetes follow these steps:
Create values.yaml file like this:
urls:
/:
- user: user1
password: password1
- user: user2
password: password2
/foo:
- user: user3
password: password3
ingress:
className: "nginx"
host: my-domain.com
annotations:
kubernetes.io/tls-acme: "true"
persistence:
enabled: true
size: 1Gi
You can also change the Apache configuration, if necessary, by downloading the default values.yaml and changing it.
Use existing k8s secret for authentication:
Existing htpasswd secret stored within the same namespace can be used.
Example:
urls:
/:
htpasswdSecretRef:
name: htpasswd
key: root
existingHtpasswdSecrets:
- name: htpasswd
The htpasswd secret shall be created in advance. The htpasswd tool can be used to generate the secret.
First generate the htpasswd content for the user(s):
$ htpasswd -n -b user password
user:$apr1$DRUWLwA4$bG9RXXF1XAAF1dCIIoX/H1
Create a secret from it and apply on the cluster before installing the helm release.
htpasswd-secret.yaml:
apiVersion: v1
kind: Secret
metadata:
name: htpasswd
type: Opaque
stringData:
root: |
user:$apr1$DRUWLwA4$bG9RXXF1XAAF1dCIIoX/H1
Add multiple lines to the secret data value to add more user authentications and add more secret data keys to create multiple user authentication sets to refer.
Apply it:
kubectl apply -f htpasswd-secret.yaml
Use HostPath persistency
HostPath can be configured for the persistency type, which mounts a directory from the host.
persistence:
enabled: true
type: hostPath
hostPath: /path/on/host
In this case, it is the user's responsibility to grant permission to the UID:33 GID:33 (www-data) user to manage this directory.
Deploy the WebDav server to Kubernetes:
helm repo add k8s-webdav https://danuk.github.io/k8s-webdav/
helm upgrade -i my-webdav k8s-webdav/webdav -f values.yaml
Deploy webdav with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has webdav on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartwebdav is pinned at v0.0.7 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply