-
Notifications
You must be signed in to change notification settings - Fork 235
Add NodeIPAM Controller to CCM #247
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
Conversation
18e8ff0
to
52566ce
Compare
/test cloud-provider-gcp-e2e-full |
/assign @jpbetz |
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.
Generally looks good. A couple details:
Can we split the vendor changes into their commit? Ideally we would have one commit for vendor and another for the code copy, and another for any hand written changes.
Do we need to copy over https://github.com/kubernetes/kubernetes/blob/master/test/integration/ipamperf/ipam_test.go to somewhere appropriate? I don't see any e2e tests that run for nodeIPAM, but let me know if I missed anything. It would be good ensure we're running them in our presubmits for cloud-provider-gcp if there are any.
I suspect we don't need both legacyprovider.go and nolegacyprovider.go. Can we simplify this down? Ideally we'd drop "legacy" from anything we're going to keep long term.
limitations under the License. | ||
*/ | ||
|
||
package v1alpha1 |
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.
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 think its probably appropriate for now. Lets get it moved. Then clean it up for our use (If possible), then move it to Beta.
@jpbetz Hi Joe, thank you for your review. Regarding with your suggestion:
|
/lgtm |
cc @sdmodi |
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.
It looks like you have copied all of the code under https://github.com/kubernetes/kubernetes/tree/master/pkg/controller/nodeipam except the legacyprovider.go file. I think this is fine. I think it would have been ok to not port over ipam/controller_legacyprovider.go as well.
I am no expert but this looks good to me and it has the code that IPv6 feature needs.
/assign @bowei |
/assign @cheftako |
@bowei Thanks for reviewing. I have updated commit message with source file info(No changes except commit message update). Please have a look when you have time. Thank you |
Cici, it looks like my patch caused merge conflicts for you. Would you please update this patch. Thanks! |
cmd/cloud-controller-manager/main.go
Outdated
// e.g. remove the cloud-node-lifecycle controller which current cloud provider does not need. | ||
//delete(controllerInitializers, "cloud-node-lifecycle") | ||
|
||
// Here is an example to add an controller(NodeIpamController) which will be used by cloud provider |
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.
Ditto this is no longer an example, this is actually using said controller.
if len(strings.TrimSpace(nodeIPAMConfig.ServiceCIDR)) != 0 { | ||
_, serviceCIDR, err = net.ParseCIDR(nodeIPAMConfig.ServiceCIDR) | ||
if err != nil { | ||
klog.Warningf("Unsuccessful parsing of service CIDR %v: %v", nodeIPAMConfig.ServiceCIDR, err) |
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.
If we can't parse our configuration is starting the right thing to do?
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.
It is the current logic KCM starts nodeipam controller. I am not sure if some sort of default values will be used when met parsing issue?
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.
In the interest of getting this in with minimal changes lets go ahead merge with this. However we should probably have at least a tracking bug. My guess is the controller does not do what we want in this case but that having it "start" means that its failing quietly, which is bad.
# See the OWNERS docs at https://go.k8s.io/owners | ||
|
||
approvers: | ||
- bowei |
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.
Can we get a second approver? Dislike having a SPF.
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.
Would you have any suggestions on who could be added here? cc @bowei
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", | ||
"//vendor/k8s.io/apimachinery/pkg/conversion:go_default_library", | ||
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", | ||
"//vendor/k8s.io/kube-controller-manager/config/v1alpha1:go_default_library", |
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.
Need to work out how to break this dependency.
klog.V(0).Infof("Sending events to api server.") | ||
eventBroadcaster.StartRecordingToSink(&v1core.EventSinkImpl{Interface: client.CoreV1().Events("")}) | ||
|
||
gceCloud, ok := cloud.(*gce.Cloud) |
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.
Good for this checkin. Might be interesting to see if we need to keep this in a follow on.
"k8s.io/api/core/v1" | ||
) | ||
|
||
// TaintExists checks if the given taint exists in list of taints. Returns true if exists false otherwise. |
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.
Is this really a cloud-provider-gcp utility?
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.
It is used when creates a new cloud CIDR allocator here
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.
Not complaining about it being a utility or our using it. My through was this seems like a generic K/K utility for taint detection. There seems to be nothing GCP specific to this code.
/lgtm |
Copy source code files from k8s.io/kubernetes Githash:a013c6a2db54c59b78de974b181586723e088246 Repo: https://github.com/kubernetes/kubernetes Paths: //pkg/controller/nodeipam
Thanks Cici for the quick turnaround on the comments. Walter, would you please take a look at this. This patch is blocking IPv6 support in GKE. Thanks! |
/approve |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bowei, cheftako, cici37, sdmodi 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 |
This PR is to add NodeIPAM controller into CCM.
Following work: