anchor.diff:  = Service Discovery for Microservices with Kubernetes
  +:icons:
  +:linkcss:
   :imagesdir: ../images
   :toc:
   
   This chapter shows an example of how different microservices within an application can use service discovery to locate each other in the infrastructure rather than via hardcoded IP addresses.
   
  -== Pre-requisites
  +=== Prerequisites
   
   A 3 master nodes and 5 worker nodes cluster as explained in the link:../cluster-install#multi-master-multi-node-multi-az-gossip-based-cluster[cluster-install] chapter.
   
   All configuration files for this chapter are in the `microservices` directory.
   
  -== Application architecture
  +=== Application Architecture
   
   The sample application uses three services:
   
  
positive.code: 
  . Get more details about the service:
  
    kubectl describe svc/webapp-service
    Name:			webapp-service
    Namespace:		default
    Labels:			<none>
  
negative.code: 
  Wait for ~3 mins for the load balancer to accept request.
  
  === Access Application
  
  Access the application using the following URLs with `curl` or via a browser:
  
    http://<host>
    http://<host>?greet=ho
    http://<host>?id=1
    http://<host>?greet=ho&id=1
  
  `<host>` is the value of the ingress load balancer's address:
  
    $ kubectl describe svc/webapp-service | grep Ingress | cut -c 27-
    
  
  === Delete application
  
  Delete the application with this command:
  
    $ kubectl delete -f templates/app.yml
  
  