Dynamic Provisioning: Difference between revisions

From WilliamsNet Wiki
Jump to navigation Jump to search
(Created page with "Kubernetes needs a specific '''storageClass''' to allocate dynamically requested persistent storage. As there is no driver that will take direct advantage of the BeeGFS files...")
 
(No difference)

Latest revision as of 01:26, 3 August 2019

Kubernetes needs a specific storageClass to allocate dynamically requested persistent storage. As there is no driver that will take direct advantage of the BeeGFS filesystem (or even a common filesystem mounted on all workers), we have to set up an NFS server to share out a specific folder on /workspace so that it can be allocated appropriately. This could be any system -- compute7 is the current stuckee.

Create the folder on /workspace (just for documentation purposes)

mkdir /workspace/PersistentStorage
chmod 777 /workspace/PersistentStorage

Install, enable, and start the NFS server and related daemons on compute7

yum install nfs-utils libnfsidmap
systemctl enable rpcbind
systemctl enable nfs-server
systemctl start rpcbind
systemctl start nfs-server
systemctl start rpc-statd
systemctl start nfs-idmapd

Specify the export location

echo "/workspace/PersistentStorage 10.0.0.0/8(rw,sync,no_root_squash,fsid=1)" > /etc/exports

Notify the server of the change in exported filesystems

exportfs -r

I'm using the nfs-client provisioner from the incubator tree on github -- it's not official, but it is recognized<ref>https://github.com/kubernetes-incubator/external-storage/</ref>

To keep things clean, we will put this controller into the kube-system namespace ... this means modifying all the manifests mentioned below to include the 'namespace: kube-system' line where appropriate ...

Following the instructions in the README.md file, the installation is in three steps:

  • set up authentication (create the service account, cluster role, and cluster role binding)
kubectl create -f deploy/auth/serviceaccount.yaml
kubectl create -f deploy/auth/clusterrole.yaml
kubectl create -f deploy/auth/clusterrolebinding.yaml
  • modify the deployment.yaml file to set names
  • modify the class.yaml file to set names

These files have been checked into the GitLab k8s-admin repository.

Now, issue this next command to make it the default storage class:

kubectl patch storageclass workspace -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'

<references />