This step is different whether you are using kubernetes over google cloud (where External IP is shown by issuing kubectl get svc ) or over amazon aws. After launching your cluster (aws or gcloud) then deploying your app using kubectl create -f some-deployment.yaml you issue
kubectl expose rs your-pod-name --type="LoadBalancer"
to expose your app ... then chill a few minutes until command
kubectl get pods
responds back with column STATUS has value Running ... only then issue
kubectl get svc
which after a few minutes will show EXTERNAL-IP on gcloud as per
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes 10.123.240.1 <none> 443/TCP 10m
loudspeed-deployment-210 10.123.247.54 104.196.113.166 3000/TCP,80/TCP,443/TCP 1m
mongo 10.123.244.245 <none> 27017/TCP 5m
whereas on aws the EXTERNAL-IP will partially display the URL of your LoadBalancer Ingress ... to see the full URL just issue
kubectl describe svc
typical output would be
Labels: app=my-cool-app,pod-template-hash=494629853
Selector: app=my-cool-app,pod-template-hash=494629853
Type: LoadBalancer
IP: 10.0.154.138
LoadBalancer Ingress: a53bigscarystring33e-20075.us-east-1.elb.amazonaws.com
Port: port-1 80/TCP
NodePort: port-1 30487/TCP
Endpoints: 10.244.0.3:80
Port: port-2 443/TCP
NodePort: port-2 32698/TCP
Endpoints: 10.244.0.3:443
Session Affinity: None
Events:
FirstSeen LastSeen Count From SubobjectPath Type Reason Message
--------- -------- ----- ---- ------------- -------- ------ -------
14m 14m 1 {service-controller } Normal CreatingLoadBalancer Creating load balancer
13m 13m 1 {service-controller } Normal CreatedLoadBalancer Created load balancer
Name: mongo
Labels: name=mongo
Selector: name=mongo
Type: ClusterIP
IP: 10.0.63.81
Port: <unset> 27017/TCP
Endpoints: 10.244.0.4:27017
Session Affinity: None
No events.
note in above value of
LoadBalancer Ingress: a53bigscarystring33e-20075.us-east-1.elb.amazonaws.com
that is your External URL which is visible from command line using
curl a53bigscarystring33e-20075.us-east-1.elb.amazonaws.com
and is typically mapped to your publicly visible domain in your aws Route 53 console on the Resource Type A auto refreshed picklist
See details like ( we do not automatically open NodePort services in the AWS firewall) https://github.com/kubernetes/kubernetes/blob/release-1.3/docs/design/aws_under_the_hood.md