0
我試圖模仿kubectl patch
的行爲。我有以下的有效載荷JSON發送一個HTTP PATCH:如何通過Kubernetes API將節點設置爲不可修改狀態?
{
"apiVersion": "v1",
"kind": "Node",
"metadata": {
"name": "my-node-hostname"
},
"spec": {
"unschedulable": true
}
}
但是,不管我怎麼似乎調整這個JSON,我不斷收到一個415及以下JSON狀態回:
{
"kind": "Status",
"apiVersion": "v1",
"metadata": {},
"status": "Failure",
"message": "the server responded with the status code 415 but did not return more information",
"details": {},
"code": 415
}
即使調試kube-apiserver設置爲1000,我也沒有收到有關負載爲何錯誤的反饋!
在通過PATCH發送的JSON有效負載中應該使用哪種特定格式來啓用此功能?