-
Notifications
You must be signed in to change notification settings - Fork 760
feat: enable pod protection based on storage classes #1752
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
feat: enable pod protection based on storage classes #1752
Conversation
|
Skipping CI for Draft Pull Request. |
|
/test all |
edcfa11 to
5d26502
Compare
|
/test all |
5d26502 to
6d02828
Compare
|
/test all |
|
/retest |
|
/test all |
|
/ok-to-test |
6d02828 to
f0f9d98
Compare
|
/test all |
f0f9d98 to
888c4f1
Compare
|
/test all |
googs1025
left a comment
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 use noEvictionPolicy directly to solve this issue? 🤔
Would you mind elaborating more ? I did not follow. |
9a81d63 to
4a2a136
Compare
|
/test pull-descheduler-test-e2e-k8s-master-1-34 |
|
@ingvagabund Any other input on this one ? |
| // i.e. if a pod refers to one of these storage classes it is protected | ||
| // from being evicted. If none is provided then all pods with PVCs are | ||
| // protected from eviction. | ||
| StorageClasses []string `json:"storageClasses,omitempty"` |
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.
API nit: storageClasses name does not directly says whether the list of provided SCs will be protected or "every SC but those listed here" will be protected. s/StorageClasses/ProtectedStorageClasses/ will make it more clear.
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.
For future extension it might be better to go with:
StorageClasses []StorageClassand
type StorageClass struct {
Name string `json:"name,omitempty`
}Just in case other SC options become relevant. E.g. protect based on a provisioner rather a specific storage class name.
With the initial validation requiring the name field to be set for each item in StorageClasses list.
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.
Those are pretty valid points. I have changed the code accordingly. Please take a look.
this commit introduces a new customization on the existing PodsWithPVC
protection. this new customization allow users to make pods that refer
to a given storage class unevictable.
for example, to protect pods referring to `storage-class-0` and
`storage-class-1` this configuration can be used:
```yaml
apiVersion: "descheduler/v1alpha2"
kind: "DeschedulerPolicy"
profiles:
- name: ProfileName
pluginConfig:
- name: "DefaultEvictor"
args:
podProtections:
extraEnabled:
- PodsWithPVC
config:
PodsWithPVC:
protectedStorageClasses:
- name: storage-class-0
- name: storage-class-1
```
changes introduced by this pr:
1. the descheduler starts to observe persistent volume claims.
1. a new api field was introduced to allow per pod protection config.
1. rbac had to be adjusted (+persistentvolumeclaims).
4a2a136 to
d9d6ca6
Compare
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ingvagabund 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 |
Description
fixes #633
this commit introduces a new customization on the existing PodsWithPVC
protection. this new customization allow users to make pods that refer
to a given storage class unevictable.
for example, to protect pods referring to
storage-class-0andstorage-class-1this configuration can be used:Changes introduced by this pr:
Checklist
Please ensure your pull request meets the following criteria before submitting
for review, these items will be used by reviewers to assess the quality and
completeness of your changes: