在之前的文章里,我们已经安装好了k8s集群,你可以测试k8s集群是否成功:
在Kubernetes集群中创建一个pod,验证是否正常运行:
```bash [root@k8s-master ~]# kubectl get nodes NAME STATUS ROLES AGE VERSION k8s-master Ready master 18m v1.17.0 k8s-node1 Ready <none> 78s v1.17.0 k8s-node2 NotReady <none> 16s v1.17.0
如果出现 notready, 稍等一会就可以了。
-n 指定命名空间
[root@k8s-master ~]# kubectl get pods -n kube-system NAME READY STATUS RESTARTS AGE coredns-9d85f5447-5qh6p 1/1 Running 0 39m coredns-9d85f5447-8dntr 1/1 Running 0 39m etcd-k8s-master 1/1 Running 0 39m kube-apiserver-k8s-master 1/1 Running 0 39m kube-controller-manager-k8s-master 1/1 Running 0 39m kube-flannel-ds-amd64-cl9rb 1/1