Skip to content

Gerrri/home-setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Thats my collection of home-services I'm hosting on a mini-pc running a K3s Kubernetes Cluster (one Node)

What I'm currently hosting

  • Paperless NGX
  • Kubernete Dashboard

What I'm going to host

  • Home-Assistant (currently running on a Raspberry Pi)

My todos

  • Longhorn Backups

Preparing machine

  • install k3s (one-line-installation)
  • enable ssh
  • install open-scsi (for Longhorn)

Cluster Infrastructure

Setup Longhorn

helm repo add longhorn https://charts.longhorn.io
helm repo update
helm install longhorn longhorn/longhorn --namespace longhorn-system --set defaultSettings.defaultReplicaCount=1

ATTENTION!: Dont delete the Namespace in case you want to delete Longhorn -> there is an uninstall script.

SMB storage class

To use my NAS as a storage exchange with some Pods (e.g. paperless), Im going to make a SMB-share accessible via a Storage class out of the Cluster

install on Node

sudo apt install cifs-utils smbclient
sudo apt-get install nfs-common
sudo apt-get install nfs-utils

install csi-driver-smb

helm repo add csi-driver-smb https://raw.githubusercontent.com/kubernetes-csi/csi-driver-smb/master/charts
helm install csi-driver-smb csi-driver-smb/csi-driver-smb --namespace kube-system --version v1.13.0

uninstall : helm uninstall csi-driver-smb -n kube-system

kubectl create secret generic smbcreds --from-literal username=mr_paperless --from-literal password="<replace_me>" --namespace home-services

kubectl create -f https://raw.githubusercontent.com/kubernetes-csi/csi-driver-smb/master/deploy/example/storageclass-smb.yaml --namespace home-services

#check status

Modifications for paperless document export

Command to perform an export in paperless container

mkdir -p /usr/src/paperless/media tmp_export && 
chown -c paperless /usr/src/paperless/media tmp_export &&
document_exporter /usr/src/paperless/media/tmp_export && 
cp /usr/src/paperless/media/tmp_export/* /usr/src/paperless/export

Command to run this via kubcetl

kubectl exec $(kubectl get pods --namespace home-services | grep "paperless-ngx" | grep -v "redis" | awk {'print $1}') -n home-services -- bash -c "mkdir -p /usr/src/paperless/media tmp_export && \
        chown -c paperless /usr/src/paperless/media tmp_export && \
        document_exporter -c /usr/src/paperless/media/tmp_export && \
        cp /usr/src/paperless/media/tmp_export/* /usr/src/paperless/export"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published