Skip to content
masterclass Buddy

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.

Subscribe
  • Pod
  • Deployment
  • EndpointSlice
  • ClusterIP
  • NodePort
  • LoadBalancer
  • CoreDNS
  • Service DNS

Source: Connecting Applications with Services | Kubernetes. Checked 2026-11-03.