Consuming RESTful services orchestrated by Kubernetes

8/30/2018

How do you consume a service that is being orchestrated by Kubernetes? What does the calling statement look like. When consuming a normal RESTful web service, you might use RestTemplate (for Java) and specify the URL. How does this differ when Kubernetes creates and destroys occurrences of the service?

-- user3393354
kubernetes
microservices
rest

1 Answer

8/30/2018

Internally, use kubernetes service of ClusterIp type (can also be headless). Externally use service of NodePort or LoadBalancer type to expose your application directly, or Ingress (assuming you have ingress controller deployed/available) to define HTTP(S) based routing from external HTTP(S) level loadbalancer by vhost/path.

-- Radek 'Goblin' Pieczonka
Source: StackOverflow