- Have
quay.io
account, running docker and kubernetes. You could use any registry account and replacequay.io
with such registry name in below steps. - Docker login to your
quay.io
account.
$ docker login --username <QUAY_USERNAME> https://quay.io
- Create
csi-provisioner
,livenessprobe
andcsi-node-driver-registrar
repositories by pull/tag/push respective images to yourquay.io
account.
$ docker pull quay.io/minio/csi-provisioner:v3.4.0 && \
docker tag quay.io/minio/csi-provisioner:v3.4.0 quay.io/<QUAY_USERNAME>/csi-provisioner:v3.4.0 && \
docker push quay.io/<QUAY_USERNAME>/csi-provisioner:v3.4.0
$ docker pull quay.io/minio/livenessprobe:v2.9.0 && \
docker tag quay.io/minio/livenessprobe:v2.9.0 quay.io/<QUAY_USERNAME>/livenessprobe:v2.9.0 && \
docker push quay.io/<QUAY_USERNAME>/livenessprobe:v2.9.0
$ docker pull quay.io/minio/csi-node-driver-registrar:v2.6.3 && \
docker tag quay.io/minio/csi-node-driver-registrar:v2.6.3 quay.io/<QUAY_USERNAME>/csi-node-driver-registrar:v2.6.3 && \
docker push quay.io/<QUAY_USERNAME>/csi-node-driver-registrar:v2.6.3
$ docker pull quay.io/minio/csi-resizer:v1.7.0 && \
docker tag quay.io/minio/csi-resizer:v1.7.0 quay.io/<QUAY_USERNAME>/csi-resizer:v1.7.0 && \
docker push quay.io/<QUAY_USERNAME>/csi-resizer:v1.7.0
- Make sure
csi-provisioner
,livenessprobe
,csi-node-driver-registrar
andcsi-resizer
repositories arepublic
in yourquay.io
account. - Go to your DirectPV project root.
$ cd $GOPATH/src/github.com/minio/directpv
- Hack, hack, hack...
- Run ./build.sh
$ ./build.sh
- Run docker build to tag image.
$ docker build -t quay.io/<QUAY_USERNAME>/directpv:<NEW_BUILD_TAG> .
- Push newly created image to your
quay.io
account.
$ docker push quay.io/<QUAY_USERNAME>/directpv:<NEW_BUILD_TAG>
- Make sure
directpv
repository ispublic
in yourquay.io
account. - Install DirectPV.
$ ./kubectl-directpv --kubeconfig <PATH-TO-KUBECONFIG-FILE> install \
--image directpv:<NEW_BUILD_TAG> --org <QUAY_USERNAME> --registry quay.io
- Check running DirectPV
$ ./kubectl-directpv --kubeconfig <PATH-TO-KUBECONFIG-FILE> info
$ ./kubectl-directpv --kubeconfig <PATH-TO-KUBECONFIG-FILE> list drives
- Setup LVs
The following script will create 4 LVs backed up by 4 loopback devices
sudo truncate --size=1G /tmp/disk-{1..4}.img
for disk in /tmp/disk-{1..4}.img; do sudo losetup --find $disk; done
devices=( $(for disk in /tmp/disk-{1..4}.img; do sudo losetup --noheadings --output NAME --associated $disk; done) )
sudo pvcreate "${devices[@]}"
vgname="vg0"
sudo vgcreate "$vgname" "${devices[@]}"
for lvname in lv-{0..3}; do sudo lvcreate --name="$lvname" --size=800MiB "$vgname"; done
- Start minikube
minikube start --driver=none
- Install DirectPV
Install the freshly built version
./kubectl-directpv install --image directpv:<NEW_BUILD_TAG> --org <QUAY_USERNAME> --registry quay.io
- Discover and initialize the drives
./kubectl-directpv discover --output-file drives.yaml
./kubectl-directpv init drives.yaml
- Check if the drives are showing up
./kubectl-directpv list drives
- Apply the minio.yaml file
Download and apply a sample MinIO deployment file available here
kubectl apply -f minio.yaml
- Check if the pods are up and running
kubectl get pods
- Check the volumes
./kubectl-directpv list volumes
- Check the drives contain volumes
./kubectl-directpv list drives
- Uninstall the MinIO deployment
kubectl delete -f minio.yaml
- Delete the PVCs
kubectl delete pvc --all
After deleting the PVCs, check if the drives are freed up.
- Release freed drives
./kubectl-directpv remove --all
- Cleanup LV setup
sudo lvremove vg0 -y
sudo vgremove vg0 -y
sudo pvremove /dev/loop<n> /dev/loop<n> /dev/loop<n> /dev/loop<n> # n can be replaced with the loopbacks created
sudo losetup --detach-all
Please refer here for any trouble shooting guidelines.