- Take me to Video Tutorial
In this section we will take a look at services - ClusterIP
in kubernetes
-
In this case the service creates a
Virtual IP
inside the cluster to enable communication between different services such as a set of frontend servers to a set of backend servers.
-
A kubernetes service can help us group the pods together and provide a single interface to access the pod in a group.
apiVersion: v1
kind: Service
metadata:
name: back-end
spec:
types: ClusterIP
ports:
- targetPort: 80
port: 80
selector:
app: myapp
type: back-end
$ kubectl create -f service-defination.yaml
$ kubectl get services
K8s Reference Docs: