Cloud Intermediate
Kubernetes Services and Networking¶
KubernetesServicesNetworking 3 min read
ClusterIP, NodePort, LoadBalancer and the Kubernetes networking model.
Service Types¶
# ClusterIP — internal (default)
apiVersion: v1
kind: Service
metadata:
name: api-service
spec:
selector: {app: api}
ports: [{port: 80, targetPort: 8080}]
# LoadBalancer — external
---
apiVersion: v1
kind: Service
metadata:
name: web-public
spec:
type: LoadBalancer
selector: {app: web}
ports: [{port: 443, targetPort: 8080}]
DNS¶
Kubernetes automatically creates DNS records: service-name.namespace.svc.cluster.local. Within the same namespace, service-name is sufficient.
Network Model¶
- Each pod has a unique IP
- Pods communicate directly (without NAT)
- Services provide a stable endpoint
- Network Policies control firewall rules
Summary¶
ClusterIP for internal services, LoadBalancer for public ones. Ingress controller for HTTP routing.
Need Help with Implementation?¶
Our team has experience designing and implementing modern architectures. We’re happy to help.