DevOps · Service
Kubernetes
A Kubernetes Service gives a stable network endpoint to one or more Pods. It hides changing Pod IP addresses and routes client traffic to the current matching backends.
Last updated
- Since
- v1.20 for stable appProtocol; EndpointSlices are documented
Syntax
apiVersion: v1
kind: Service
metadata:
name: <service-name>
spec:
selector: <label-selector>
ports:
- protocol: TCP
port: <service-port>
targetPort: <pod-port>In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
EndpointSliceIngressGateway APIClusterIPNodePortLoadBalancerExternalNameService without selectors