[root@master ~]# kc get svc NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE busybox ClusterIP 10.1.138.149 <none> 80/TCP 49d kubernetes ClusterIP 10.1.0.1 <none> 443/TCP 67d my-nginx ClusterIP 10.1.226.181 <none> 80/TCP 3h14m
# printenv | grep -i nginx MY_NGINX_PORT=tcp://10.1.226.181:80 MY_NGINX_SERVICE_PORT=80 HOSTNAME=my-nginx-6d97ddfff5-m6cjt MY_NGINX_PORT_80_TCP_ADDR=10.1.226.181 MY_NGINX_PORT_80_TCP_PORT=80 MY_NGINX_PORT_80_TCP_PROTO=tcp MY_NGINX_PORT_80_TCP=tcp://10.1.226.181:80 NGINX_VERSION=1.19.4 MY_NGINX_SERVICE_HOST=10.1.226.181
[root@master Chapter6]# kubectl exec -it my-nginx-6d97ddfff5-rxpjt sh kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [C
|