K8S(十)——验证kubernetes集群

一、在一个节点配置资源清单

[root@sx7-22 ~]# vim nginx-ds.yaml
apiVersion: extensions/v1beta1 kind: DaemonSet metadata: name: nginx-ds spec: template: metadata: labels: app: nginx-ds spec: containers: - name: my-nginx image: harbor.od.com/public/nginx:v1.7.9 ports: - containerPort: 80

二、配置和检查

[root@sx7-22 ~]# kubectl create -f nginx-ds.yaml
daemonset.extensions/nginx-ds created
[root@sx7-22 ~]# kubectl get pods
[root@sx7-22 ~]# kubectl get pods -o wide
[root@sx7-22 ~]# curl 172.7.22.2

三、验证集群是否ok

[root@sx7-22 ~]# kubectl get pods
[root@sx7-22 ~]# kubectl get cs
[root@sx7-22 ~]# kubectl get nodes

 

posted @ 2020-05-18 17:12  跑起来啊  阅读(599)  评论(0编辑  收藏  举报