Skip to content

Instantly share code, notes, and snippets.

@epequeno
Last active March 7, 2023 14:00
Show Gist options
  • Save epequeno/43966dbb255c1805a3a49fd34bc18802 to your computer and use it in GitHub Desktop.
Save epequeno/43966dbb255c1805a3a49fd34bc18802 to your computer and use it in GitHub Desktop.
use httpie to PATCH k8s
# example derived from https://kubernetes.io/docs/tasks/administer-cluster/extended-resource-node/
NODE_NAME="foo"
URL="localhost:8001/api/v1/nodes/${NODE_NAME}/status Content-Type:application/json-patch+json"
DATA='[{"op": "add", "path": "/status/capacity/example.com~1dongle", "value": "4"}]'
echo -n "${DATA}" | http PATCH "${URL}"
# or
http PATCH "${URL}" <<< "${DATA}"
# or
http PATCH "${URL}" --raw "${DATA}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment