Longhorn is a distributed file system for kubernetes developed and release by Rancher. It’s good local storage for compute functions.
This deployment required the use of a HelmChart and Release object for flux. The ingress looks a little weird but this issue explains why.
The only manual step is to create a sealed secret for the password authentication on the ingress controller.
USER=<user-name>
PASSWORD=<password>
echo "${USER}:$(openssl passwd -stdin -apr1 <<< ${PASSWORD})" >> auth
kubectl -n longhorn-system create secret generic basic-auth --from-file=auth --dry-run=client -o yaml
> secret-basic-auth.yaml
kubeseal --scope strict -o yaml < secret-basic-auth.yaml > sealed-secret-basic-auth.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: test-pvc
spec:
accessModes:
- ReadWriteOnce
storageClassName: longhorn
resources:
requests:
storage: 1Gi
kubectl apply -f pvc.yaml
test-mount.yaml
apiVersion: v1
kind: Pod
metadata:
name: volume-test
spec:
containers:
- name: volume-test
image: nginx:stable-alpine
imagePullPolicy: IfNotPresent
volumeMounts:
- name: test-pvc
mountPath: /data
ports:
- containerPort: 80
volumes:
- name: test-pvc
persistentVolumeClaim:
claimName: test-pvc
kubectl apply -f test-mount.yaml