kubernetes question

Posted on

hi,
i have a master kubernete -test5-and worker -test55.
i try to create a pod with a container and a volume mounted in it.
[root@test5 ~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
test5 Ready master 35m v1.15.0
test55 NotReady 13m v1.15.0

[root@test5 ~]# kubectl get pods
NAME READY STATUS RESTARTS AGE
demo 0/1 Pending 0 11m

[root@test5 ~]# kubectl get pv
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
demo 1Gi RWO Retain Bound default/demo manual 12m

[root@test5 ~]# kubectl get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
demo Bound demo 1Gi RWO manual 12m

the above were created with kubectl create -f name.yaml

more yy.yaml
kind: PersistentVolume
apiVersion: v1
metadata:
name: demo
labels:
type: local
spec:
storageClassName: manual
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/data"

more yycopy.yaml
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: demo
spec:
storageClassName: manual
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
more y555.yaml
apiVersion: v1
kind: Pod
metadata:
name: demo
spec:
containers:
- image: alpine
name: test
imagePullPolicy: Always
volumeMounts:
- mountPath: "/mnt/data"
name: demo
volumes:
- name: demo
persistentVolumeClaim:
claimName: demo

why pod demo is in pending?
tail /var/log/messages
Jul 8 10:44:14 test5 kubelet: E0708 10:44:14.033135 31708 cni.go:352] Error deleting kube-system_coredns-5c98db65d4-99rb7/7815af584b28831e6b01d9c7ff6e672037735afc25bb6237f835fe7abfeda05b from network weave-net/weave: Delete http://127.0.0.1:6784/ip/7815af584b28831e6b01d9c7ff6e672037735afc25bb6237f835fe7abfeda05b: dial tcp 127.0.0.1:6784: connect: connection refused
Jul 8 10:44:14 test5 dockerd-current: time="2019-07-08T10:44:14.033676175-04:00" level=error msg="Handler for POST /containers/7815af584b28831e6b01d9c7ff6e672037735afc25bb6237f835fe7abfeda05b/stop returned error: Container 7815af584b28831e6b01d9c7ff6e672037735afc25bb6237f835fe7abfeda05b is already stopped"
Jul 8 10:44:14 test5 kubelet: E0708 10:44:14.034029 31708 remote_runtime.go:128] StopPodSandbox "7815af584b28831e6b01d9c7ff6e672037735afc25bb6237f835fe7abfeda05b" from runtime service failed: rpc error: code = Unknown desc = NetworkPlugin cni failed to teardown pod "coredns-5c98db65d4-99rb7_kube-system" network: Delete http://127.0.0.1:6784/ip/7815af584b28831e6b01d9c7ff6e672037735afc25bb6237f835fe7abfeda05b: dial tcp 127.0.0.1:6784: connect: connection refused
Jul 8 10:44:14 test5 kubelet: E0708 10:44:14.034060 31708 kuberuntime_gc.go:170] Failed to stop sandbox "7815af584b28831e6b01d9c7ff6e672037735afc25bb6237f835fe7abfeda05b" before removing: rpc error: code = Unknown desc = NetworkPlugin cni failed to teardown pod "coredns-5c98db65d4-99rb7_kube-system" network: Delete http://127.0.0.1:6784/ip/7815af584b28831e6b01d9c7ff6e672037735afc25bb6237f835fe7abfeda05b: dial tcp 127.0.0.1:6784: connect: connection refused
Jul 8 10:44:14 test5 kubelet: W0708 10:44:14.035736 31708 cni.go:309] CNI failed to retrieve network namespace path: cannot find network namespace for the terminated container "221ed3e561255771721a20885a4971210fd34bebdfe7234be763527a9d729754"
Jul 8 10:44:14 test5 kubelet: weave-cni: unable to release IP address: Delete http://127.0.0.1:6784/ip/221ed3e561255771721a20885a4971210fd34bebdfe7234be763527a9d729754: dial tcp 127.0.0.1:6784: connect: connection refused
Jul 8 10:44:14 test5 kubelet: E0708 10:44:14.071064 31708 cni.go:352] Error deleting kube-system_coredns-5c98db65d4-zfsrl/221ed3e561255771721a20885a4971210fd34bebdfe7234be763527a9d729754 from network weave-net/weave: Delete http://127.0.0.1:6784/ip/221ed3e561255771721a20885a4971210fd34bebdfe7234be763527a9d729754: dial tcp 127.0.0.1:6784: connect: connection refused
Jul 8 10:44:14 test5 dockerd-current: time="2019-07-08T10:44:14.071715154-04:00" level=error msg="Handler for POST /containers/221ed3e561255771721a20885a4971210fd34bebdfe7234be763527a9d729754/stop returned error: Container 221ed3e561255771721a20885a4971210fd34bebdfe7234be763527a9d729754 is already stopped"
Jul 8 10:44:14 test5 kubelet: E0708 10:44:14.072075 31708 remote_runtime.go:128] StopPodSandbox "221ed3e561255771721a20885a4971210fd34bebdfe7234be763527a9d729754" from runtime service failed: rpc error: code = Unknown desc = NetworkPlugin cni failed to teardown pod "coredns-5c98db65d4-zfsrl_kube-system" network: Delete http://127.0.0.1:6784/ip/221ed3e561255771721a20885a4971210fd34bebdfe7234be763527a9d729754: dial tcp 127.0.0.1:6784: connect: connection refused
Jul 8 10:44:14 test5 kubelet: E0708 10:44:14.072124 31708 kuberuntime_gc.go:170] Failed to stop sandbox "221ed3e561255771721a20885a4971210fd34bebdfe7234be763527a9d729754" before removing: rpc error: code = Unknown desc = NetworkPlugin cni failed to teardown pod "coredns-5c98db65d4-zfsrl_kube-system" network: Delete http://127.0.0.1:6784/ip/221ed3e561255771721a20885a4971210fd34bebdfe7234be763527a9d729754: dial tcp 127.0.0.1:6784: connect: connection refused