From 8698c7c85f7e13783bfa1733de60c22d7a50dc39 Mon Sep 17 00:00:00 2001 From: zhouhaoA1 Date: Mon, 29 Apr 2024 14:41:31 +0800 Subject: [PATCH] fix virtualcluster apiserver deploy yaml bug Signed-off-by: zhouhaoA1 --- .../apiserver/mainfests_deployment.go | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/pkg/kubenest/manifest/controlplane/apiserver/mainfests_deployment.go b/pkg/kubenest/manifest/controlplane/apiserver/mainfests_deployment.go index 40cac4b8a..932d0cf14 100644 --- a/pkg/kubenest/manifest/controlplane/apiserver/mainfests_deployment.go +++ b/pkg/kubenest/manifest/controlplane/apiserver/mainfests_deployment.go @@ -26,6 +26,24 @@ spec: - key: "node-role.kubernetes.io/control-plane" operator: "Exists" effect: "NoSchedule" + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: node-role.kubernetes.io/control-plane + operator: Exists + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: virtualCluster-app + operator: In + values: + - apiserver + topologyKey: kubernetes.io/hostname containers: - name: kube-apiserver image: {{ .ImageRepository }}/kube-apiserver:{{ .Version }} @@ -84,24 +102,6 @@ spec: periodSeconds: 10 successThreshold: 1 timeoutSeconds: 15 - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: node-role.kubernetes.io/control-plane - operator: Exists - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 100 - podAffinityTerm: - labelSelector: - matchExpressions: - - key: virtualCluster-app - operator: In - values: - - apiserver - topologyKey: kubernetes.io/hostname ports: - containerPort: {{ .ClusterPort }} name: http