-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
wip: docker: fix network static #9094
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: medyagh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Travis tests have failedHey @medyagh, 1st Buildmake test
2nd Buildmake test
TravisBuddy Request Identifier: 61bd9af0-e74f-11ea-b1e9-0f855a8df5b8 |
/ok-to-test |
kvm2 Driver |
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.
This PR needs a better description for release notes.
Based on this PR, I remain unconvinced that static IP support adds enough value to be worth the complexity, and question if it should be reverted instead.
pkg/drivers/kic/oci/network.go
Outdated
err = attemptCreateNework(subnet, name) | ||
if err != nil { | ||
if err == ErrNetworkSubnetTaken { | ||
// try up tp 13 times |
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.
Please comment the "why", not the "what". Why retry, and why this many times?
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.
this is first iteration if this POC proves that this helps, we can invest in doing something fancy.
Rob Pike:
brute force very dumb first. then other things... (something like that)
the something fancy could be something like this
docker network ls -q | xargs docker inspect | grep "Subnet"
which returns
"Subnet": "172.17.0.0/16",
"Subnet": "172.25.0.0/16",
"Subnet": "172.18.0.0/16",
"Subnet": "172.23.0.0/16",
"Subnet": "172.30.0.0/16",
"Subnet": "192.168.0.0/20",
"Subnet": "192.168.160.0/20",
but that is actually very very expensive call, and will take seconds.... but brutne force is taking nano seconds each iteration.
but I am willling to observe this after it proves that it provides static IP for a more elegant solution
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.
13 because it wont pass 255 max number. and it is not too small and not too large.
just a starting point, so later we can tune
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.
Sorry for the miscommunication. All I am asking for is that the comment be updated to describe the "why", rather than restating the "what" that is perfectly described in the next line of code.
@@ -40,23 +40,30 @@ func deleteOrphanedKIC(ociBin string, name string) { | |||
return | |||
} | |||
|
|||
defer func() { // networks should be deleted after containers |
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.
why the defer? We have no idea at this point if we were successfully able to delete the container.
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.
beause in the code bellow somwhere we return if container doesnt exist. so I use defer.
and also you can not delete network if container is attached to it
so I wanna make sure firs containers are deleted if possible then try to delete network
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.
and this is a clean up code, so we just try and if it doesnt get deleted, we at least have tried.
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.
I guess that's the part I don't understand: if this fails unless the container is deleted (the final step), just simplify this and move it to occur explicitly afterwards.
If this defer is really fixing a specific behavior, please document it with a comment and/or propose it in another PR.
Travis tests have failedHey @medyagh, 1st Buildmake test
TravisBuddy Request Identifier: c0b812e0-e76a-11ea-b1e9-0f855a8df5b8 |
Travis tests have failedHey @medyagh, 1st Buildmake test
TravisBuddy Request Identifier: 8be614d0-e76b-11ea-b1e9-0f855a8df5b8 |
kvm2 Driver Times for Minikube (PR 9094): 62.2s 61.4s 63.9s Averages Time Per Log
docker Driver Times for Minikube (PR 9094): 27.1s 27.5s 26.4s Averages Time Per Log
|
Travis tests have failedHey @medyagh, 1st Buildmake test
TravisBuddy Request Identifier: d7b8de90-e76d-11ea-b1e9-0f855a8df5b8 |
kvm2 Driver Times for Minikube (PR 9094): 63.2s 63.4s 66.9s Averages Time Per Log
docker Driver |
Travis tests have failedHey @medyagh, 1st Buildmake test
2nd Buildmake test
TravisBuddy Request Identifier: 8f774550-e780-11ea-b1e9-0f855a8df5b8 |
Travis tests have failedHey @medyagh, 1st Buildmake test
2nd Buildmake test
TravisBuddy Request Identifier: 810cab30-e781-11ea-b1e9-0f855a8df5b8 |
kvm2 Driver Times for Minikube (PR 9094): 65.5s 63.9s 62.4s Averages Time Per Log
docker Driver Times for Minikube (PR 9094): 26.7s 27.4s 27.8s Averages Time Per Log
|
@medyagh: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
After this PR
closes #9087
closes #9069
closes #8936
TODO: fix upgrading existing cluster