While working on the Manual Scheduling Practice Test I am also faced the same problem as Santash. I do change the curl command as suggested by Vijin. But I am not able to schedule the pod using the command as per question number 3 where it says to schedule the pod to “node01”. Then I delete the pod and rec-create the same by manually entering the “nodeName” parameter. Then while trying to answer question number 4 to schedule the same pod to “master” node, I tried the curl command but receiving the failure message.
},
“status”: “Failure”,
“message”: “pods "nginx" is forbidden: User "system:anonymous" cannot create resource "pods/binding" in API group "" in the namespace "default"”,
“reason”: “Forbidden”,
“details”: {
“name”: “nginx”,
“kind”: “pods”
},
“code”: 403
run ‘kubectl proxy &’ it will open 8001 port on localhost
Use the localhost:8001 as server address while making the API call
curl --header “Content-type: application/json” --header “Authorization: Bearer $TOKEN” --request POST --data ‘{“apiVersion”: “v1”, “kind”: “Binding”, “metadata”: {“name”: “nginx”}, “target”: {“apiVersion”: “v1”, “kind”: “Node”, “name”: “controlplane”}}’ http://127.0.0.1:8001/api/v1/namespaces/default/pods/nginx/binding/
{
“kind”: “Status”,
“apiVersion”: “v1”,
“metadata”: {},
“status”: “Success”,
“code”: 201
}