Skip to content
This repository has been archived by the owner on Jun 23, 2020. It is now read-only.

Resolve pod could be scheduled by node name. #77

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions engine/kube/kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down