Kubernetes Tutorial — Part 4: Services, Networking, and Load Balancing

By Suraj Ahir March 13, 2026 7 min read

← Part 3 Kubernetes Tutorial · Part 4 of 12 Part 5 →
Kubernetes - Services
Kubernetes - Services

Pods get IP addresses, but those addresses change every time a pod restarts. Services provide a stable address that routes traffic to healthy pods.

Service Types

ClusterIP gives an internal IP only reachable within the cluster. NodePort opens a port on every node. LoadBalancer provisions a cloud load balancer for external traffic.

service.yaml
apiVersion: v1
kind: Service
metadata:
  name: web-service
spec:
  type: LoadBalancer
  selector:
    app: web
  ports:
  - port: 80
    targetPort: 8080

The selector matches pods with the label app: web. Add more pods — the service includes them automatically. Kubernetes also runs internal DNS, so any pod can reach this service at web-service.default.svc.cluster.local.

In Part 5, we cover ConfigMaps and Secrets for managing application configuration.

← Part 3 Kubernetes Tutorial · Part 4 of 12 Part 5 →
← Back to Blog
Disclaimer: This content is for educational purposes only. SRJahir Tech does not guarantee any specific outcome, job placement, or exam result. Learning requires consistent effort and practical application.