luksa / kubernetes-in-action

Code from the Kubernetes in Action book

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chapter 6: A pod using a PersistentVolumeClaim volume: mongodb-pod-pvc.yaml

georemo opened this issue · comments

mongodb pod wont start:

$ kubectl describe pod mongodb
Name:         mongodb
Namespace:    default
Priority:     0
Node:         multinode-demo/192.168.58.2
Start Time:   Sun, 31 Jul 2022 13:29:07 +0300
Labels:       <none>
Annotations:  <none>
Status:       Pending
IP:           
IPs:          <none>
Containers:
  mongodb:
    Container ID:   
    Image:          mongo
    Image ID:       
    Port:           27017/TCP
    Host Port:      0/TCP
    State:          Waiting
      Reason:       ContainerCreating
    Ready:          False
    Restart Count:  0
    Environment:    <none>
    Mounts:
      /data/db from mongodb-data (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-qwmkl (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             False 
  ContainersReady   False 
  PodScheduled      True 
Volumes:
  mongodb-data:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  mongodb-pvc
    ReadOnly:   false
  kube-api-access-qwmkl:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
QoS Class:                   BestEffort
Node-Selectors:              <none>
Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type     Reason       Age                  From               Message
  ----     ------       ----                 ----               -------
  Normal   Scheduled    94m                  default-scheduler  Successfully assigned default/mongodb to multinode-demo
  Warning  FailedMount  51m (x2 over 87m)    kubelet            Unable to attach or mount volumes: unmounted volumes=[mongodb-data], unattached volumes=[kube-api-access-qwmkl mongodb-data]: timed out waiting for the condition
  Warning  FailedMount  2m4s (x20 over 92m)  kubelet            Unable to attach or mount volumes: unmounted volumes=[mongodb-data], unattached volumes=[mongodb-data kube-api-access-qwmkl]: timed out waiting for the condition