From 2c717559c35427080feb8876bc769d0ecf1f7161 Mon Sep 17 00:00:00 2001 From: Tim Ebert Date: Sun, 10 Sep 2023 21:19:03 +0200 Subject: [PATCH] Schedule etcd-main and kube-apiserver to high-cpu worker pool --- .../config/policy/controlplane/etcd-main.yaml | 19 +++++++++++++++++++ .../policy/controlplane/kube-apiserver.yaml | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/webhosting-operator/config/policy/controlplane/etcd-main.yaml b/webhosting-operator/config/policy/controlplane/etcd-main.yaml index d614ef62..aeae194b 100644 --- a/webhosting-operator/config/policy/controlplane/etcd-main.yaml +++ b/webhosting-operator/config/policy/controlplane/etcd-main.yaml @@ -29,3 +29,22 @@ spec: limits: cpu: 12000m memory: 12Gi + # schedule etcd-main on high-cpu worker pool for stable performance + - name: add-scheduling-constraints + match: + any: + - resources: + kinds: + - Pod + selector: + matchLabels: + instance: etcd-main + name: etcd + mutate: + patchesJson6902: |- + - op: add + path: "/spec/tolerations/-" + value: {"key":"high-cpu","operator":"Equal","value":"true","effect":"NoSchedule"} + - op: add + path: "/spec/affinity/nodeAffinity/requiredDuringSchedulingIgnoredDuringExecution/nodeSelectorTerms/-" + value: {"matchExpressions": [{"key":"high-cpu","operator":"In","values":["true"]}]} diff --git a/webhosting-operator/config/policy/controlplane/kube-apiserver.yaml b/webhosting-operator/config/policy/controlplane/kube-apiserver.yaml index fae6acf6..f74ab6a3 100644 --- a/webhosting-operator/config/policy/controlplane/kube-apiserver.yaml +++ b/webhosting-operator/config/policy/controlplane/kube-apiserver.yaml @@ -53,3 +53,22 @@ spec: limits: cpu: 12000m memory: 12Gi + # schedule kube-apiserver on high-cpu worker pool for stable performance + - name: add-scheduling-constraints + match: + any: + - resources: + kinds: + - Pod + selector: + matchLabels: + app: kubernetes + role: apiserver + mutate: + patchesJson6902: |- + - op: add + path: "/spec/tolerations/-" + value: {"key":"high-cpu","operator":"Equal","value":"true","effect":"NoSchedule"} + - op: add + path: "/spec/affinity/nodeAffinity/requiredDuringSchedulingIgnoredDuringExecution/nodeSelectorTerms/-" + value: {"matchExpressions": [{"key":"high-cpu","operator":"In","values":["true"]}]}