k8s.github.io

Kubernetes Services - ClusterIP

In this section we will take a look at services - ClusterIP in kubernetes

ClusterIP

What is a right way to establish connectivity between these services or tiers

To create a service of type ClusterIP

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-definition.yaml

To list the services

$ kubectl get services

srvc3

K8s Reference Docs: