mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-01-26 05:14:13 +01:00
Compare commits
4 Commits
85b1d97dda
...
deschedule
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4aa541fa5b | ||
|
|
b5ae7da164 | ||
|
|
de1dcaeb4b | ||
|
|
c6c2e2d7fc |
4
.github/workflows/manifests.yaml
vendored
4
.github/workflows/manifests.yaml
vendored
@@ -7,8 +7,8 @@ jobs:
|
|||||||
deploy:
|
deploy:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
k8s-version: ["v1.26.0"]
|
k8s-version: ["v1.27.0"]
|
||||||
descheduler-version: ["v0.26.1"]
|
descheduler-version: ["v0.27.1"]
|
||||||
descheduler-api: ["v1alpha1", "v1alpha2"]
|
descheduler-api: ["v1alpha1", "v1alpha2"]
|
||||||
manifest: ["deployment"]
|
manifest: ["deployment"]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
name: descheduler
|
name: descheduler
|
||||||
version: 0.27.0
|
version: 0.27.1
|
||||||
appVersion: 0.27.0
|
appVersion: 0.27.1
|
||||||
description: Descheduler for Kubernetes is used to rebalance clusters by evicting pods that can potentially be scheduled on better nodes. In the current implementation, descheduler does not schedule replacement of evicted pods but relies on the default scheduler for that.
|
description: Descheduler for Kubernetes is used to rebalance clusters by evicting pods that can potentially be scheduled on better nodes. In the current implementation, descheduler does not schedule replacement of evicted pods but relies on the default scheduler for that.
|
||||||
keywords:
|
keywords:
|
||||||
- kubernetes
|
- kubernetes
|
||||||
|
|||||||
@@ -109,17 +109,17 @@ See the [resources | Kustomize](https://kubectl.docs.kubernetes.io/references/ku
|
|||||||
|
|
||||||
Run As A Job
|
Run As A Job
|
||||||
```
|
```
|
||||||
kustomize build 'github.com/kubernetes-sigs/descheduler/kubernetes/job?ref=v0.27.0' | kubectl apply -f -
|
kustomize build 'github.com/kubernetes-sigs/descheduler/kubernetes/job?ref=v0.27.1' | kubectl apply -f -
|
||||||
```
|
```
|
||||||
|
|
||||||
Run As A CronJob
|
Run As A CronJob
|
||||||
```
|
```
|
||||||
kustomize build 'github.com/kubernetes-sigs/descheduler/kubernetes/cronjob?ref=v0.27.0' | kubectl apply -f -
|
kustomize build 'github.com/kubernetes-sigs/descheduler/kubernetes/cronjob?ref=v0.27.1' | kubectl apply -f -
|
||||||
```
|
```
|
||||||
|
|
||||||
Run As A Deployment
|
Run As A Deployment
|
||||||
```
|
```
|
||||||
kustomize build 'github.com/kubernetes-sigs/descheduler/kubernetes/deployment?ref=v0.27.0' | kubectl apply -f -
|
kustomize build 'github.com/kubernetes-sigs/descheduler/kubernetes/deployment?ref=v0.27.1' | kubectl apply -f -
|
||||||
```
|
```
|
||||||
|
|
||||||
## User Guide
|
## User Guide
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ Starting with descheduler release v0.10.0 container images are available in the
|
|||||||
|
|
||||||
Descheduler Version | Container Image | Architectures |
|
Descheduler Version | Container Image | Architectures |
|
||||||
------------------- |-------------------------------------------------|-------------------------|
|
------------------- |-------------------------------------------------|-------------------------|
|
||||||
|
v0.27.1 | registry.k8s.io/descheduler/descheduler:v0.27.1 | AMD64<br>ARM64<br>ARMv7 |
|
||||||
v0.27.0 | registry.k8s.io/descheduler/descheduler:v0.27.0 | AMD64<br>ARM64<br>ARMv7 |
|
v0.27.0 | registry.k8s.io/descheduler/descheduler:v0.27.0 | AMD64<br>ARM64<br>ARMv7 |
|
||||||
v0.26.1 | registry.k8s.io/descheduler/descheduler:v0.26.1 | AMD64<br>ARM64<br>ARMv7 |
|
v0.26.1 | registry.k8s.io/descheduler/descheduler:v0.26.1 | AMD64<br>ARM64<br>ARMv7 |
|
||||||
v0.26.0 | registry.k8s.io/descheduler/descheduler:v0.26.0 | AMD64<br>ARM64<br>ARMv7 |
|
v0.26.0 | registry.k8s.io/descheduler/descheduler:v0.26.0 | AMD64<br>ARM64<br>ARMv7 |
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ spec:
|
|||||||
priorityClassName: system-cluster-critical
|
priorityClassName: system-cluster-critical
|
||||||
containers:
|
containers:
|
||||||
- name: descheduler
|
- name: descheduler
|
||||||
image: registry.k8s.io/descheduler/descheduler:v0.27.0
|
image: registry.k8s.io/descheduler/descheduler:v0.27.1
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: /policy-dir
|
- mountPath: /policy-dir
|
||||||
name: policy-volume
|
name: policy-volume
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ spec:
|
|||||||
serviceAccountName: descheduler-sa
|
serviceAccountName: descheduler-sa
|
||||||
containers:
|
containers:
|
||||||
- name: descheduler
|
- name: descheduler
|
||||||
image: registry.k8s.io/descheduler/descheduler:v0.27.0
|
image: registry.k8s.io/descheduler/descheduler:v0.27.1
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
command:
|
command:
|
||||||
- "/bin/descheduler"
|
- "/bin/descheduler"
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ spec:
|
|||||||
priorityClassName: system-cluster-critical
|
priorityClassName: system-cluster-critical
|
||||||
containers:
|
containers:
|
||||||
- name: descheduler
|
- name: descheduler
|
||||||
image: registry.k8s.io/descheduler/descheduler:v0.27.0
|
image: registry.k8s.io/descheduler/descheduler:v0.27.1
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: /policy-dir
|
- mountPath: /policy-dir
|
||||||
name: policy-volume
|
name: policy-volume
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ func convertToInternalPluginConfigArgs(out *api.DeschedulerPolicy) error {
|
|||||||
func Convert_v1alpha2_PluginConfig_To_api_PluginConfig(in *PluginConfig, out *api.PluginConfig, s conversion.Scope) error {
|
func Convert_v1alpha2_PluginConfig_To_api_PluginConfig(in *PluginConfig, out *api.PluginConfig, s conversion.Scope) error {
|
||||||
out.Name = in.Name
|
out.Name = in.Name
|
||||||
if _, ok := pluginregistry.PluginRegistry[in.Name]; ok {
|
if _, ok := pluginregistry.PluginRegistry[in.Name]; ok {
|
||||||
out.Args = pluginregistry.PluginRegistry[in.Name].PluginArgInstance
|
out.Args = pluginregistry.PluginRegistry[in.Name].PluginArgInstance.DeepCopyObject()
|
||||||
if in.Args.Raw != nil {
|
if in.Args.Raw != nil {
|
||||||
_, _, err := Codecs.UniversalDecoder().Decode(in.Args.Raw, nil, out.Args)
|
_, _, err := Codecs.UniversalDecoder().Decode(in.Args.Raw, nil, out.Args)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
utilerrors "k8s.io/apimachinery/pkg/util/errors"
|
||||||
|
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
clientset "k8s.io/client-go/kubernetes"
|
clientset "k8s.io/client-go/kubernetes"
|
||||||
"k8s.io/klog/v2"
|
"k8s.io/klog/v2"
|
||||||
@@ -133,29 +135,22 @@ func setDefaultEvictor(profile api.DeschedulerProfile, client clientset.Interfac
|
|||||||
}
|
}
|
||||||
|
|
||||||
func validateDeschedulerConfiguration(in api.DeschedulerPolicy, registry pluginregistry.Registry) error {
|
func validateDeschedulerConfiguration(in api.DeschedulerPolicy, registry pluginregistry.Registry) error {
|
||||||
var errorsInProfiles error
|
var errorsInProfiles []error
|
||||||
for _, profile := range in.Profiles {
|
for _, profile := range in.Profiles {
|
||||||
for _, pluginConfig := range profile.PluginConfigs {
|
for _, pluginConfig := range profile.PluginConfigs {
|
||||||
if _, ok := registry[pluginConfig.Name]; ok {
|
if _, ok := registry[pluginConfig.Name]; !ok {
|
||||||
if _, ok := registry[pluginConfig.Name]; !ok {
|
errorsInProfiles = append(errorsInProfiles, fmt.Errorf("in profile %s: plugin %s in pluginConfig not registered", profile.Name, pluginConfig.Name))
|
||||||
errorsInProfiles = fmt.Errorf("%w: %s", errorsInProfiles, fmt.Sprintf("in profile %s: plugin %s in pluginConfig not registered", profile.Name, pluginConfig.Name))
|
continue
|
||||||
continue
|
}
|
||||||
}
|
|
||||||
|
|
||||||
pluginUtilities := registry[pluginConfig.Name]
|
pluginUtilities := registry[pluginConfig.Name]
|
||||||
if pluginUtilities.PluginArgValidator == nil {
|
if pluginUtilities.PluginArgValidator == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
err := pluginUtilities.PluginArgValidator(pluginConfig.Args)
|
if err := pluginUtilities.PluginArgValidator(pluginConfig.Args); err != nil {
|
||||||
if err != nil {
|
errorsInProfiles = append(errorsInProfiles, fmt.Errorf("in profile %s: %s", profile.Name, err.Error()))
|
||||||
if errorsInProfiles == nil {
|
|
||||||
errorsInProfiles = fmt.Errorf("in profile %s: %s", profile.Name, err.Error())
|
|
||||||
} else {
|
|
||||||
errorsInProfiles = fmt.Errorf("%w: %s", errorsInProfiles, fmt.Sprintf("in profile %s: %s", profile.Name, err.Error()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return errorsInProfiles
|
return utilerrors.NewAggregate(errorsInProfiles)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -985,7 +985,7 @@ func TestValidateDeschedulerConfiguration(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
result: fmt.Errorf("in profile RemoveFailedPods: only one of Include/Exclude namespaces can be set: in profile RemovePodsViolatingTopologySpreadConstraint: only one of Include/Exclude namespaces can be set"),
|
result: fmt.Errorf("[in profile RemoveFailedPods: only one of Include/Exclude namespaces can be set, in profile RemovePodsViolatingTopologySpreadConstraint: only one of Include/Exclude namespaces can be set]"),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user