Skip to content

cnpg and descheduler #1689

@vtmocanu

Description

@vtmocanu

Anyone managed to get descheduler to work with the CNPG operator?
The pods are managed by the operator so rescheduled ignores them, as they are not part of a deployment.
This is the configuration I have tried:

        pluginConfig:
          - name: DefaultEvictor
            args:
              ignorePvcPods: false
              evictLocalStoragePods: true
              labelSelector:
                matchExpressions:
                  - {
                      key: cnpg.io/instanceRole,
                      operator: NotIn,
                      values: [primary],
                    }
          - name: RemoveDuplicates
          - name: RemovePodsHavingTooManyRestarts
            args:
              podRestartThreshold: 100
              includingInitContainers: true
          - name: RemovePodsViolatingNodeAffinity
            args:
              nodeAffinityType:
                - requiredDuringSchedulingIgnoredDuringExecution
          - name: RemovePodsViolatingNodeTaints
          - name: RemovePodsViolatingInterPodAntiAffinity
          - name: RemovePodsViolatingTopologySpreadConstraint
            args:
              constraints:
                - DoNotSchedule
                - ScheduleAnyway
          - name: LowNodeUtilization
            args:
              thresholds:
                cpu: 20
                memory: 20
                pods: 20
              targetThresholds:
                cpu: 50
                memory: 50
                pods: 50
        plugins:
          balance:
            enabled:
              - RemoveDuplicates
              - RemovePodsViolatingTopologySpreadConstraint
              - LowNodeUtilization
          deschedule:
            enabled:
              - RemovePodsHavingTooManyRestarts
              - RemovePodsViolatingNodeTaints
              - RemovePodsViolatingNodeAffinity
              - RemovePodsViolatingInterPodAntiAffinity

The issue I am trying to solve:

  • drain a node
  • some replicas move to other node
  • initial node recovers, but replicas remain on another node and I end up with multiple replicas on the same node.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions