To test the issue with /mnt
in kubelet in Lokomotive kinvolk-archives/lokomotive-kubernetes#160.
Add following flag to apiserver
, kube-controller-manager
, kube-scheduler
- --feature-gates=BlockVolume=true
Run following commands to edit the configs:
kubectl -n kube-system edit ds kube-apiserver
kubectl -n kube-system edit deploy kube-controller-manager
kubectl -n kube-system edit deploy kube-scheduler
And to add the flag to kubelet
this is what you should add:
--feature-gates=BlockVolume=true \
Add that using following command:
kubectl -n kube-system edit ds kubelet
Create volumes on each host. By running following command:
sudo -i
mkdir /mnt/disks
for vol in vol1 vol2 vol3; do
mkdir /mnt/disks/$vol
mount -t tmpfs $vol /mnt/disks/$vol
done
Deploy the provisioner:
kubectl apply -f deployment/kubernetes/example/default_example_storageclass.yaml
kubectl create ns static-provisioner
Use following values file
common:
namespace: static-provisioner
podSecurityPolicy: true
classes:
- name: fast-disks # Defines name of storage classe.
hostDir: /mnt/disks
volumeMode: Filesystem
fsType: tmpfs
blockCleanerCommand:
- "/scripts/shred.sh"
- "2"
helm template --values custom-values.yaml ./helm/provisioner/ | k apply -f -