Senior
What is Ingress in Kubernetes?
sobes.tech AI
Answer from AI
Ingress in Kubernetes is an object that manages external access to services within a cluster, typically via HTTP/HTTPS. It defines routing rules based on URL paths or hosts and directs traffic to the appropriate services.
Ingress allows:
- Centralizing access configuration in one place.
- Using a single entry point for multiple services.
- Configuring SSL/TLS termination.
- Implementing load balancing and URL rewriting.
An Ingress controller is required for Ingress to function, which enforces these rules at the network level.
Example of a simple Ingress:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: example-ingress
spec:
rules:
- host: example.com
http:
paths:
- path: /app1
pathType: Prefix
backend:
service:
name: app1-service
port:
number: 80
- path: /app2
pathType: Prefix
backend:
service:
name: app2-service
port:
number: 80
Thus, Ingress simplifies access management and routing in Kubernetes.