Menu
Coddy logo textTech

Service Types

Part of the Introduction to Kubernetes section of Coddy's Terminal journey. Lesson 18 of 45.

A Service has a type that decides who can reach it. The default, ClusterIP, gives it an address that only works inside the cluster: perfect for a database that only your own Pods should talk to.

A NodePort Service also opens a port in the range 30000-32767 on every node, so it can be reached from outside the cluster at <node IP>:<node port>:

kubectl expose deployment web --port=80 --type=NodePort

In the Service list its PORT(S) reads like 80:30037/TCP: port 80 inside, port 30037 on the node.

A LoadBalancer Service asks your cloud provider for a real external IP address. On a local cluster there is no cloud to ask, so its EXTERNAL-IP stays <pending> forever.

challenge icon

Challenge

Beginner

Create a Deployment named web from the nginx image, expose it on port 80 as a NodePort Service, then list the Services to see the node port.

Try it yourself

Terminal
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Introduction to Kubernetes

Practice on your own: Terminal playground