Skip to content
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

[EKS] [request]: Enable PodNodeSelector Admission Controller for EKS #304

Open
toran414 opened this issue May 22, 2019 · 48 comments
Open

[EKS] [request]: Enable PodNodeSelector Admission Controller for EKS #304

toran414 opened this issue May 22, 2019 · 48 comments
Labels
EKS Amazon Elastic Kubernetes Service Proposed Community submitted issue

Comments

@toran414
Copy link

Tell us about your request
It would be nice if it was possible to use PodNodeSelector in EKS.

Which service(s) is this request for?
EKS

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?
In our EKS clusters, we are looking to leverage namespaces to represent our deployment environments. In order to do this safely, we want to label different auto-scaling groups of nodes as production and non-production. We then could use have the clusterDefaultNodeSelector select the non-production nodes, and the prod namespace target production nodes.

Are you currently working around this issue?
We are currently considering 2 workarounds.

  1. Having our CD pipeline inject a nodeSelector into each deployment manifest based on the namespace being deployed to.
  2. Writing a MutatingAdmissionWebhook to handle node selection, but this seems like we would just be re-writing the built-in PodNodeSelector.
@toran414 toran414 added the Proposed Community submitted issue label May 22, 2019
@whereisaaron
Copy link

The PodNodeSelector is an old-skool, compiled-in Admission Controller. A MutatingAdmissionWebhook is the more contemporary way to implement this functionality and requires no messing with the control plane configuration. So you are doing the right thing there I think. Plus your out-of-tree Admission Controller can be more flexible to your needs. Implementing this replacement would be good thing. Node selectors and thus PodNodeSelector should eventually be deprecated and replaced by affinity (once more efficient).

But if it were easy to enable PodNodeSelector right now, it would be a quicker fix for your issue.

@kinghajj
Copy link

Another solution I've considered using: give each auto scaling group a different taint. Say the current production environment is called "release 2019-05-01", then one ASG would have the taint release=2019-05-01:NoSchedule, and pods for that release have a toleration {"key": "release", "operator": "Equals", "value": "2019-05-01", "effect": "NoSchedule"}. For new staging releases, you'd make another ASG with a unique taint, and have its pods tolerate it. Thus, pods from the different releases couldn't intermingle on the same node.

@tabern tabern added the EKS Amazon Elastic Kubernetes Service label Jun 17, 2019
@omerfsen
Copy link

omerfsen commented Aug 7, 2019

So right now even with the latest EKS 1.13 eks.2 we don't have "PodNodeSelector" feature right?

@omerfsen
Copy link

omerfsen commented Aug 7, 2019

My requirement is that to run pods on nodes on default namespace which has label lifecycle=Ec2Spot and run dashboard,grafana,prometheus etc.. (management stuff) on ASG labeled lifecycle=OnDemand so to achieve that

https://stackoverflow.com/questions/52487333/how-to-assign-a-namespace-to-certain-nodes

@rosscdh
Copy link

rosscdh commented Aug 30, 2019

+1

@excieve
Copy link

excieve commented Dec 18, 2019

Now that there are managed node groups in 1.14 this would be super useful to automatically restrict pods to certain groups only.

@liangrog
Copy link

liangrog commented Jan 7, 2020

For those whom still want podnodesselector functionality but can't be bothered to write the admission webhook controllers: https://github.com/liangrog/admission-webhook-server

@pierluigilenoci
Copy link

@tabern is there any hope that it will be activated on EKS soon?

@AceHack
Copy link

AceHack commented Aug 31, 2020

Yes, any update?

@AceHack
Copy link

AceHack commented Oct 28, 2020

Any update, this is no longer alpha

@tabern
Copy link
Contributor

tabern commented Nov 9, 2020

We're taking a look at this.

Update 11/11
We took a deeper look at this. Because the namespaces that are declared for this controller are statically defined in config files that are on the api server, it is not something that we can easily enable today. We're keeping this on our backlog and will continue to evaluate the feasibility of properly enabling this controller in the future.

@derhally
Copy link

Is there any other solution to this problem? We have a 3rd party helm chart that doesn't cleanly handle setting tolerations and affinity. We would need everything to run on a specific node group and this would have solved the problem

@jogoldberg
Copy link

Any news on this?

@pierluigilenoci
Copy link

There really is a need for this feature.
It would be great to have it on EKS. ❤️

@iverberk
Copy link

@tabern AKS supports this admission controller and it is an easy solution to an otherwise (more) complicated setup with custom mutation webhooks (be that OPA or something else). It solves quite an important aspect of enforcing multi-tenancy on a single cluster. Can you maybe elaborate on why the admission controller can't be made to work within the EKS context?

@rmgpinto
Copy link

We would like to use this as well.

@roshan1988
Copy link

Any updates on this feature yet ? Would make life much easier if this is supported

@avarf
Copy link

avarf commented Jul 14, 2021

This is a great feature, please add this to EKS.

@pierluigilenoci
Copy link

This would be a great feature but AWS makes feature requests based on how many 👍🏻 the issue receives. To date, there are 44 that have more. If you want this to have a chance the only way is to get more 👍🏻 on the issue.

@avarf
Copy link

avarf commented Jul 15, 2021

I am sure there will be more requests for this when more people and organizations start to use EKS over AWS WaveLength since you want to deploy on a specific WL and it is much easier to use PodNodeSelector at the namespace level.

@SergeyMuha
Copy link

Need this for EKS!!!

@rotemsh15
Copy link

need this for EKS.
AKS has this enabled and readily available.

@c-datculescu
Copy link

c-datculescu commented Sep 14, 2021

We took a deeper look at this. Because the namespaces that are declared for this controller are statically defined in config files that are on the api server, it is not something that we can easily enable today. We're keeping this on our backlog and will continue to evaluate the feasibility of properly enabling this controller in the future.

Usually noone is interested in the file format configuration, most ppl are interested in the configuration annotation format. So i think the point is rather moot as that is not the primary or the only way of configuring this.

For multi tenant clusters this is a big issue, and i would prefer to not roll my own solution if i have another option that is currently builtin.

Edit: grammar.

@thgruiz
Copy link

thgruiz commented Oct 7, 2021

+1

2 similar comments
@richardmatthewsdev
Copy link

👍

@raghulkrishna
Copy link

+1

@gaurav-kumar-curefit
Copy link

This will be a great feature and help us to solve some problems we are facing if enabled in EKS.

@DodgeCamaro
Copy link

+1

1 similar comment
@valdemarjr
Copy link

+1

@hahasheminejad
Copy link

hahasheminejad commented Jan 1, 2022

As iverberk mentioned, this can be achieved using Gatekeeper mutation feature. It automatically injects tolerations and nodeaffinity to pods at the deployment time.
A great documentation with ready to use configuration can be found here.
https://medium.com/google-cloud/automating-tenant-pod-scheduling-using-policy-controller-mutations-b325f4616943

@ericwang-klarrio
Copy link

Need this for EKS!!!

@eechava66
Copy link

+1

@mikestef9
Copy link
Contributor

Enabling this on API server is not a priority due to challenges outlined in comment above. Instead, we have added a dedicated section to our multi-tenancy best practices guide outlining alternative options for isolating tenant workloads to specific nodes.

@pierluigilenoci
Copy link

pierluigilenoci commented Feb 14, 2022

@mikestef9 so you're telling me that AWS prefers a system for separating workloads based on developer goodwill (adding affinity & taints) or third party software (Gatekeeper, Kyverno) instead of using a native Kubernetes feature?

A feature that Azure seems to have enabled.

It has been requested for almost three years, I would say it has been in the backlog for quite a while.

@mikestef9
Copy link
Contributor

mikestef9 commented Feb 14, 2022

We always prefer a managed built-in solution, but wanted to at least document known alternatives in the EKS best practices guide in the interim. Using the in-tree PodNodeSelector is not the direction we are leaning, but rather providing EKS integration with a policy engine, which can do pod node selection along with many other capabilities. #1435 tracks this feature.

We also think an integrated policy engine is the better answer here, given the pod node selector admission controller has been an alpha feature since Kubernetes v1.5, and EKS generally does not enable alpha features.

@mvalenzisi
Copy link

@mikestef9 the problem is that the integration with a policy engine is not there at the moment, and the community is asking for enabling a native plugin to get the job done.

@pierluigilenoci
Copy link

@mikestef9 I can understand the AWS policy but for PodNodeSelector it is really a special case.
The transition to "stable" only ran aground three years ago not for technical reasons but for lack of drive.
Ref: kubernetes/kubernetes#58818 and kubernetes/kubernetes#60284

@cmsmith7
Copy link

cmsmith7 commented Aug 8, 2022

Hi .. Is there any update on this request?

@afagundes
Copy link

Any updates?

@ichylinux
Copy link

i came to the same challenge.
waiting for any update.

@krishnadas-m
Copy link

+1
Kindly enable this feature

@gfrid
Copy link

gfrid commented Jun 21, 2023

+1 looking for this feature :)

@abcdefstar
Copy link

+1

@aaadipop
Copy link

aaadipop commented Sep 5, 2023

+100 :)

@IanAtSalt
Copy link

+1

@jgawley-videoamp
Copy link

+42

@shehbazk
Copy link

shehbazk commented Nov 8, 2023

+43

@pierluigilenoci
Copy link

Instead of commenting +1, 👍🏻 the issue.
It's the only way to be taken into consideration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EKS Amazon Elastic Kubernetes Service Proposed Community submitted issue
Projects
None yet
Development

No branches or pull requests