Deploying StatefulSet
Deploying the StatefulSet Workload
helm install \ --set statefulset.enabled=true \ lb-csi-workload-sts \ lightbits-helm-repo/lb-csi-workload-examplesWill output:
NAME: lb-csi-workload-stsLAST DEPLOYED: Sun Feb 21 16:09:02 2021NAMESPACE: defaultSTATUS: deployedREVISION: 1TEST SUITE: NoneVerifying the StatefulSet Workload
Verify that the following conditions are met:
PVandPVCisBoundPODs status isRunningStatefulSethas 3/3Ready
x
kubectl get pv,pvc,pods,stsNAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGEpersistentvolume/pvc-1a16e8da-427a-47a1-9974-c7f18b9d8abb 10Gi RWO Delete Bound default/test-mnt-example-sts-0 example-sc 2m4spersistentvolume/pvc-57e6e555-43e3-4f39-9433-c287d3ab53d6 10Gi RWO Delete Bound default/test-mnt-example-sts-1 example-sc 114spersistentvolume/pvc-945f0393-e711-4c75-b2f9-b80222d346ab 10Gi RWO Delete Bound default/test-mnt-example-sts-2 example-sc 103sNAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGEpersistentvolumeclaim/test-mnt-example-sts-0 Bound pvc-1a16e8da-427a-47a1-9974-c7f18b9d8abb 10Gi RWO example-sc 2m5spersistentvolumeclaim/test-mnt-example-sts-1 Bound pvc-57e6e555-43e3-4f39-9433-c287d3ab53d6 10Gi RWO example-sc 116spersistentvolumeclaim/test-mnt-example-sts-2 Bound pvc-945f0393-e711-4c75-b2f9-b80222d346ab 10Gi RWO example-sc 104sNAME READY STATUS RESTARTS AGEpod/example-sts-0 1/1 Running 0 2m5spod/example-sts-1 1/1 Running 0 116spod/example-sts-2 1/1 Running 0 104sNAME READY AGEstatefulset.apps/example-sts 3/3 2m5sUninstalling the StatefulSet Workload
helm uninstall lb-csi-workload-stsVerify that StatefulSet and PODs resources are gone:
kubectl get pv,pvc,pods,stsNAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGEpersistentvolume/pvc-1a16e8da-427a-47a1-9974-c7f18b9d8abb 10Gi RWO Delete Bound default/test-mnt-example-sts-0 example-sc 5m31spersistentvolume/pvc-57e6e555-43e3-4f39-9433-c287d3ab53d6 10Gi RWO Delete Bound default/test-mnt-example-sts-1 example-sc 5m21spersistentvolume/pvc-945f0393-e711-4c75-b2f9-b80222d346ab 10Gi RWO Delete Bound default/test-mnt-example-sts-2 example-sc 5m10sNAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGEpersistentvolumeclaim/test-mnt-example-sts-0 Bound pvc-1a16e8da-427a-47a1-9974-c7f18b9d8abb 10Gi RWO example-sc 5m32spersistentvolumeclaim/test-mnt-example-sts-1 Bound pvc-57e6e555-43e3-4f39-9433-c287d3ab53d6 10Gi RWO example-sc 5m23spersistentvolumeclaim/test-mnt-example-sts-2 Bound pvc-945f0393-e711-4c75-b2f9-b80222d346ab 10Gi RWO example-sc 5m11sSince the default StorageClass.reclaimPolicy is Retain, the PVCs and PVs will remain and will not be deleted.
In order to delete them, run the following:
kubectl delete \ persistentvolumeclaim/test-mnt-example-sts-0 \ persistentvolumeclaim/test-mnt-example-sts-1 \ persistentvolumeclaim/test-mnt-example-sts-2persistentvolumeclaim "test-mnt-example-sts-0" deletedpersistentvolumeclaim "test-mnt-example-sts-1" deletedpersistentvolumeclaim "test-mnt-example-sts-2" deletedVerify that all resources are gone:
kubectl get pv,pvc,podsNo resources found in default namespace.Was this page helpful?