Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting metallb CIDR value for local env #1110

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mikenairn
Copy link
Member

@mikenairn mikenairn commented Jan 13, 2025

The default CIDR value (/28) allows for 16 ips to be assigned which is fine for the majority of dev/test/demo needs. However, when trying to test at scale it is useful to be able to create more Gateways on a single cluster and therefore more IPs can be required.

Changes here allow the CIDR and number of IP values used by the local setup script to be set as needed, default is the same as before (/28 & 16 IPs).

make local-setup SUBNET_OFFSET=0 CIDR=26 NUM_IPS=64

The default CIDR value (/28) allows for 16 ips to be assigned which is
fine for the majority of dev/test/demo needs. However, when trying to
test at scale it is useful to be able to create more Gateways on a
single cluster and therefore more IPs can be required.

Changes here allow the CIDR and number of IP values used by the local
setup script to be set as required, default is the same as before (/28 &
16 IPs).

```
make local-setup SUBNET_OFFSET=0 CIDR=26 NUM_IPS=64
```

Signed-off-by: Michael Nairn <[email protected]>
@Boomatang
Copy link
Contributor

If a users was to hit this issue, what would it look like? How would they identify the issue?

@mikenairn
Copy link
Member Author

If a users was to hit this issue, what would it look like? How would they identify the issue?

If you created more gateways than IPs in the range, some Gateways will never go into a "Programmed" state:

kubectl get gateway -A
NAMESPACE        NAME                      CLASS   ADDRESS       PROGRAMMED   AGE
gateway-system   kuadrant-ingressgateway   istio   172.18.0.0    True         42m
scale-test-0     gw1-i0                    istio   172.18.0.2    True         31m
scale-test-0     gw2-i0                    istio   172.18.0.3    True         31m
scale-test-0     gw3-i0                    istio   172.18.0.4    True         31m
scale-test-0     gw4-i0                    istio   172.18.0.5    True         31m
scale-test-0     gw5-i0                    istio   172.18.0.6    True         31m
scale-test-1     gw1-i1                    istio   172.18.0.7    True         31m
scale-test-1     gw2-i1                    istio   172.18.0.8    True         31m
scale-test-1     gw3-i1                    istio   172.18.0.9    True         31m
scale-test-1     gw4-i1                    istio   172.18.0.10   True         31m
scale-test-1     gw5-i1                    istio   172.18.0.11   True         31m
scale-test-2     gw1-i2                    istio   172.18.0.12   True         31m
scale-test-2     gw2-i2                    istio   172.18.0.13   True         31m
scale-test-2     gw3-i2                    istio   172.18.0.14   True         31m
scale-test-2     gw4-i2                    istio   172.18.0.15   True         31m
scale-test-2     gw5-i2                    istio                 False        31m
scale-test-3     gw1-i3                    istio                 False        31m
scale-test-3     gw2-i3                    istio                 False        31m
scale-test-3     gw3-i3                    istio                 False        31m
scale-test-3     gw4-i3                    istio                 False        31m
scale-test-3     gw5-i3                    istio                 False        31m
scale-test-4     gw1-i4                    istio                 False        31m
scale-test-4     gw2-i4                    istio                 False        31m
scale-test-4     gw3-i4                    istio                 False        31m
scale-test-4     gw4-i4                    istio                 False        31m
scale-test-4     gw5-i4                    istio                 False        31m

Status will show that it's still pending:

kubectl get gateway/gw5-i2 -n scale-test-2 -o json | jq '.status.conditions[] | select(.type=="Programmed")'
{
  "lastTransitionTime": "2025-01-13T16:12:42Z",
  "message": "Assigned to service(s) gw5-i2-istio.scale-test-2.svc.cluster.local:80, but failed to assign to all requested addresses: address pending for hostname \"gw5-i2-istio.scale-test-2.svc.cluster.local\"",
  "observedGeneration": 1,
  "reason": "AddressNotAssigned",
  "status": "False",
  "type": "Programmed"
}

And if you want you can check the metallb logs:

kubectl logs deployment/controller -n metallb-system | grep "error"
{"caller":"service.go:140","error":"no available IPs","level":"error","msg":"IP allocation failed","op":"allocateIPs","ts":"2025-01-13T16:13:02Z"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants