Hi everyone,
I’m trying to configure Traefik Gateway Fabric as the default Ingress Controller for my Kubernetes cluster. I successfully obtained a TLS certificate using Cert Manager and Let's Encrypt, and I’ve set up the gateway using the following values.yaml
configuration:
providers:
kubernetesIngress:
enabled: false
kubernetesGateway:
enabled: true
deployment:
kind: "DaemonSet"
ports:
web:
forwardedHeaders:
insecure: true
proxyProtocol:
insecure: true
websecure:
http3:
enabled: true
gateway:
listeners:
web:
port: 8000
protocol: HTTP
namespacePolicy: All
websecure:
port: 8443
protocol: HTTPS
namespacePolicy: All
certificateRefs:
- kind: Secret
name: multi-domain-cert-secret
namespace: cert-manager
mode: "Terminate"
service:
type: LoadBalancer
annotations:
load-balancer.hetzner.cloud/type: "lb11"
load-balancer.hetzner.cloud/name: "cluster-lb"
load-balancer.hetzner.cloud/network-zone: "eu-central"
load-balancer.hetzner.cloud/algorithm-type: "least_connections"
load-balancer.hetzner.cloud/uses-proxyprotocol: "true"
spec:
externalTrafficPolicy: Cluster
I deployed a test service with the following configuration, replacing my real domain with example.com
:
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: my-service
namespace: socials
labels:
app: my-service
spec:
parentRefs:
- name: traefik-gateway
namespace: traefik
sectionName: web
hostnames:
- "my-service-api.example.com"
rules:
- matches:
- path:
type: PathPrefix
value: "/"
backendRefs:
- name: my-service
port: 80
namespace: socials
Here is the corresponding service definition:
apiVersion: v1
kind: Service
metadata:
name: my-service
namespace: socials
labels:
app: my-service
spec:
selector:
app: my-service
ports:
- protocol: TCP
port: 80
name: http
targetPort: 8080
However, I’m encountering an issue where visiting https://my-service-api.example.com
or http://my-service-api.example.com
results in the following error:
This page isn’t working
my-service-api.example.com redirected you too many times.
ERR_TOO_MANY_REDIRECTS
My goal is for users to be redirected from http://my-service-api.example.com
to https://my-service-api.example.com
, ensuring that HTTPS is the default access method for my service.
I’ve exhausted all potential solutions to resolve this issue but to no avail. I would greatly appreciate any insights or suggestions you may have to help me fix this.
Thank you very much!