-
Notifications
You must be signed in to change notification settings - Fork 451
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
Support multiple IPPools in the namespace #4777
base: master
Are you sure you want to change the base?
Conversation
08cdee5
to
2eeaec2
Compare
Pull Request Test Coverage Report for Build 12298070287Details
💛 - Coveralls |
0d232b9
to
49b1f5b
Compare
db03de0
to
178f7c2
Compare
Signed-off-by: Karol Szwaj <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>
a852962
to
ded43bd
Compare
PTAL @zhangzujian |
@@ -509,4 +509,56 @@ var _ = framework.Describe("[group:ipam]", func() { | |||
deploy = deployClient.PatchSync(deploy, patchedDeploy) | |||
checkFn() | |||
}) | |||
|
|||
framework.ConformanceIt("should allocate right IPs for the statefulset when there are multiple IP Pools added to its namespace", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's skip this test case for versions < v1.14 by using f.SkipVersionPriorTo(1, 14, "some message...")
testSubnet := framework.MakeSubnet(testSubnetName, "", testCidr, "", "", "", nil, nil, []string{namespaceName}) | ||
subnetClient.CreateSync(testSubnet) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testSubnet := framework.MakeSubnet(testSubnetName, "", testCidr, "", "", "", nil, nil, []string{namespaceName}) | |
subnetClient.CreateSync(testSubnet) | |
testSubnet := framework.MakeSubnet(testSubnetName, "", testCidr, "", "", "", nil, nil, []string{namespaceName}) | |
ginkgo.DeferCleanup(func() { | |
ginkgo.By("Deleting subnet " + testSubnetName) | |
subnetClient.DeleteSync(testSubnetName) | |
}) | |
subnetClient.CreateSync(testSubnet) |
Let's use ginkgo.DeferCleanup()
to ensure test resources are cleaned up.
ginkgo.By("Deleting statefulset " + testStsName) | ||
stsClient.DeleteSync(testStsName) | ||
|
||
ginkgo.By("Deleting ippools") | ||
ippoolClient.DeleteSync(testIPPool1Name) | ||
ippoolClient.DeleteSync(testIPPool2Name) | ||
|
||
ginkgo.By("Deleting subnet " + testSubnetName) | ||
subnetClient.DeleteSync(testSubnetName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ginkgo.By("Deleting statefulset " + testStsName) | |
stsClient.DeleteSync(testStsName) | |
ginkgo.By("Deleting ippools") | |
ippoolClient.DeleteSync(testIPPool1Name) | |
ippoolClient.DeleteSync(testIPPool2Name) | |
ginkgo.By("Deleting subnet " + testSubnetName) | |
subnetClient.DeleteSync(testSubnetName) |
Since we are using ginkgo.DeferCleanup()
, there is no need to delete the resources here.
testSubnetName := "ip-pool-subnet2" | ||
testIPPool1Name := "ip-pool1" | ||
testIPPool2Name := "ip-pool2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testSubnetName := "ip-pool-subnet2" | |
testIPPool1Name := "ip-pool1" | |
testIPPool2Name := "ip-pool2" | |
testSubnetName := "ip-pool-subnet2" + framework.RandomSuffix() | |
testIPPool1Name := "ip-pool1" + framework.RandomSuffix() | |
testIPPool2Name := "ip-pool2" + framework.RandomSuffix() |
Subnet and ippool are cluster wide resources, we need to add a suffix to them.
replicas := 1 | ||
ipsCount := 12 | ||
ipsRange1 := framework.RandomIPPool(cidr, ipsCount) | ||
ipsRange2 := framework.RandomIPPool(cidr, ipsCount) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ipsRange2 := framework.RandomIPPool(cidr, ipsCount) | |
ipsRange2 := framework.RandomIPPool(testCidr, ipsCount) |
Should be testCidr
here?
Pull Request
What type of this PR
Examples of user facing changes:
While reproducing issue #4687 (comment)
I have found that when user have multiple IPPools in the single namespace, pods without ippool annotation won’t be able to pick up a correct address.
Which issue(s) this PR fixes
Fixes #4687