Kubernetes · Resource
Service
A Kubernetes Service gives clients a stable network endpoint for a changing group of Pods. It uses selectors and EndpointSlices to route traffic to matching backends.
Last updated
- Since
- v1.21 for stable EndpointSlices; v1.20 for stable appProtoco
Syntax
apiVersion: v1
kind: Service
metadata:
name: <name>
spec:
selector: <label-selector>
ports:
- port: <service-port>
targetPort: <pod-port>In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
PodEndpointSliceIngressGateway APIClusterIPNodePortLoadBalancerExternalName