Accessing Apps From Inside the Cluster

Let's discuss the idea of accessing Services from inside the cluster.

ClusterIP Services

ClusterIP is the default. It gets a name and IP that is programmed into the internal network fabric and is only accessible from inside the cluster. This means:

  • The IP is only routable on the internal network

  • The name is automatically registered with the cluster’s internal DNS

  • All containers are pre-programmed to use the cluster’s DNS to resolve names

Example of ClusterIP Service

Let’s consider an example.

We’re deploying an application called skippy, and we want other applications on the cluster to access it by its name. To satisfy these requirements, we create a new ClusterIP Service called skippy. Kubernetes creates the Service, assigns it an internal IP, and creates the DNS records in the cluster’s internal DNS. Kubernetes also configures all containers on the cluster to use the cluster DNS for name resolution. This means every app on the cluster can connect to the new app using the skippy name.

Get hands-on with 1400+ tech skills courses.