Files
www.cialloo.com/script/k8s/ingress.yaml

43 lines
1.3 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:
# 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