Skip to content

Commit 0688746

Browse files
fix(k8s): correct Gateway API configuration for Traefik (#48)
- Enable kubernetesGateway provider in Traefik configuration - Update Gateway to use 'traefik' GatewayClass (auto-created by Traefik) - Use correct entryPoint ports (8000 for HTTP, 8443 for HTTPS) - Remove custom GatewayClass (Traefik creates its own) The Gateway API now works correctly with the K3s development environment. Test with: curl -H "Host: test-app.localhost" http://localhost:8080 Co-authored-by: rafaelrsantosti <11065120+rafaelrsantosti@users.noreply.github.com>
1 parent c7c22bb commit 0688746

2 files changed

Lines changed: 7 additions & 12 deletions

File tree

docker/manifests/01-gateway.yaml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,20 @@
11
apiVersion: gateway.networking.k8s.io/v1
2-
kind: GatewayClass
3-
metadata:
4-
name: gatewayclass
5-
spec:
6-
controllerName: traefik.io/gateway-controller
7-
---
8-
apiVersion: gateway.networking.k8s.io/v1
92
kind: Gateway
103
metadata:
114
name: gateway
125
namespace: kube-system
136
spec:
14-
gatewayClassName: gatewayclass
7+
gatewayClassName: traefik
158
listeners:
16-
- name: http
9+
- name: web
1710
protocol: HTTP
18-
port: 80
11+
port: 8000
1912
allowedRoutes:
2013
namespaces:
2114
from: All
22-
- name: https
15+
- name: websecure
2316
protocol: HTTPS
24-
port: 443
17+
port: 8443
2518
allowedRoutes:
2619
namespaces:
2720
from: All

docker/manifests/traefik.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ spec:
2525
kubernetesIngress:
2626
publishedService:
2727
enabled: true
28+
kubernetesGateway:
29+
enabled: true
2830
priorityClassName: "system-cluster-critical"
2931
image:
3032
repository: "rancher/mirrored-library-traefik"

0 commit comments

Comments
 (0)