kuberneteskubernetes-service

Why is the service endpoint empty? Is it a bug in the official tutorial?


I am trying to learn k8s and following along in the official tutorials https://kubernetes.io/docs/tutorials/kubernetes-basics/expose/expose-interactive/

Why is the endpoint empty? The tutorial says that

We have now a running Service called kubernetes-bootcamp. Here we see that the Service received a unique cluster-IP, an internal port and an external-IP (the IP of the Node)

I only see <none> . This SO question says it should be name, not app, should it be name instead of app?

$ kubectl expose deployment/kubernetes-bootcamp --type="NodePort" --port 8080
service/kubernetes-bootcamp exposed

$ kubectl get services
NAME                  TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)          AGE
kubernetes            ClusterIP   10.96.0.1      <none>        443/TCP          9m13s
kubernetes-bootcamp   NodePort    10.101.46.87   <none>        8080:30568/TCP   7m49s

$ kubectl describe services/kubernetes-bootcamp
Name:                     kubernetes-bootcamp
Namespace:                default
Labels:                   app=kubernetes-bootcamp
Annotations:              <none>
Selector:                 app=kubernetes-bootcamp
Type:                     NodePort
IP Families:              <none>
IP:                       10.101.46.87
IPs:                      10.101.46.87
Port:                     <unset>  8080/TCP
TargetPort:               8080/TCP
NodePort:                 <unset>  30568/TCP
Endpoints:                172.18.0.4:8080
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   <none>


$ kubectl get services
NAME                  TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)          AGE
kubernetes            ClusterIP   10.96.0.1      <none>        443/TCP          9m13s
kubernetes-bootcamp   NodePort    10.101.46.87   <none>        8080:30568/TCP   7m49s

Solution

  • "External-IP is <none> when there is no load balancer" (Sander Van Vugt)