-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
Add support for IP aliases for pod IPs (GCP alpha feature) #42147
Conversation
glog.V(3).Infof("Node %v has PodCIDR %v", node.Name, podCIDR) | ||
return nil | ||
} | ||
glog.Errorf("PodCIDR cannot be reassigned, node %v spec has %v, but cloud provider has assigned %v", |
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.
Should here return error? According to the error info, it seems yes.
But according to the logic below, the PodCIDR should update to CIDR assigned by cloud provider. So IMO here may need to be modified to something like:
glog.V(3).Infof("PodCIDR will be reassigned, node %v spec has %v, but cloud provider has assigned %v",
node.Name, node.Spec.PodCIDR, podCIDR)
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.
We do not support reassignment of PodCIDRs once they have been assigned.
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.
Then we should return error here, otherwise PodCIDR will be reassigned to cidr[0]
in line #L110, right? Hopefully I understand correctly:)
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.
The range_allocator.go
code logs an error, but continues with setting the node spec. This basically copies the current behavior, I'll add a comment to be more clear. This is somewhat of a unhandled state for the system, as the underlying layers will ignore the CIDR update.
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.
Thanks for the explanation!
cc18de2
to
3d90228
Compare
@k8s-bot kubemark e2e test this |
2a3520e
to
bc60716
Compare
I only looked at the shell code. By the way, why is this change in 7 commits? |
@roberthbailey -- commits are grouped in a way to make it easy to review / rebase |
@k8s-bot test this |
@bowei: The following test(s) failed:
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
fa09323
to
96298b8
Compare
KUBE_GCE_ENABLE_IP_ALIASES=true will enable allocation of PodCIDR ips using the ip alias mechanism rather than using routes. NODE_IP_RANGE will control the node instance IP cidr KUBE_GCE_IP_ALIAS_SIZE controls the size of each podCIDR IP_ALIAS_SUBNETWORK controls the name of the subnet created for the cluster
If CIDRAllocatorType is set to `CloudCIDRAllocator`, then allocation of CIDR allocation instead is done by the external cloud provider and the node controller is only responsible for reflecting the allocation into the node spec. - Splits off the rangeAllocator from the cidr_allocator.go file. - Adds cloudCIDRAllocator, which is used when the cloud provider allocates the CIDR ranges externally. (GCE support only) - Updates RBAC permission for node controller to include PATCH
I also sorted the file, it was almost sorted with a few exceptions.
@thockin -- there will be follow on commits mostly likely as I get the e2e testing running through in ip alias mode. |
/lgtm since @roberthbailey is ooo |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bowei, thockin
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Automatic merge from submit-queue |
Automatic merge from submit-queue Clean up CHANGELOG.md There was extra stuff inside the `release-note` block for #42147 that messed up the formatting for CHANGELOG.md. I edited the PR to fix it, but the CHANGELOG.md had already been pushed.
Adds KUBE_GCE_ENABLE_IP_ALIASES flag to the cluster up scripts (
kube-{up,down}.sh
).KUBE_GCE_ENABLE_IP_ALIASES=true will enable allocation of PodCIDR ips
using the ip alias mechanism rather than using routes. This feature is currently
only available on GCE.
Usage
$ CLUSTER_IP_RANGE=10.100.0.0/16 KUBE_GCE_ENABLE_IP_ALIASES=true bash -x cluster/kube-up.sh
Adds CloudAllocator to the node CIDR allocator (kubernetes-controller manager).
If CIDRAllocatorType is set to
CloudCIDRAllocator
, then allocationof CIDR allocation instead is done by the external cloud provider and
the node controller is only responsible for reflecting the allocation
into the node spec.
the CIDR ranges externally. (GCE support only)