-
Notifications
You must be signed in to change notification settings - Fork 742
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
Kube-Scheduler Support for managing node's available IP addresses #26
Comments
Extended resources are already supported by the scheduler. Since you plan to use extended resources, no changes in the scheduler is needed. |
Thank you Bobby! Is there any plan in future to allow Extended resources specified at Pod level? |
It is already possible for pods (containers) to request extended resources. Please see this: https://kubernetes.io/docs/tasks/configure-pod-container/extended-resource/ |
It is not currently possible to specify pod level resources. What you can do is build a scheduler extender which will count a single IP per pod even if the pod itself doesn't request for that resource. This becomes an extended predicate (and possibly priority) function. You can expose the number of IPs per node by running a separate controller that patches node objects. |
@liwenwu-amazon one question here, is latest EKS still using the "k8s extended resource" design to ensure a pod can be scheduled properly to get a valid VPC ip? apiVersion: v1
kind: Pod
metadata:
name: my-pod
spec:
containers:
- name: my-container
image: myimage
resource:
requests:
vpc.amazonaws.com/ipv4: 1
limits:
vpc.amazonaws.com/ipv4: 1 If so, in user's perspective, does user still need to specify |
@Huang-Wei Not yet. When we add that feature, we'll also make it transparent so that you won't need to request the resource in your spec. Currently kubelet advertises pod capacity to match the IPv4 private address capacity. Either way, you don't need to do anything. |
Can you please link me to docs/code about that? It seems that this is not true in my cluster, I want to try figuring out what. |
The EKS AMI bootstrap script sets kubelet's |
@deiwin I see, thank you. I'm using a kops-created cluster, not EKS, so not using those images. |
Any progress on implementing this? |
Closing in favor of aws/containers-roadmap#398 |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days |
I would love to see this feature. |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days |
Issue closed due to inactivity. |
Kube-Scheduler Support for managing node's available IPv4 addresses
Problem
As described in issue #18, kube-scheduler is not aware of the number of available IPv4 addresses on a node. Kube-Scheduler can schedule a Pod to run on a node even after the node has exhausted all of its IPv4 addresses.
Proposal
Here we propose to use kubernete's extended resources (which is supported in Kubernetes 1.8) to enable kube-scheduler support for managing node's available IPv4 addresses
Solution
eni-ip-controller is a new component which runs in a kubernetes cluster. It watches kubernetes node resources. When a new node joins the cluster, eni-ip-controller updates API server about node's vpc.amazonaws.com/ipv4 resource (the number of available IPv4 addresses on the new node). Here is the workflow:
Here is an HTTP request that advertises 15 "vpc.amazonaws.com/ipv4" resources on node k8s-node-1
Pod Admission Control
Since "vpc.amazonaws.com/ipv4" is NOT a standard resource like "cpu" or "memory", if a Pod does NOT have "vpc.amazonaws.com/ipv4" specified, the Pod can consume an ENI IPv4 resource on a node without accounted in the scheduler.
Here are few options to solve this:
Using Taint
Using taint, such that a pod which does NOT have "vpc.amazonaws.com/ipv4" resource limits specified will be evicted or not scheduled. This is accomplished by
Using ExtendedResourceToleration
Kubernetes 1.9 introduces ExtendedResourceToleration, where API server can automatically add tolerations for such taints.
Using Kubernetes Admission Control (initializer)
Kubernetes Initializer
can be used to always inject "vpc.amazonaws.com/ipv4" resource request into a pod spec. Here is the workflow:
Alternative Solutions Considered:
Using kubernetes Custom Scheduler Custom Schedulers
Kubernetes Custom Schedulers allows us to build a new scheduler for all pods to be scheduled on our cluster.
Tainting node not schedulable when running out of IPv4 addresses
When L-IPAM runs out of IPv4 addresses, L-IPAM can taint node itself as not-schedulable.
Using scheduler extension
kubernetes scheduler extender allows us to implement a "scheduler extender" process that the standard Kubernetes scheduler calls out to as a final pass when making scheduling decisions.
The text was updated successfully, but these errors were encountered: