Unable to create service with ipFamilyPolicy RequireDualStack when service cidr is bigger then /112 #129797
Labels
kind/bug
Categorizes issue or PR as related to a bug.
sig/network
Categorizes an issue or PR as relevant to SIG Network.
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
What happened?
We run periodic conformance tests in github.com/kubernetes-sigs/cluster-api and they started to fail https://testgrid.k8s.io/sig-cluster-lifecycle-cluster-api#capi-e2e-latestk8s-main
These currently
--service-cluster-ip-range=10.128.0.0/12,fd00:100:64::/108
in kube-apiserver (and kube-controller-manager)IPv6DualStack
feature tests.Several conformace tests for
IPv6DualStack
then failed with e.g. the following message:Note: The kube-apiserver is able to create the IPAddress object, but the service does not get created.
What did you expect to happen?
Tests to succeed.
How can we reproduce it (as minimally and precisely as possible)?
Build kindest/node image for k/k commit 0798325
Create a kind cluster using the following configuration:
kind create cluster --name test --config kind-cluster.yaml --image kindest/node:v1.33.0-alpha.0.614_0798325ba13643
Try to create a service with
.spec.ipFamilyPolicy
set toRequireDualStack
or.spec.ipFamilies
set to["IPv6"]
:Note: there's a chance that the ip allocation in kube-apiserver picks an ipv6 address which is then part the first /112 part of and then works.
Anything else we need to know?
Follow-up to #129753 (comment)
I also stepped into kube-apiserver:
fd00:100:64::/108
, IPfd00:100:64::f:321c
kubernetes/pkg/registry/core/service/ipallocator/bitmap.go
Lines 173 to 179 in 0798325
/112
Workarounds:
DisableAllocatorDualWrite
in kube-apiserver/112
cidr for servicescc @aojea
And Kudos for Antonio helping me to dig into it!
Kubernetes version
Cloud provider
OS version
Install tools
Container runtime (CRI) and version (if applicable)
Related plugins (CNI, CSI, ...) and versions (if applicable)
The text was updated successfully, but these errors were encountered: