Kubectl Run Nginx--image=nginx--replicas=3
[[email protected] ~]# Kubectl get pod-o Wide
NAME ready STATUS Restarts IP NODE
NGINX-8586CF59-C5QPW 1/1 Running 0 8m 172.17.96.2 192.168.56.12
nginx-8586cf59-lm85p 1/1 Running 0 8m 172.17.2.2 192.168.56.11
NGINX-8586CF59-N58BM 1/1 Running 0 8m 172.17.96.3 192.168.56.12
[[email protected] ~]# kubectl get pod
NAME Ready STATUS Restarts
NGINX-8586CF59-C5QPW 1/1 Running 0 8m
nginx-8586cf59-lm85p 1/1 Running 0 8m
NGINX-8586CF59-N58BM 1/1 Running 0 8m
[Email protected] ~]#
[[email protected] ~]# Kubectl Get Service
NAME TYPE cluster-ip external-ip PORT (S) Age
Kubernetes clusterip 10.10.10.1 <none> 443/tcp 3h
[Email protected] ~]# kubectl expose deployment Nginx--port=88--target-port=80--type=nodeport
Service "Nginx" exposed
[[email protected] ~]# Kubectl Get Service
NAME TYPE cluster-ip external-ip PORT (S) Age
Kubernetes clusterip 10.10.10.1 <none> 443/tcp 3h
Nginx nodeport 10.10.10.86 <none> 88:35712/tcp 2s
[[email protected] ~]# Kubectl Get service Nginx
NAME TYPE cluster-ip external-ip PORT (S) Age
Nginx nodeport 10.10.10.86 <none> 88:35712/tcp 21s
[Email protected] ~]#
Node nodes test
k8s-07-Test Demo k8s