Expose Pods internally in the cluster.
Section: Services
ClusterIP Service YAML
yaml
yaml
apiVersion: v1
kind: Service
metadata:
name: api
spec:
selector:
app: api
ports:
- name: http
port: 80
targetPort: http
type: ClusterIPLearn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Services
LoadBalancer Service YAML
Request external load balancing from the platform.
Headless Service YAML
Expose individual Pod DNS records for stateful apps.