[root@xuegod63 ~]# kubectl exec -it my-nginx-5b56ccd65f-7xzr4 -- /bin/bash root@my-nginx-69f769d56f-bb7hs:/# apt-get update root@my-nginx-5b56ccd65f-7xzr4:/# curl my-nginx.default.svc.cluster.local <!DOCTYPE html> <h1>Welcome to nginx!</h1> root@my-nginx-5b56ccd65f-7xzr4:/# exit
或省去域名后缀,即
服务名.命名空间.svc 服务名.命名空间
比如:
curl sysinfoapi.default.svc/api/Health/Get
curl sysinfoapi.default/api/Health/Get