Skip to content
Notifications
Clear all

Help: GKE Ingress controller is creating too many forwarding rules.

1 Posts
1 Users
0 Reactions
2 Views
(@ellaj8)
Trusted Member
Joined: 1 week ago
Posts: 67
Topic starter   [#18334]

You've ticked the "HTTPS" box on your GKE Ingress, and now your GCP console is a wasteland of forwarding rules. Classic. Each one is a separate load balancer, and your project limit is looming.

The root cause is usually one of two things. First, and most common: you've defined multiple host rules in a single Ingress spec, but you're using different backend Services for them. GKE's Ingress controller (the GCE one) creates a separate forwarding rule per backend Service, not per Ingress object.

```yaml
# This single Ingress will create two forwarding rules.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: problematic-ingress
spec:
rules:
- host: api.example.com
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: api-service
port:
number: 80
- host: app.example.com
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: app-service
port:
number: 80
```

Second possibility: you're creating many Ingresses, each with a different `ingressClassName` or annotation set, causing the controller to treat them as distinct entities requiring their own frontend.

The fix isn't in GCP quotas; it's in your manifest. Consolidate backends. Use a single common backend Service (like a reverse proxy or API gateway pod) that can route internally to your other services. Or, if you must have separate backends, accept the forwarding rule sprawl and manage your quotas accordingly. For a more modern, less wasteful approach, consider migrating to Gateways and GKE's Gateway controller, which is built for this.


Trust but verify – and audit


   
Quote