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

failed to create kuma k3d cluster for local with Makefile command #10030

Open
Icarus9913 opened this issue Apr 22, 2024 · 2 comments
Open

failed to create kuma k3d cluster for local with Makefile command #10030

Icarus9913 opened this issue Apr 22, 2024 · 2 comments
Labels
kind/bug A bug triage/accepted The issue was reviewed and is complete enough to start working on it

Comments

@Icarus9913
Copy link
Contributor

What happened?

I followed the DEVELOPER.md to run the kuma k3d cluster but met a failure.

command: make -j k3d/restart

Error from server (parsing address pool main: invalid CIDR "fd00:fd12:3456::0/64..3.0/24" in pool "main": invalid CIDR "fd00:fd12:3456::0/64..3.0/24"): error when creating "STDIN": admission webhook "ipaddresspoolvalidationwebhook.metallb.io" denied the request: parsing address pool main: invalid CIDR "fd00:fd12:3456::0/64..3.0/24" in pool "main": invalid CIDR "fd00:fd12:3456::0/64..3.0/24"
make[2]: *** [k3d/configure/metallb] Error 1
make[1]: *** [k3d/start] Error 2
make: *** [k3d/restart] Error 2

Then I found the command docker network inspect kind --format '{{ (index .IPAM.Config 0).Subnet }}') will select the IPv6 address fd00:fd12:3456::0/64, which leads to the failure.

icarus.wu@konghq.com@Icarus ~ %docker network inspect kind
[
    {
        ......
        "IPAM": {
            "Driver": "default",
            "Options": {},
            "Config": [
                {
                    "Subnet": "fd00:fd12:3456::0/64"
                },
                {
                    "Subnet": "172.18.0.0/16",
                    "Gateway": "172.18.0.1"
                }
            ]
        },

@Icarus9913 Icarus9913 added kind/bug A bug triage/pending This issue will be looked at on the next triage meeting labels Apr 22, 2024
@Icarus9913
Copy link
Contributor Author

Actually, I did meet this problem in the past with the new version docker.
And I did the following command to fix it with spiderpool project, but looks like a little bit cumbersome.

ipv4_regex="^([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\/[0-9]+)$$"; \
ipv6_regex="^([a-fA-F0-9:]+\/[0-9]+)$$"; \
subnet0=$$(docker network inspect kind -f {{\(index\ $$.IPAM.Config\ 0\).Subnet}}) ; \
gateway0=$$(docker network inspect kind -f {{\(index\ $$.IPAM.Config\ 0\).Gateway}}) ; \
subnet1=$$(docker network inspect kind -f {{\(index\ $$.IPAM.Config\ 1\).Subnet}}) ; \
gateway1=$$(docker network inspect kind -f {{\(index\ $$.IPAM.Config\ 1\).Gateway}}) ; \
if [[ $${subnet0} =~ $${ipv4_regex} ]]; then \
	ipv4_subnet=$${subnet0}; \
	ipv4_gateway=$${gateway0}; \
elif [[ $${subnet0} =~ $${ipv6_regex} ]]; then \
	ipv6_subnet=$${subnet0}; \
	ipv6_gateway=$${gateway0}; \
fi; \
if [[ $${subnet1} =~ $${ipv4_regex} ]]; then \
	ipv4_subnet=$${subnet1}; \
	ipv4_gateway=$${gateway1}; \
elif [[ $${subnet1} =~ $${ipv6_regex} ]]; then \
	ipv6_subnet=$${subnet1}; \
	ipv6_gateway=$${gateway1}; \
fi;  \
echo "docker network kind IPv4 subnet $${ipv4_subnet}"; \
echo "docker network kind IPv4 gateway $${ipv4_gateway}"; \
echo "docker network kind IPv6 subnet $${ipv6_subnet}"; \
echo "docker network kind IPv6 gateway $${ipv6_gateway}"; \

@Icarus9913
Copy link
Contributor Author

What's more, the index .IPAM.Config property is an array and how could we get its length in order to avoid the out of length error occurs.

@jakubdyszkiewicz jakubdyszkiewicz added triage/accepted The issue was reviewed and is complete enough to start working on it and removed triage/pending This issue will be looked at on the next triage meeting labels Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug triage/accepted The issue was reviewed and is complete enough to start working on it
Projects
None yet
Development

No branches or pull requests

2 participants