title: How to delete a label for a kubernetes pod
body: <p>I want delete label from a node or a pod by kubernetes API, my kubernetes version:1.24</p>
  
  <pre><code>kubectl get pod --show-labels | grep all-flow-0fbah
  all-flow-0fbah      1/1     Running   2        9d      app=all-flow,op=vps1,version=1001
  </code></pre>
  
  <p>I use command as below:</p>
  
  <pre><code> curl --request PATCH --header "Content-Type:application/json-patch+json" http://10.93.78.11:8080/api/v1/namespaces/default/pods/all-flow-0fbah --data '{"metadata":{"labels":{"a":"b"}}}'
  </code></pre>
  
  <p>But this doesn't work. Return message as below:</p>
  
  <pre><code>{
    "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
  }
  </code></pre>
  
  <p>Then I change the curl header like this :</p>
  
  <pre><code>curl --request PATCH --header "Content-Type:application/merge-patch+json" http://10.93.78.11:8080/api/v1/namespaces/default/pods/all-flow-0fbah --data '{"meadata":{"labels":{"op":"vps3"}}}'
  </code></pre>
  
  <p>It not delete label but add a new label to that pod.
  So is there any one can tell me how to delete a label for a pod like use command :</p>
  
  <pre><code>kubectl label pod all-flow-0fbah key-
  </code></pre>
  
  <p>Thanks!</p>