标签:data- orm type title code border 二进制 boa play
1 [root@k8smaster01 ~]# kubectl get nodes
1 [root@k8smaster01 ~]# cd /opt/k8s/work 2 [root@k8smaster01 work]# cat > nginx-ds.yml <<EOF 3 apiVersion: v1 4 kind: Service 5 metadata: 6 name: nginx-ds 7 labels: 8 app: nginx-ds 9 spec: 10 type: NodePort 11 selector: 12 app: nginx-ds 13 ports: 14 - name: http 15 port: 80 16 targetPort: 80 17 --- 18 apiVersion: extensions/v1beta1 19 kind: DaemonSet 20 metadata: 21 name: nginx-ds 22 labels: 23 addonmanager.kubernetes.io/mode: Reconcile 24 spec: 25 template: 26 metadata: 27 labels: 28 app: nginx-ds 29 spec: 30 containers: 31 - name: my-nginx 32 image: nginx:1.7.9 33 ports: 34 - containerPort: 80 35 EOF 36 [root@k8smaster01 work]# kubectl create -f nginx-ds.yml
1 [root@k8smaster01 ~]# kubectl get pods -o wide|grep nginx-ds
1 [root@k8smaster01 ~]# source /opt/k8s/bin/environment.sh 2 [root@k8smaster01 ~]# for all_ip in ${ALL_IPS[@]} 3 do 4 echo ">>> ${all_ip}" 5 ssh ${all_ip} "ping -c 1 172.30.240.2" 6 ssh ${all_ip} "ping -c 1 172.30.248.2" 7 ssh ${all_ip} "ping -c 1 172.30.144.2" 8 ssh ${all_ip} "ping -c 1 172.30.192.2" 9 ssh ${all_ip} "ping -c 1 172.30.136.2" 10 done 11
1 [root@k8smaster01 ~]# kubectl get svc |grep nginx-ds 2 nginx-ds NodePort 10.254.168.17 <none> 80:32760/TCP 34m 3 [root@k8smaster01 ~]# source /opt/k8s/bin/environment.sh 4 [root@k8smaster01 ~]# for node_ip in ${NODE_IPS[@]} 5 do 6 echo ">>> ${node_ip}" 7 ssh ${node_ip} "curl -s 10.254.168.17" 8 done 9
1 [root@k8smaster01 ~]# source /opt/k8s/bin/environment.sh 2 [root@k8smaster01 ~]# for node_ip in ${NODE_IPS[@]} 3 do 4 echo ">>> ${node_ip}" 5 ssh ${node_ip} "curl -s ${node_ip}:32760" 6 done
标签:data- orm type title code border 二进制 boa play
原文地址:https://www.cnblogs.com/itzgr/p/11883450.html