Services expose your application, but Ingress lets you route traffic based on hostnames and paths — api.example.com goes to the API, app.example.com goes to the frontend.
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm install nginx-ingress ingress-nginx/ingress-nginx
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: app-ingress
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
tls:
- hosts:
- app.example.com
secretName: app-tls
rules:
- host: app.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: web-service
port:
number: 80
With cert-manager, Kubernetes automatically provisions and renews TLS certificates. In Part 9, we add health checks to make applications genuinely self-healing.
← Back to Blog