diff --git a/kubernetes/raspberry/flux/repositories/helm/descheduler.yaml b/kubernetes/raspberry/flux/repositories/helm/descheduler.yaml new file mode 100644 index 00000000..0c43c9fb --- /dev/null +++ b/kubernetes/raspberry/flux/repositories/helm/descheduler.yaml @@ -0,0 +1,10 @@ +--- +# yaml-language-server: $schema=https://github.com/fluxcd-community/flux2-schemas/raw/main/helmrepository-source-v1beta2.json +apiVersion: source.toolkit.fluxcd.io/v1 +kind: HelmRepository +metadata: + name: descheduler + namespace: flux-system +spec: + interval: 2h + url: https://kubernetes-sigs.github.io/descheduler diff --git a/kubernetes/raspberry/flux/repositories/helm/kustomization.yaml b/kubernetes/raspberry/flux/repositories/helm/kustomization.yaml index 06a48482..b490b124 100644 --- a/kubernetes/raspberry/flux/repositories/helm/kustomization.yaml +++ b/kubernetes/raspberry/flux/repositories/helm/kustomization.yaml @@ -4,6 +4,7 @@ kind: Kustomization resources: - bjw-s.yaml - cilium.yaml + - descheduler.yaml - external-dns.yaml - ingress-nginx.yaml - jetstack.yaml diff --git a/kubernetes/raspberry/kube-system/descheduler/app/helmrelease.yaml b/kubernetes/raspberry/kube-system/descheduler/app/helmrelease.yaml new file mode 100644 index 00000000..46d3a8d3 --- /dev/null +++ b/kubernetes/raspberry/kube-system/descheduler/app/helmrelease.yaml @@ -0,0 +1,88 @@ +--- +# yaml-language-server: $schema=https://github.com/fluxcd-community/flux2-schemas/raw/main/helmrelease-helm-v2.json +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: &app descheduler + namespace: kube-system +spec: + interval: 1h + chart: + spec: + chart: descheduler + version: 0.30.2 + sourceRef: + kind: HelmRepository + name: descheduler + namespace: flux-system + install: + remediation: + retries: 3 + upgrade: + cleanupOnFail: true + remediation: + strategy: rollback + retries: 3 + values: + kind: Deployment + deschedulerPolicy: + profiles: + - name: Default + pluginConfig: + - name: DefaultEvictor + args: + evictFailedBarePods: true + evictLocalStoragePods: true + evictSystemCriticalPods: true + nodeFit: true + - name: RemoveDuplicates + - name: RemovePodsHavingTooManyRestarts + args: + podRestartThreshold: 100 + includingInitContainers: true + - name: RemovePodsViolatingInterPodAntiAffinity + - name: RemovePodsViolatingNodeAffinity + args: + nodeAffinityType: + - requiredDuringSchedulingIgnoredDuringExecution + - name: RemovePodsViolatingNodeTaints + - name: RemovePodsViolatingTopologySpreadConstraint + args: + constraints: + - DoNotSchedule + - ScheduleAnyway + - name: LowNodeUtilization + namespaces: + exclude: + - "longhorn-system" + args: + thresholds: + cpu: 40 + memory: 40 + targetThresholds: + cpu: 60 + memory: 60 + plugins: + balance: + enabled: + - RemoveDuplicates + - RemovePodsViolatingTopologySpreadConstraint + - LowNodeUtilization + deschedule: + enabled: + - RemovePodsViolatingInterPodAntiAffinity + - RemovePodsViolatingNodeAffinity + - RemovePodsViolatingNodeTaints + service: + enabled: true + serviceMonitor: + enabled: true + leaderElection: + enabled: true + resources: + requests: + cpu: 100m + memory: 128Mi + limits: + cpu: 100m + memory: 128Mi diff --git a/kubernetes/raspberry/kube-system/descheduler/app/kustomization.yaml b/kubernetes/raspberry/kube-system/descheduler/app/kustomization.yaml new file mode 100644 index 00000000..dbc604ed --- /dev/null +++ b/kubernetes/raspberry/kube-system/descheduler/app/kustomization.yaml @@ -0,0 +1,5 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - helmrelease.yaml diff --git a/kubernetes/raspberry/kube-system/descheduler/ks.yaml b/kubernetes/raspberry/kube-system/descheduler/ks.yaml new file mode 100644 index 00000000..8c60c58b --- /dev/null +++ b/kubernetes/raspberry/kube-system/descheduler/ks.yaml @@ -0,0 +1,21 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-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/raspberry/kube-system/descheduler/app + prune: true + sourceRef: + kind: GitRepository + name: flux-system + wait: false + interval: 30m + retryInterval: 1m + timeout: 5m diff --git a/kubernetes/raspberry/kube-system/kustomization.yaml b/kubernetes/raspberry/kube-system/kustomization.yaml index 39a9b6e8..0b947754 100644 --- a/kubernetes/raspberry/kube-system/kustomization.yaml +++ b/kubernetes/raspberry/kube-system/kustomization.yaml @@ -3,5 +3,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - cilium/ks.yaml + - descheduler/ks.yaml - metrics-server/ks.yaml - namespace.yaml