DevOps · Service
Nginx
A Kubernetes Service gives a stable network address to a group of Pods. It selects Pods by labels and sends traffic to their target port.
Last updated
Syntax
apiVersion: v1
kind: Service
metadata:
name: <service-name>
spec:
ports:
- port: <service-port>
targetPort: <pod-port>
protocol: TCP
selector:
<label-key>: <label-value>In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
PodDeploymentEndpointSliceClusterIPNodePortLoadBalancerCoreDNSService DNS