...

/

Accessing Apps from Outside the Cluster

Accessing Apps from Outside the Cluster

Learn how we can access an application from outside the cluster using Services.

We'll cover the following...

NodePort Services

NodePort Services build on top of ClusterIP Services by adding a dedicated port on every cluster node that external clients can use. We call this dedicated port the NodePort.

The following YAML shows a NodePort Service called skippy.

Press + to interact
apiVersion: v1
kind: Service
metadata:
name: skippy <<==== Registered with the internal cluster DNS (ClusterIP)
spec:
type: NodePort <<==== Service type
ports:
- port: 8080 <<==== ClusterIP port
targetPort: 9000 <<==== Application port in container
nodePort: 30050 <<==== External port on every cluster node (NodePort)
selector:
app: hello-world

Posting this to the cluster will create a ClusterIP Service with the usual internally routable IP and DNS name. It will also create port 30050 on every cluster node and map it back to the ClusterIP. ...