dabin@ubuntu:~$ kubectl cluster-info Kubernetes master is running at https://192.168.0.103:6443 KubeDNS is running at https://192.168.0.103:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
k8s主节点部署后的情况
k8s本身不负责容器之间的通信,集群启动后,集群的Pod直接还不能通信,需要安装网络插件。
1 2 3 4 5 6 7 8 9 10 11 12 13
$ kubectl get node NAME STATUS ROLES AGE VERSION k8s-master NotReady master 5m8s v1.19.0 $ kubectl get pod -n kube-system -owide
$ kubectl describe nodes shitaibin-x Name: shitaibin-x Roles: master ... Conditions: Type Status LastHeartbeatTime LastTransitionTime Reason Message ---- ------ ----------------- ------------------ ------ ------- MemoryPressure False Wed, 28 Oct 2020 08:40:18 +0000 Wed, 28 Oct 2020 08:40:07 +0000 KubeletHasSufficientMemory kubelet has sufficient memory available DiskPressure False Wed, 28 Oct 2020 08:40:18 +0000 Wed, 28 Oct 2020 08:40:07 +0000 KubeletHasNoDiskPressure kubelet has no disk pressure PIDPressure False Wed, 28 Oct 2020 08:40:18 +0000 Wed, 28 Oct 2020 08:40:07 +0000 KubeletHasSufficientPID kubelet has sufficient PID available Ready False Wed, 28 Oct 2020 08:40:18 +0000 Wed, 28 Oct 2020 08:40:07 +0000 KubeletNotReady runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized .... Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal Starting 111s kubelet Starting kubelet. Normal NodeHasSufficientMemory 110s (x3 over 110s) kubelet Node shitaibin-x status is now: NodeHasSufficientMemory Normal NodeHasNoDiskPressure 110s (x3 over 110s) kubelet Node shitaibin-x status is now: NodeHasNoDiskPressure Normal NodeHasSufficientPID 110s (x3 over 110s) kubelet Node shitaibin-x status is now: NodeHasSufficientPID Normal NodeAllocatableEnforced 110s kubelet Updated Node Allocatable limit across pods Normal Starting 88s kubelet Starting kubelet. Normal NodeHasSufficientMemory 88s kubelet Node shitaibin-x status is now: NodeHasSufficientMemory Normal NodeHasNoDiskPressure 88s kubelet Node shitaibin-x status is now: NodeHasNoDiskPressure Normal NodeHasSufficientPID 88s kubelet Node shitaibin-x status is now: NodeHasSufficientPID Normal NodeAllocatableEnforced 87s kubelet Updated Node Allocatable limit across pods Normal Starting 66s kube-proxy Starting kube-proxy.
dabin@ubuntu:~$ kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')" serviceaccount/weave-net created clusterrole.rbac.authorization.k8s.io/weave-net created clusterrolebinding.rbac.authorization.k8s.io/weave-net created role.rbac.authorization.k8s.io/weave-net created rolebinding.rbac.authorization.k8s.io/weave-net created daemonset.apps/weave-net created
$ kubectl describe pod mysql Events: Type Reason Age From Message ---- ------ ---- ---- ------- Warning FailedScheduling 22s (x2 over 22s) default-scheduler 0/1 nodes are available: 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate.
[~]$ kubectl taint nodes shitaibin-x node-role.kubernetes.io/master- node/shitaibin-x untainted [~]$ [~]$ kubectl get nodes shitaibin-x -o yaml | grep -10 taint [~]$ [~]$ kubectl describe pod | grep -10 Events ... Events: Type Reason Age From Message ---- ------ ---- ---- ------- Warning FailedScheduling 27s (x7 over 7m38s) default-scheduler 0/1 nodes are available: 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate. Normal Scheduled 17s default-scheduler Successfully assigned default/mysql-0 to shitaibin-x Normal Pulled 15s kubelet Container image "mysql:5.6" already present on machine Normal Created 14s kubelet Created container mysql Normal Started 14s kubelet Started container mysql