kubernetes-sigs / karpenter

Karpenter is a Kubernetes Node Autoscaler built for flexibility, performance, and simplicity.
Apache License 2.0
630 stars 205 forks source link

Support the `cluster-autoscaler.kubernetes.io/safe-to-evict` annotation #703

Open thelabdude opened 1 year ago

thelabdude commented 1 year ago

Tell us about your request

Would be great if Karpenter treated pods with the cluster-autoscaler.kubernetes.io/safe-to-evict annotation as the same as the karpenter.sh/do-not-evict annotation.

Basically, cluster-autoscaler.kubernetes.io/safe-to-evict: "false" is equivalent to karpenter.sh/do-not-evict: "true"

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?

This would help teams migrate from CAS to Karpenter w/o requiring re-config.

The other wrinkle here is it's not possible to write a generic OPA assign metadata mutator to add the karpenter.sh/do-not-evict annotation b/c you can't find pods by annotation (only by label).

Are you currently working around this issue?

We use OPA assign metadata mutators but have to know all the possible label selectors to find pods in our clusters with the cluster-autoscaler.kubernetes.io/safe-to-evict: "false" annotation.

Additional Context

No response

Attachments

No response

Community Note

jonathan-innis commented 1 year ago

This is an interesting one. I definitely think that it makes sense from a migration perspective.

you can't find pods by annotation

I'm curious what the path looks like for migration here in your opinion. Do you plan to eventually migrate away from the CAS annotation and start adding the Karpenter annotation with the OPA mutation webhooks.

sftim commented 1 year ago

Tell us about your request

Would be great if Karpenter treated pods with the cluster-autoscaler.kubernetes.io/safe-to-evict annotation as the same as the karpenter.sh/do-not-evict annotation.

I like the idea; I think it should be off by default and easy to opt in to. Perhaps a configuration option for each Provisioner? Something a bit like a selector, but for annotations and only matching the value as be "true", "false" or neither.

k8s-triage-robot commented 9 months ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

jonathan-innis commented 9 months ago

/remove-lifecycle stale

k8s-triage-robot commented 6 months ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 5 months ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot commented 4 months ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-ci-robot commented 4 months ago

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to [this](https://github.com/kubernetes-sigs/karpenter/issues/703#issuecomment-2198492905): >The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. > >This bot triages issues according to the following rules: >- After 90d of inactivity, `lifecycle/stale` is applied >- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied >- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed > >You can: >- Reopen this issue with `/reopen` >- Mark this issue as fresh with `/remove-lifecycle rotten` >- Offer to help out with [Issue Triage][1] > >Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community). > >/close not-planned > >[1]: https://www.kubernetes.dev/docs/guide/issue-triage/ Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
jonathan-innis commented 4 months ago

/reopen

k8s-ci-robot commented 4 months ago

@jonathan-innis: Reopened this issue.

In response to [this](https://github.com/kubernetes-sigs/karpenter/issues/703#issuecomment-2198679202): >/reopen Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
jonathan-innis commented 4 months ago

/remove-lifecycle rotten

k8s-ci-robot commented 4 months ago

This issue is currently awaiting triage.

If Karpenter contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
k8s-triage-robot commented 1 month ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 2 weeks ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten