Kubernetes is giving junk external ip

7/29/2019

Kubernetes is giving junk external ip, check output of below command:

$ kubectl get svc frontend -n web-console

NAME       TYPE           CLUSTER-IP     EXTERNAL-IP        PORT(S)        AGE
frontend   LoadBalancer   100.68.90.01   a55ea503bbuddd...   80:31161/TCP   5d

Please help me to understand what's this external IP means

-- gaurav agnihotri
ignite
kubernetes

2 Answers

7/30/2019

The options that allows you expose your application for access from outside the cluster are:

  • Kubernetes Service of type LoadBalancer
  • Kubernetes Service of type ‘NodePort’ + Ingress

A Service in Kubernetes is an abstraction defining a logical set of Pods and an access policy and it can be exposed in different ways by specifying a type (ClusterIP, NodePort, LoadBalancer) in the service spec. The LoadBalancer type is the simplest approach.

Once the service is created, it has an external IP address as in your output:

$ kubectl get svc frontend -n web-console

NAME       TYPE           CLUSTER-IP     EXTERNAL-IP        PORT(S)        AGE
frontend   LoadBalancer   100.68.90.01   a55ea503bbuddd...   80:31161/TCP   5d

Now, service 'frontend' can be accessible from outside the cluster without the need for additional components like an Ingress.

To test the external IP run this curl command from your machine:

$ curl http://<external-ip>:<port>

where is the external IP address of your Service, and is the value of Port in your Service description.

ExternalIP gives possibility to access services from outside the cluster (ExternalIP is an endpoint). A ClusterIP type service with an ExternalIP can still be accessed inside the cluster using its service.namespace DNS name, but now it can also be accessed from its external endpoint, too.

-- muscat
Source: StackOverflow

7/29/2019

According to this : https://kubernetes.io/docs/concepts/services-networking/service/#external-ips

Traffic that ingresses into the cluster with the external IP (as destination IP), on the Service port, will be routed to one of the Service endpoints. externalIPs are not managed by Kubernetes and are the responsibility of the cluster administrator.

It seems you selected LoadBalancer type your cloud provider provided you a loadbalancer and that externalip is that loadbalancer dns name.

-- Fahri
Source: StackOverflow