Difficulty: beginner
Estimated Time: 20-30 minutes

Digital Academy Logo

Welcome to the Digial Academy's "Kubernetes Fundamentals" series. This is Module 1 - Introduction to Services.

In this lab, we will learn how Kubernetes Services provide access to Pods and Deployments.

We'll cover the following topics:

  • ClusterIP
  • NodePort
  • Pod-to-Pod communication

For more information, see the Kubernetes documentation.

Developer(s): William Hearn and Zachary Seguin

Now that we've learned about Services work, let's work on a voting app.

Module 1 - Introduction to Services

Step 1 of 7

Intro to Services

Although each Pod has a unique IP address, those IPs are not exposed outside the cluster without a Service. Services allow your applications to receive traffic. Services can be exposed in different ways by specifying a type in the ServiceSpec:

  • ClusterIP (default) - Exposes the Service on an internal IP in the cluster. This type makes the Service only reachable from within the cluster.
  • NodePort - Exposes the Service on the same port of each selected Node in the cluster using NAT. Makes a Service accessible from outside the cluster using NodeIP:NodePort. Superset of ClusterIP.
  • LoadBalancer - Creates an external load balancer in the current cloud (if supported) and assigns a fixed, external IP to the Service. Superset of NodePort.
  • ExternalName - Exposes the Service using an arbitrary name (specified by externalName in the spec) by returning a CNAME record with the name. No proxy is used. This type requires v1.7 or higher of kube-dns (now core-dns)

We'll cover LoadBalancers in our next demo after this lab, and ExternalName is beyond the scope of this course.