Home

clusterIP

ClusterIP is the default Service type in Kubernetes that provides a stable virtual IP address (the Cluster IP) inside a cluster. It enables access to a set of pods chosen by a label selector through that internal IP, without exposing the service to external networks. Clients within the cluster can reach the service using the virtual IP or the standard DNS name for the service.

When a ClusterIP service is created, Kubernetes creates a Service object and an Endpoints object based on

The service is discoverable inside the cluster via DNS: serviceName.namespace.svc.cluster.local, or via its short name within

A ClusterIP service defines a port and a targetPort. The port is the service port exposed to

By default, ClusterIP services are accessible only within the cluster. To expose the service externally, you

You manage ClusterIP services with standard YAML manifests that specify metadata, spec.selector, spec.ports, and optionally spec.clusterIP,

the
selector.
The
kube-proxy
on
each
node
configures
networking
rules
(iptables
or
IPVS)
to
load
balance
traffic
addressed
to
the
ClusterIP
across
the
Pod
IPs
that
match
the
selector.
the
same
namespace.
This
enables
stable
addressing
even
as
pod
IPs
change.
clients
within
the
cluster,
while
targetPort
is
the
port
on
the
pods.
Protocols
are
typically
TCP,
but
UDP
is
supported
as
well.
SessionAffinity
can
be
configured,
with
the
default
being
none.
can
create
a
NodePort
or
a
LoadBalancer
service,
or
front
it
with
an
Ingress,
depending
on
the
cluster
provider.
which
may
be
assigned
automatically
or
set
explicitly.