46 lines
1.4 KiB
YAML
46 lines
1.4 KiB
YAML
# Kubernetes Ingress Configuration for Traefik
|
|
# Ingress exposes HTTP routes from outside the cluster to services within
|
|
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: Ingress
|
|
metadata:
|
|
# Name of the ingress
|
|
name: ${CONTAINER_IMAGE_NAME}
|
|
# Namespace where ingress will be created
|
|
namespace: ${KUBERNETES_NAMESPACE}
|
|
|
|
# Annotations specific to Traefik ingress controller
|
|
annotations:
|
|
# Specify Traefik as the ingress controller
|
|
kubernetes.io/ingress.class: "traefik"
|
|
|
|
# Traefik router configuration
|
|
# Entry point for HTTP traffic (not using HTTPS as per requirements)
|
|
traefik.ingress.kubernetes.io/router.entrypoints: web
|
|
|
|
# Optional: Add middleware for common headers
|
|
# traefik.ingress.kubernetes.io/router.middlewares: default-headers@kubernetescrd
|
|
|
|
labels:
|
|
app: ${CONTAINER_IMAGE_NAME}
|
|
|
|
spec:
|
|
# Define routing rules
|
|
rules:
|
|
# Host-based routing
|
|
- host: ${KUBERNETES_INGRESS_HOST}
|
|
http:
|
|
paths:
|
|
# Route all paths to the service
|
|
- path: /
|
|
# PathType defines how path matching is done
|
|
# Prefix matches any path starting with /
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
# Name of the service to route traffic to
|
|
name: ${CONTAINER_IMAGE_NAME}
|
|
port:
|
|
# Service port to route to
|
|
number: 80
|