[outdated] Juju, Kubernetes and microk8s

【resolved】

# microk8s.kubectl -n test get all,pvc,pv,sc
NAME                              READY   STATUS    RESTARTS   AGE
pod/juju-operator-mariadb-k8s-0   0/1     Pending   0          2d3h

NAME                                         READY   AGE
statefulset.apps/juju-operator-mariadb-k8s   0/1     2d3h

NAME                                                                            STATUS    VOLUME   CAPACITY   ACCESS MODES   STORAGECLASS        AGE
persistentvolumeclaim/mariadb-k8s-operator-volume-juju-operator-mariadb-k8s-0   Pending                                      microk8s-hostpath   2d3h

NAME                                                      PROVISIONER            AGE
storageclass.storage.k8s.io/microk8s-hostpath (default)   microk8s.io/hostpath   2d4h

I think pv should be ready first before pod, so I described the “persistentvolumeclaim/mariadb-k8s-operator-volume-juju-operator-mariadb-k8s-0”

# microk8s.kubectl -n test describe  persistentvolumeclaim/mariadb-k8s-operator-volume-juju-operator-mariadb-k8s-0 
Name:          mariadb-k8s-operator-volume-juju-operator-mariadb-k8s-0
Namespace:     test
StorageClass:  microk8s-hostpath
Status:        Pending
Volume:        
Labels:        juju-operator=mariadb-k8s
Annotations:   volume.beta.kubernetes.io/storage-provisioner: microk8s.io/hostpath
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      
Access Modes:  
VolumeMode:    Filesystem
Events:
  Type       Reason                Age                      From                         Message
  ----       ------                ----                     ----                         -------
  Normal     ExternalProvisioning  3m4s (x12364 over 2d3h)  persistentvolume-controller  waiting for a volume to be created, either by external provisioner "microk8s.io/hostpath" or manually created by system administrator
Mounted By:  juju-operator-mariadb-k8s-0

I search ”waiting for a volume to be created, either by external provisioner “microk8s.io/hostpath” or manually created by system administrator" in google.

And then I find my kube-system build failed.

# microk8s.kubectl get pod -n kube-system
NAME                                    READY   STATUS    RESTARTS   AGE
hostpath-provisioner-599db8d5fb-g2jf8   0/1     Running   0          3d
kube-dns-6ccd496668-47szk               0/3     Running   0          19h

# microk8s.kubectl describe pod/hostpath-provisioner-599db8d5fb-g2jf8

failed pulling image "k8s.gcr.io/pause:3.1": Error response from daemon: Get https://k8s.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

So i edit /var/snap/microk8s/354/args/dockerd-env
Open the https_proxy config.

Now I had fixed the problem. Thanks, wallyworld

1 Like