Hi,
I’m learning Mannambeth’s CKA course in Udemy.
In the lecture [53. Manual Scheduling], he said that we can POST binding to the kube-apiserver for manual scheduling.
Belows are my trails (I tested in KillerCoda environment) :
- make an nginx pod with
kubectl run nginx --image=nginx
. The pod was scheduled onnode01
- open apiserver by
kubectl proxy
command - make a binding.json file
cat <<EOF > binding.json
{
"apiVersion":"v1",
"kind":"Binding",
"metadata": {
"name":"nginx"
},
"target": {
"apiVersion":"v1",
"kind":"Node",
"name":"controlplane"
}
}
EOF
- POST the binding.json file to the api server
curl -X POST http://127.0.0.1:8001/api/v1/namespaces/default/pods/nginx/binding \
-H "Content-Type: application/json" \
-d @binding.json
- result
{
“kind”: “Status”,
“apiVersion”: “v1”,
“metadata”: {},
“status”: “Failure”,
“message”: “Operation cannot be fulfilled on pods/binding "nginx": pod nginx is already assigned to node "node01"”,
“reason”: “Conflict”,
“details”: {
“name”: “nginx”,
“kind”: “pods/binding”
},
“code”: 409
}
I posted this topic because the result conflicts to the lecture.
Thank you