ClusterIP is a logical grouping of similar containers for inter-communication between containers on a Pod.
eg: clusterIp for database container for use by container having backend logic
service-def.yml
apiVersion: v1
kind: Service
metadata:
name: image-processing
labels:
app: myapp
spec:
type: ClusterIP
ports:
- port: 80 (port on the ClusterIP service)
targetPort: 8080 (port on the target container)
selector:
tier: backend
eg: clusterIp for database container for use by container having backend logic
service-def.yml
apiVersion: v1
kind: Service
metadata:
name: image-processing
labels:
app: myapp
spec:
type: ClusterIP
ports:
- port: 80 (port on the ClusterIP service)
targetPort: 8080 (port on the target container)
selector:
tier: backend