Kubernetes Networking: Services, Ingress, and Network Policies
Understand Kubernetes networking: ClusterIP, NodePort, LoadBalancer, Ingress, and policy.
Key takeaways
Understand Kubernetes networking: ClusterIP, NodePort, LoadBalancer, Ingress, and policy.
On this page
Kubernetes Networking: Services, Ingress, and Network Policies#
Kubernetes networking can be confusing. Here’s a concise guide to services, ingress, and network policy.
Services#
- ClusterIP: Internal cluster DNS; default for in-cluster traffic.
- NodePort: Expose a port on every node; good for dev or legacy.
- LoadBalancer: Cloud LB per service; use when you need a dedicated external IP.
Ingress#
- Ingress = HTTP(S) routing (host/path) to backend services. You need an Ingress controller (e.g. nginx, AWS ALB).
- TLS: Terminate at ingress; use cert-manager for certificates.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: myapp
spec:
ingressClassName: nginx
rules:
- host: myapp.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: myapp
port: { number: 80 }
Network Policies#
- NetworkPolicy restricts pod-to-pod and pod-to-external traffic. Default-deny and allow only what’s needed.
- Start with a policy that allows DNS and ingress; then add app-specific rules.
Best practice: document your ingress and network policy approach so every new service follows the same pattern.
Get the DevOps Troubleshooting Cheat Sheet
Subscribe and get our free one-page reference for the errors that eat an afternoon — CrashLoopBackOff, OOMKilled, Terraform state locks, and more — plus new guides as we publish them.
Infrastructure Cost Optimization: Reducing Cloud Spending
We cut our AWS bill by 38% in a quarter. The specific changes that moved the bill, ranked by impact, with what we'd do first.
AI Best Practices for Engineering Teams: From Prompt Experiments to Platform Discipline
A practical field manual for engineering teams who want AI features that survive real users, incidents, and budgets — not just demo day.
More from DevOps
Explore more articles in this category
Best Kubernetes IDE and GUI Tools in 2026
kubectl is fine until you're juggling five namespaces across three clusters. These are the tools that make that manageable, compared.
Chef vs Puppet vs Ansible: Configuration Management in 2026
One is agentless and Python-based, the other two run a persistent agent and a domain-specific language. The architecture difference matters more than the syntax.
PagerDuty vs Opsgenie: Choosing an Incident Alerting Tool
Both page the right person at 3am and both integrate with everything. The real differences show up in pricing structure, workflow depth, and who already owns the ecosystem around you.
You might have missed
Evergreen posts worth revisiting.