Welcome to the Linux Foundation Forum!

Want help with Lab 4.1

Hello all,
I would like some help: I cannot get the chart "bitnami/wordpress" running when following the instructions. Here are the technical information:

I am running a Kubernetes cluster set up with kubeadm on 2 nodes (master and worker) in 2 VMs installed in Google cloud platform

I do have a StorageClass set as default:

[email protected]:~$ k get storageclass
NAME                 PROVISIONER            RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
standard (default)   kubernetes.io/gce-pd   Delete          Immediate           false                  3h51m

kube-dns is enabled:

[email protected]:~$ k get svc -n kube-system
NAME       TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)                  AGE
kube-dns   ClusterIP   10.96.0.10   <none>        53/UDP,53/TCP,9153/TCP   37d

But then, when I try to install the chart with

helm install wordpress bitnami/wordpress --version=9.2.5 --set=service.type=NodePort --set=service.nodePorts.http=30001

both pods are in PENDING state:

[email protected]:~$ k get all
NAME                            READY   STATUS    RESTARTS   AGE
...
pod/wordpress-5c8cc7769-pg8mg   0/1     Pending   0          3h42m
pod/wordpress-mariadb-0         0/1     Pending   0          3h42m
...

I tried describing them and got

Events:
  Type     Reason            Age                    From               Message
  ----     ------            ----                   ----               -------
  Warning  FailedScheduling  3h40m (x4 over 3h43m)  default-scheduler  running "VolumeBinding" filter plugin for pod "wordpress-mariadb-0": pod has unbound immediate PersistentVolumeClaims

and indeed, the PVCs are PENDING:

[email protected]:~$ k get pvc
NAME                       STATUS    VOLUME       CAPACITY   ACCESS MODES   STORAGECLASS   AGE
data-wordpress-mariadb-0   Pending                                                         4h8m
wordpress                  Pending                                          standard       3h42m

🤔 What did I miss?

Comments

  • chrispokornichrispokorni Posts: 671

    Hi @dtnguyen,

    It seems your PVs may not be created. And when PVCs are not bound to their respective PVs, the Pods remain in a Pending state, until Kubelet is able to resolve the storage dependency.

    Can you describe the PVC after you try to deploy the chart to see if there are any warnings or errors there?

    Regards,
    -Chris

  • dtnguyendtnguyen Posts: 4

    Hello @chrispokorni,
    Thank you for your answer. Here are the output:

    [email protected]:~$ k get pvc
    NAME                       STATUS    VOLUME       CAPACITY   ACCESS MODES   STORAGECLASS   AGE
    data-wordpress-mariadb-0   Pending                                                         3d21h
    registry-claim0            Bound     registryvm   200Mi      RWO                           36d
    [email protected]:~$ k describe pvc data-wordpress-mariadb-0
    Name:          data-wordpress-mariadb-0
    Namespace:     default
    StorageClass:  
    Status:        Pending
    Volume:        
    Labels:        app=mariadb
                   component=master
                   heritage=Helm
                   release=wordpress
    Annotations:   <none>
    Finalizers:    [kubernetes.io/pvc-protection]
    Capacity:      
    Access Modes:  
    VolumeMode:    Filesystem
    Mounted By:    <none>
    Events:
      Type    Reason         Age                      From                         Message
      ----    ------         ----                     ----                         -------
      Normal  FailedBinding  3d21h (x102 over 3d21h)  persistentvolume-controller  no persistent volumes available for this claim and no storage class is set
      Normal  FailedBinding  3d16h (x181 over 3d17h)  persistentvolume-controller  no persistent volumes available for this claim and no storage class is set
    ...
    

    I was aware of this no available PV issue. I lowered PVC spec to adapt to my VMs (a little more than 10 Gi free disk space):

    spec: 
      accessModes: 
      - "ReadWriteOnce" 
      resources: 
        requests: 
          storage: "1Gi"
    

    and launch the app from the generated .yaml template file - but that did not work.

  • dtnguyendtnguyen Posts: 4
    edited August 5

    PS: thanks to dynamic provisioning, I do not have to create PVs myself, do I? (Anyway, PV creation is not mentioned in lab instructions).

  • chrispokornichrispokorni Posts: 671

    Hi @dtnguyen,

    It seems that you are not quite following the instructions provided in the lab manual. And you have deviated from the instructions, beginning with the Kubernetes cluster setup. This has implications on most subsequent lab exercises, starting as early as Lab 4.

    The hostpath storage class used in the lab exercise fits the needs of the microk8s cluster. Using a gce-pd provisioned introduces new requirements. And this may or may not work depending on how you bootstrapped your Kubernetes cluster on GCE.

    I would recommend following the lab book instructions from the first lab exercise, so you can focus on learning the new concepts instead of trying to retrofit the exercise to work on your specific environment. Once you have mastered the new concepts, then move to an environment that you may be more familiar with, such as Kubernetes on GCE and possibly gce-pd for storage provisioning.

    Regards,
    -Chris

  • dtnguyendtnguyen Posts: 4
    edited August 6

    Once again, I sincerely thank you for your help, and I do think your recommendation is right and I'll follow it.

    I just want to point out that my cluster setting, though somehow deviated from, conforms to the instructions:
    In Section 3 / Introduction /Section overview:
    "If you already have a cluster to use (cloud-based or local), you are more than welcome to use that instead"
    In Lab 3.1 - Creating a New Cluster Using MicroK8s:
    "If you already have an existing cluster, you may opt to skip this section and move on."
    And you understand, when one does things correctly, one expects things to work :smiley: Here it doesn't and I still do not know why. But what you said is absolutely right, let's focus on the point of this course.

Sign In or Register to comment.