Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubernetes-volumes - re-work example output #139

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DamianZaremba
Copy link

Spinning up a clean cluster, the civo-volume storage class has WaitForFirstConsumer rather than Immediate volume binding.

This means the volume is not created when the volume claim is created, but rather when the pod is scheduled.

The get pv output is moved to after the get pods output, which will successfully show the relevant volume.

Spinning up a clean cluster, the `civo-volume` storage class has
`WaitForFirstConsumer` rather than `Immediate` volume binding.

This means the volume is not created when the volume claim is created,
but rather when the pod is scheduled.

The `get pv` output is moved to after the `get pods` output, which will
successfully show the relevant volume.
@DamianZaremba
Copy link
Author

Re-production;

$ civo kubernetes create civo-cluster -n 1 -s g4s.kube.medium --cluster-type k3s --region LON1 --wait --save
Warning: Are you sure you want to overwrite the kubernetes config (y/N) ? y

Access your cluster with:
kubectl get node
The cluster civo-cluster (6b9271d0-8542-4aae-bd6e-893871c316f8) has been created in 2 min 54 sec

$ kubectl get sc
NAME                    PROVISIONER    RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE
civo-volume (default)   csi.civo.com   Delete          WaitForFirstConsumer   true                   74s

Create the PVC per the example;

$ kubectl create -f-
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: civo-volume-test
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 3Gi
persistentvolumeclaim/civo-volume-test created

No volume (per current docs example);

$ kubectl get pvc
NAME               STATUS    VOLUME   CAPACITY   ACCESS MODES   STORAGECLASS   AGE
civo-volume-test   Pending                                      civo-volume    15s

$ kubectl get pv
No resources found

Volume is waiting for the pod per the binding mode;

$ kubectl describe pvc civo-volume-test | tail -n1
  Normal  WaitForFirstConsumer  4s (x6 over 66s)  persistentvolume-controller  waiting for first consumer to be created before binding

Create the pod per the example;

$ kubectl create -f-
apiVersion: v1
kind: Pod
metadata:
  name: civo-vol-test-pod
spec:
  volumes:
    - name: civo-vol
      persistentVolumeClaim:
        claimName: civo-volume-test
  containers:
    - name: civo-vol-container
      image: nginx
      ports:
        - containerPort: 80
          name: "http-server"
      volumeMounts:
        - mountPath: "/usr/share/nginx/html"
          name: civo-vol
pod/civo-vol-test-pod created

After the pod gets scheduled, the volume is there (per the example in this change)

$ kubectl get pods
NAME                                 READY   STATUS              RESTARTS   AGE
install-traefik2-nodeport-ci-kfzwq   0/1     Completed           0          55s
civo-vol-test-pod                    0/1     ContainerCreating   0          18s

$ kubectl get pv
NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                      STORAGECLASS   REASON   AGE
pvc-43f603cd-c1a4-49d4-b199-535217159096   3Gi        RWO            Delete           Bound    default/civo-volume-test   civo-volume             3s

@kaihoffman
Copy link
Member

Thank you for the pull request @DamianZaremba 🙏

I have passed this on to my colleagues to double check and hopefully we can get it merged ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants