kube-flannel
kubectl get pods --namespace kube-flannel -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
kube-flannel-ds-428np 1/1 Running 6 (26h ago) 26h 192.168.56.42 kube-node2 <none> <none>
kube-flannel-ds-dhdlm 1/1 Running 41 (26h ago) 29h 192.168.56.41 kube-node1 <none> <none>
kube-flannel-ds-k8zf8 1/1 Running 0 29h 192.168.56.40 kube-master <none> <none>
kubectl get pod
NAME READY STATUS RESTARTS AGE
mynginx-56766fcf49-g6d85 1/1 Running 0 5h22m
kubectl get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 29h
mynginx NodePort 10.105.145.254 <none> 8080:30686/TCP 5h54m
mynginx
to 2
replicaskubectl scale deploy mynginx --replicas=2
deployment.apps/mynginx scaled
autoscale
kubectl autoscale deploy mynginx --min 1 --max 5
horizontalpodautoscaler.autoscaling/mynginx autoscaled
kubectl get pod
NAME READY STATUS RESTARTS AGE
mynginx-56766fcf49-6hcc6 1/1 Running 0 118s
mynginx-56766fcf49-g6d85 1/1 Running 0 5h22m
Before to check the nginx, connect to each pod and modify the index.html
kubectl exec -ti mynginx-56766fcf49-g6d85 -- /bin/bas
echo "Pod 1" > /usr/share/nginx/html/index.html
kubectl exec -ti mynginx-56766fcf49-6hcc6 -- /bin/bas
echo "Pod 2" > /usr/share/nginx/html/index.html
192.168.56.41
(kube-node1) on port 30686
curl 192.168.56.41:30686
curl: (7) Failed to connect to 192.168.56.41 port 30686: No route to host
curl 192.168.56.41:30686
Pod 2
192.168.56.42
(kube-node2) on port 30686
curl 192.168.56.42:30686
Pod 1
curl 192.168.56.42:30686
curl: (7) Failed to connect to 192.168.56.42 port 30686: No route to host