From 3faaa2fbdb3faa3920092e555602a1ce9e6d97ff Mon Sep 17 00:00:00 2001 From: hanjunlee Date: Sun, 14 Jul 2019 22:38:04 +0900 Subject: [PATCH] Change the way to select the node by node name --- engine/kube/kube.go | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/engine/kube/kube.go b/engine/kube/kube.go index 73860e2..821d35d 100644 --- a/engine/kube/kube.go +++ b/engine/kube/kube.go @@ -134,19 +134,7 @@ func (e *kubeEngine) Start(ctx context.Context, spec *engine.Spec, step *engine. } if e.node != "" { - pod.Spec.Affinity = &v1.Affinity{ - NodeAffinity: &v1.NodeAffinity{ - RequiredDuringSchedulingIgnoredDuringExecution: &v1.NodeSelector{ - NodeSelectorTerms: []v1.NodeSelectorTerm{{ - MatchExpressions: []v1.NodeSelectorRequirement{{ - Key: "kubernetes.io/hostname", - Operator: v1.NodeSelectorOpIn, - Values: []string{e.node}, - }}, - }}, - }, - }, - } + pod.Spec.NodeName = e.node } _, err := e.client.CoreV1().Pods(spec.Metadata.Namespace).Create(pod)