Posted On 23.01.2025

Migrating my cloud to Kubernetes – storage – the final decision SSHFS

2 comments
confdroid.com >> blog >> Migrating my cloud to Kubernetes – storage – the final decision SSHFS


However I am running a test and development environment and have to look after my costs, so this will suffice for now. Upgrades can always be done down the road.

All you have to do really is to install the sshfs package, the name might differ depending on the OS. Then you will need to add an entry in your /etc/fstab like this:

#sshfs share
:share /data/share fuse.sshfs comment=sshfs,defaults,transform_symlinks,identityfile=/root/.ssh/id_rsa,users,exec,auto,allow_other,_netdev,uid=1000,gid=1000,reconnect 0 0
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: sshfs-storage-class
provisioner: kubernetes.io/no-provisioner
reclaimPolicy: Retain
allowVolumeExpansion: true
volumeBindingMode: WaitForFirstConsumer

Author Profile

12ww1160DevOps engineer & architect

2 thoughts on “Migrating my cloud to Kubernetes – storage – the final decision SSHFS”

  • How will the sshfs-storage-class know about the storage location /data/share? It’s not configured anywhere in the storage class definition. If it’s mounted on host using fstab, wouldn’t that require a hostPath-mount?

    • Excellent question. There is two ways. You can indeed define it at the storage class, or you can define it at the hostpath for the persistent volume (PV) like so:

      hostPath:
      path: /data/share/example

      I prefer the latter because obviously there will be sub paths for the various deployments.

      On Linux level the mount /data/share (or whatever you choose) itself must be defined in fstab as usual.

Leave a Reply

Your email address will not be published. Required fields are marked *

twenty − 12 =

Related Post

Publishing Pipeline v1.1.0 – Dev.to Support and What Comes Next

With the initial version of the publishing pipeline in place, this release marks a small…

Publishing Pipeline – inline Mermaid code

## Enhancing Blog Posts with Mermaid Diagrams: Why They’re a Game-Changer (and How to Make…

VMware Workstation 12 CentOS 7 pxe kickstart fails with default settings

I am running a variety of virtual machines to test my puppet code, and started…
Social Media Auto Publish Powered By : XYZScripts.com