apiVersion: apps/v1
kind: Deployment
metadata:
  name: descheduler
  namespace: descheduler
  labels:
    app.kubernetes.io/name: descheduler
    helm.sh/chart: descheduler-0.36.0
    app.kubernetes.io/instance: descheduler
    app.kubernetes.io/version: "0.36.0"
    app.kubernetes.io/managed-by: Helm
spec:
  replicas: 3
  selector:
    matchLabels:
      app.kubernetes.io/name: descheduler
      app.kubernetes.io/instance: descheduler
  template:
    metadata:
      labels:
        app.kubernetes.io/name: descheduler
        app.kubernetes.io/instance: descheduler
      annotations:
        checksum/config: 8ae1a5a7c2c3c4d11c72cc4f36d9d77340271b5f9211df780c701ce128c457bd
    spec:
      priorityClassName: system-cluster-critical
      serviceAccountName: descheduler
      containers:
        - name: descheduler
          image: "registry.k8s.io/descheduler/descheduler:v0.36.0@sha256:7ca92c0a7b4f1c51d306409da6b832005fcadb224e384795646376726734c6e5"
          imagePullPolicy: IfNotPresent
          command:
            - /bin/descheduler
          args:
            - --policy-config-file=/policy-dir/policy.yaml
            - --descheduling-interval=2m
            - --v=3
            - --leader-elect=true
            - --leader-elect-lease-duration=15s
            - --leader-elect-renew-deadline=10s
            - --leader-elect-retry-period=2s
            - --leader-elect-resource-lock=leases
            - --leader-elect-resource-name=descheduler
            - --leader-elect-resource-namespace=descheduler
          ports:
            - containerPort: 10258
              protocol: TCP
          livenessProbe:
            failureThreshold: 3
            httpGet:
              path: /healthz
              port: 10258
              scheme: HTTPS
            initialDelaySeconds: 5
            periodSeconds: 20
            timeoutSeconds: 5
          resources:
            limits: {}
            requests:
              cpu: 10m
              memory: 50Mi
          securityContext:
            allowPrivilegeEscalation: false
            capabilities:
              drop:
                - ALL
            privileged: false
            readOnlyRootFilesystem: true
            runAsNonRoot: true
            runAsUser: 1000
          volumeMounts:
            - mountPath: /policy-dir
              name: policy-volume
      volumes:
        - name: policy-volume
          configMap:
            name: descheduler
