• Home
  • Service Discovery

How to discover and route traffic to applications

Service Discovery

How to discover and route traffic to applications
Service Discovery

Distributing applications across a cluster can significantly complicate the way you design, run, and monitor an application. Kubernetes is an operating system that reduces the complexity of distributed computing. Service discovery is important because it allows you to find and access services that are distributed across a cluster. The Kubernetes Service resource is central to service discovery and makes it easier to connect applications across your cluster, compared to imperative application networking. With the Service resource, you can declare a policy and approach to access a set of Pods. Once you understand how Services can be declared and controlled, it should then be easier for you to design solutions orchestrated across a cluster.

The Service resource can be defined with these four types:

  • ClusterIP
  • NodePort
  • LoadBalancer
  • ExternalName

This lab covers the first three types, which solve your service discovery needs. The ExternalName type and other features like headless services are covered in another lab, Kubernetes Networking: External Services.

In this lab, you will learn how to:

    ☐ Expose an application with a service using just labels
    ☐ Expose an application using ClusterIP, NodePort, and LoadBalancer
    ☐ Set port, targetPorts, and nodePort settings
    ☐ Use kube-proxy and a DNS process as key control plane components for service discovery

  • LEVEL

    Beginner

  • DURATION

    30 minutes

  • UPDATED

    31 Dec, 2021