Description
I want to test the pod evict on v1.6.0, and I install the koordinator with the config below
apiVersion: v1 kind: ConfigMap metadata: name: koord-scheduler-config namespace: {{ .Values.installation.namespace }} data: koord-scheduler-config: | apiVersion: kubescheduler.config.k8s.io/v1 kind: KubeSchedulerConfiguration leaderElection: leaderElect: true resourceLock: leases resourceName: koord-scheduler resourceNamespace: {{ .Values.installation.namespace }} profiles: - pluginConfig: ... - name: ElasticQuota args: apiVersion: kubescheduler.config.k8s.io/v1 kind: ElasticQuotaArgs quotaGroupNamespace: {{ .Values.installation.namespace }} enableCheckParentQuota: true # Here I set the True enableRuntimeQuota: true monitorAllQuotas: true revokePodInterval: 5s delayEvictTime: 5sAnd I create 3 quotas below. Here I set the
quota-child1
's min resources to 0 means that there is no guaranteed forquota-child1
. When one pod's quota is set toquota-child1
, it can be killed at any time.apiVersion: scheduling.sigs.k8s.io/v1alpha1 kind: ElasticQuota metadata: name: quota-parent namespace: default labels: quota.scheduling.koordinator.sh/is-parent: "true" spec: max: cpu: 500m memory: 40Mi min: cpu: 500m memory: 40Mi --- apiVersion: scheduling.sigs.k8s.io/v1alpha1 kind: ElasticQuota metadata: name: quota-child1 namespace: default labels: quota.scheduling.koordinator.sh/is-parent: "false" quota.scheduling.koordinator.sh/parent: "quota-parent" spec: max: cpu: 500m memory: 40Mi min: cpu: 0 memory: 0 --- apiVersion: scheduling.sigs.k8s.io/v1alpha1 kind: ElasticQuota metadata: name: quota-child2 namespace: default annotations: quota.scheduling.koordinator.sh/evict-pods-exceed-min: "true" labels: quota.scheduling.koordinator.sh/is-parent: "false" quota.scheduling.koordinator.sh/parent: "quota-parent" spec: max: cpu: 500m memory: 40Mi min: cpu: 500m memory: 40MiAnd I first create the
pod-example
apiVersion: v1 kind: Pod metadata: name: pod-example namespace: default labels: quota.scheduling.koordinator.sh/name: "quota-child1" spec: schedulerName: koord-scheduler containers: - command: - sleep - 5m image: busybox imagePullPolicy: IfNotPresent name: curlimage resources: limits: cpu: 40m memory: 30Mi requests: cpu: 40m memory: 30Mi restartPolicy: NeverAfter the
pod-example
's status isrunning
, I create thepod2-example
apiVersion: v1 kind: Pod metadata: name: pod2-example namespace: default labels: quota.scheduling.koordinator.sh/name: "quota-child2" spec: schedulerName: koord-scheduler containers: - command: - sleep - 5m image: busybox imagePullPolicy: IfNotPresent name: curlimage resources: limits: cpu: 40m memory: 30Mi requests: cpu: 40m memory: 30Mi restartPolicy: NeverSince the memory sum of the two pods(60Mi) is greater than the max of
parent-quota
(50Mi),pod2-example
is at statuspending
because of the code below.So I set the configmap and reinstall the koordinator
apiVersion: v1 kind: ConfigMap metadata: name: koord-scheduler-config namespace: {{ .Values.installation.namespace }} data: koord-scheduler-config: | apiVersion: kubescheduler.config.k8s.io/v1 kind: KubeSchedulerConfiguration leaderElection: leaderElect: true resourceLock: leases resourceName: koord-scheduler resourceNamespace: {{ .Values.installation.namespace }} profiles: - pluginConfig: ... - name: ElasticQuota args: apiVersion: kubescheduler.config.k8s.io/v1 kind: ElasticQuotaArgs quotaGroupNamespace: {{ .Values.installation.namespace }} enableCheckParentQuota: false # Here I set the false enableRuntimeQuota: true monitorAllQuotas: true revokePodInterval: 5s delayEvictTime: 5sand repeat the steps above, it will lead to the scene that
pod-example
and thepod2-example
are running, without evicting any of the pods.And I see the code below and search the logs it reports that the
parent-quota
's used > runtime.However, it did not evict any pods because the pod is not reference for the
parent-quota
koordinator/pkg/scheduler/plugins/elasticquota/core/group_quota_manager.go
Lines 742 to 765 in 0cae469
Is it a bug? Or is there other code I ingore?