123456789101112131415 |
- #!/bin/bash
- NODE=$1
- IP=$2
- # localhost:8080 is the endpoint created by kubectl proxy --port=8080
- API_ENDPOINT=${3-localhost:8080}
- [[ -z "$IP" ]] && echo "Usage: $0 <NODE> <IP> [API_ENDPOINT]"
- curl -k -v -XPATCH \
- -H "Accept: application/json" \
- -H "Content-Type: application/json-patch+json" \
- http://${API_ENDPOINT}/api/v1/nodes/$NODE/status \
- --data '[{"op":"add","path":"/status/addresses/-", "value": {"type": "ExternalIP", "address": "'"$IP"'"} }]'
|