Expose a Service with Ingress¶
When to Use This Guide¶
Use this guide when you want to expose a Kubernetes service to external users through HTTP or HTTPS.
Ingress allows multiple services to share a single external IP address and supports routing based on hostnames or paths.
Step 1 — Verify the Service¶
Ensure your application service exists.
Example:
Step 2 — Create an Ingress Resource¶
Example configuration:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: web-app-ingress
spec:
rules:
- host: web-app.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: web-app
port:
number: 80
Apply the configuration.
Step 3 — Verify Ingress¶
Check the ingress resource.
Example:
Common Issues¶
Ingress Has No Address
Your cluster may not have an Ingress controller installed.
Check:
Service Returns 404
Verify service name and port in the ingress configuration.
Related Guides¶
- Expose a Service
- Port Forward Pod