From ac4282a6c51dd46fe216941e88c959f0cbbb7f55 Mon Sep 17 00:00:00 2001 From: Joseph Hanson Date: Mon, 21 Oct 2024 09:18:53 -0500 Subject: [PATCH] add descheduler --- .../descheduler/app/helmrelease.yaml | 64 +++++++++++++++++++ .../descheduler/app/kustomization.yaml | 6 ++ .../apps/kube-system/descheduler/ks.yaml | 20 ++++++ .../apps/kube-system/kustomization.yaml | 1 + 4 files changed, 91 insertions(+) create mode 100644 kubernetes/apps/kube-system/descheduler/app/helmrelease.yaml create mode 100644 kubernetes/apps/kube-system/descheduler/app/kustomization.yaml create mode 100644 kubernetes/apps/kube-system/descheduler/ks.yaml diff --git a/kubernetes/apps/kube-system/descheduler/app/helmrelease.yaml b/kubernetes/apps/kube-system/descheduler/app/helmrelease.yaml new file mode 100644 index 00000000..1d53f1e7 --- /dev/null +++ b/kubernetes/apps/kube-system/descheduler/app/helmrelease.yaml @@ -0,0 +1,64 @@ +--- +# yaml-language-server: $schema=https://ks.hsn.dev/helm.toolkit.fluxcd.io/helmrelease_v2.json +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: descheduler +spec: + interval: 30m + chart: + spec: + chart: descheduler + version: 0.31.0 + sourceRef: + kind: HelmRepository + name: descheduler + namespace: flux-system + install: + remediation: + retries: 3 + upgrade: + cleanupOnFail: true + remediation: + strategy: rollback + retries: 3 + values: + replicas: 2 + kind: Deployment + deschedulerPolicyAPIVersion: descheduler/v1alpha2 + deschedulerPolicy: + profiles: + - name: Default + pluginConfig: + - name: DefaultEvictor + args: + evictFailedBarePods: true + evictLocalStoragePods: true + evictSystemCriticalPods: true + nodeFit: true + - name: RemovePodsViolatingInterPodAntiAffinity + - name: RemovePodsViolatingNodeAffinity + args: + nodeAffinityType: + - requiredDuringSchedulingIgnoredDuringExecution + - name: RemovePodsViolatingNodeTaints + - name: RemovePodsViolatingTopologySpreadConstraint + args: + constraints: + - DoNotSchedule + - ScheduleAnyway + plugins: + balance: + enabled: + - RemovePodsViolatingTopologySpreadConstraint + deschedule: + enabled: + - RemovePodsViolatingInterPodAntiAffinity + - RemovePodsViolatingNodeAffinity + - RemovePodsViolatingNodeTaints + service: + enabled: true + serviceMonitor: + enabled: true + leaderElection: + enabled: true diff --git a/kubernetes/apps/kube-system/descheduler/app/kustomization.yaml b/kubernetes/apps/kube-system/descheduler/app/kustomization.yaml new file mode 100644 index 00000000..17cbc72b --- /dev/null +++ b/kubernetes/apps/kube-system/descheduler/app/kustomization.yaml @@ -0,0 +1,6 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ./helmrelease.yaml diff --git a/kubernetes/apps/kube-system/descheduler/ks.yaml b/kubernetes/apps/kube-system/descheduler/ks.yaml new file mode 100644 index 00000000..5cbb41e2 --- /dev/null +++ b/kubernetes/apps/kube-system/descheduler/ks.yaml @@ -0,0 +1,20 @@ +--- +# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: &app descheduler + namespace: flux-system +spec: + targetNamespace: kube-system + commonMetadata: + labels: + app.kubernetes.io/name: *app + path: ./kubernetes/apps/kube-system/descheduler/app + prune: true + sourceRef: + kind: GitRepository + name: theshire + wait: false + interval: 30m + timeout: 5m diff --git a/kubernetes/apps/kube-system/kustomization.yaml b/kubernetes/apps/kube-system/kustomization.yaml index 60721059..8abd0af6 100644 --- a/kubernetes/apps/kube-system/kustomization.yaml +++ b/kubernetes/apps/kube-system/kustomization.yaml @@ -8,6 +8,7 @@ resources: # Flux-Kustomizations - ./cilium/ks.yaml - ./coredns/ks.yaml + - ./descheduler/ks.yaml - ./dnsimple-webhook-rbac.yaml - ./fstrim/ks.yaml - ./kubelet-csr-approver/ks.yaml