三、集群可用性测试 1. 创建nginx ds # 写入配置 $ cat > nginx-ds.yml <<EOF apiVersion: v1 kind: Service metadata: name: nginx-ds labels: app: nginx-ds spec: type: NodePort selector: app: nginx-ds ports: - name: http port: 80 targetPort: 80 --- apiVersion: extensions/v1beta1 kind: DaemonSet metadata: name: nginx-ds labels: addonmanager.kubernetes.io/mode: Reconcile spec: template: metadata: labels: app: nginx-ds spec: containers: - name: my-nginx image: nginx:1.7.9 ports: - containerPort: 80 EOF # 创建ds $ kubectl create -f nginx-ds.yml 2. 检查各种ip连通性 # 检查各 Node 上的 Pod IP 连通性(主节点没有calico所以不能访问podip) $ kubectl get pods -o wide # 在每个worker节点上ping pod ip $ ping <pod-ip> # 检查service可达性 $ kubectl get svc # 在每个worker节点上访问服务(主节点没有proxy所以不能访问service-ip)