Differentiated update nodes
Requests
HTTP request
PATCH /kubernetes/{cluster}/api/v1/nodes/{name}
partially update the specified Node
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | True | name of the Node |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| dryRun | string | False | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed |
| fieldManager | string | False | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). |
| force | boolean | False | Force is going to "force" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. |
| pretty | string | False | If 'true', then the output is pretty printed. |
Request body
Content-Type
application/json-patch+json,
application/merge-patch+json,
application/strategic-merge-patch+json,
application/apply-patch+yaml
Sample request
Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.
{
"metadata": {
"annotations": {
"cpaas.io/display-name": "node-1"
}
}
}Responses
Content-Type
application/json,
application/yaml,
application/vnd.kubernetes.protobuf
Status code: 200
OK
Sample response
Node is a worker node in Kubernetes. Each node will have a unique identifier in the cache (i.e. in etcd).
{
"apiVersion": "v1",
"kind": "Node",
"metadata": {
"annotations": {
"cpaas.io/display-name": "node-1",
"kubeadm.alpha.kubernetes.io/cri-socket": "/var/run/dockershim.sock",
"node.alpha.kubernetes.io/ttl": "0",
"ovn.kubernetes.io/allocated": "true",
"ovn.kubernetes.io/chassis": "8a13eb92-aee5-46ba-b569-ae6b88535ad8",
"ovn.kubernetes.io/cidr": "100.64.0.0/16",
"ovn.kubernetes.io/gateway": "100.64.0.1",
"ovn.kubernetes.io/ip_address": "100.64.0.4",
"ovn.kubernetes.io/logical_switch": "join",
"ovn.kubernetes.io/mac_address": "00:00:00:26:9C:BD",
"ovn.kubernetes.io/port_name": "node-192.168.0.104",
"volumes.kubernetes.io/controller-managed-attach-detach": "true"
},
"creationTimestamp": "2022-04-10T07:10:25Z",
"labels": {
"beta.kubernetes.io/arch": "amd64",
"beta.kubernetes.io/os": "linux",
"cpaas-system-alb": "",
"kube-ovn/role": "master",
"kubernetes.io/arch": "amd64",
"kubernetes.io/hostname": "192.168.0.104",
"kubernetes.io/os": "linux",
"node-role.kubernetes.io/control-plane": "",
"node-role.kubernetes.io/master": "",
"node.kubernetes.io/exclude-from-external-load-balancers": "",
"nvidia-device-enable": "false",
"platform.tkestack.io/machine-ip": "192.168.0.104"
},
"name": "192.168.0.104",
"resourceVersion": "3934932",
"uid": "66657421-cd82-43f1-b527-386be0cfa9be"
},
"spec": {
"podCIDR": "172.199.0.0/24",
"podCIDRs": [
"172.199.0.0/24"
]
},
"status": {
"addresses": [
{
"address": "192.168.0.104",
"type": "InternalIP"
},
{
"address": "192.168.0.104",
"type": "Hostname"
}
],
"allocatable": {
"cpu": "23800m",
"ephemeral-storage": "193000915035",
"hugepages-1Gi": "0",
"hugepages-2Mi": "0",
"memory": "48164932Ki",
"pods": "110"
},
"capacity": {
"cpu": "24",
"ephemeral-storage": "209419396Ki",
"hugepages-1Gi": "0",
"hugepages-2Mi": "0",
"memory": "49291332Ki",
"pods": "110"
},
"conditions": [
{
"lastHeartbeatTime": "2022-04-12T08:09:37Z",
"lastTransitionTime": "2022-04-10T07:29:09Z",
"message": "Kubelet has sufficient FileDescriptor available",
"reason": "NodeHasSufficientFD",
"status": "False",
"type": "NodeHasInsufficientFD"
},
{
"lastHeartbeatTime": "2022-04-12T08:09:37Z",
"lastTransitionTime": "2022-04-10T07:29:09Z",
"message": "kernel has no deadlock",
"reason": "KernelHasNoDeadlock",
"status": "False",
"type": "KernelDeadlock"
},
{
"lastHeartbeatTime": "2022-04-12T08:05:45Z",
"lastTransitionTime": "2022-04-10T07:10:25Z",
"message": "kubelet has sufficient memory available",
"reason": "KubeletHasSufficientMemory",
"status": "False",
"type": "MemoryPressure"
},
{
"lastHeartbeatTime": "2022-04-12T08:05:45Z",
"lastTransitionTime": "2022-04-10T07:10:25Z",
"message": "kubelet has no disk pressure",
"reason": "KubeletHasNoDiskPressure",
"status": "False",
"type": "DiskPressure"
},
{
"lastHeartbeatTime": "2022-04-12T08:05:45Z",
"lastTransitionTime": "2022-04-10T07:10:25Z",
"message": "kubelet has sufficient PID available",
"reason": "KubeletHasSufficientPID",
"status": "False",
"type": "PIDPressure"
},
{
"lastHeartbeatTime": "2022-04-12T08:05:45Z",
"lastTransitionTime": "2022-04-10T07:15:58Z",
"message": "kubelet is posting ready status",
"reason": "KubeletReady",
"status": "True",
"type": "Ready"
}
],
"daemonEndpoints": {
"kubeletEndpoint": {
"Port": 10250
}
},
"images": [
{
"names": [
"registry.alauda.cn:60080/tkestack/kube-apiserver@sha256:eb81528afdbd996242cfbf6f6d53ec3529da43e0a1970b61a7454d8dc910ba19",
"registry.alauda.cn:60080/tkestack/kube-apiserver:v1.21.10"
],
"sizeBytes": 137667869
},
{
"names": [
"registry.alauda.cn:60080/tkestack/kube-controller-manager@sha256:1db444412ada7729572f9cdb155ab7ba891520e09524093a2eeb0d28096f2dbd",
"registry.alauda.cn:60080/tkestack/kube-controller-manager:v1.21.10"
],
"sizeBytes": 131876125
},
{
"names": [
"registry.alauda.cn:60080/tkestack/provider-res@sha256:9504457bff6f0682e7493f94de2a4fa9d6e526a8978159cecf7b416af343010b",
"registry.alauda.cn:60080/tkestack/provider-res:v1.21.10-1"
],
"sizeBytes": 491112019
}
],
"nodeInfo": {
"architecture": "amd64",
"bootID": "7fe24634-a4f3-4428-84ca-bfaa8b2b9c98",
"containerRuntimeVersion": "docker://20.10.7",
"kernelVersion": "3.10.0-1127.el7.x86_64",
"kubeProxyVersion": "v1.21.10",
"kubeletVersion": "v1.21.10",
"machineID": "bd6671f674d549828e2eb9967e126403",
"operatingSystem": "linux",
"osImage": "CentOS Linux 7 (Core)",
"systemUUID": "4AF1EFAB-FBC0-4CBE-B91D-54119CE8A6AF"
}
}
}Parameters
| Name | Type | Description |
|---|---|---|
| apiVersion | string | See common parameters |
| kind | string | See common parameters |
| metadata | object | See common parameters |
| spec | object |
NodeSpec describes the attributes that a node is created with.
Path: spec |
| spec.podCIDR | string |
PodCIDR represents the pod IP range assigned to the node.
Path: spec.podCIDR |
| spec.podCIDRs | array |
podCIDRs represents the IP ranges assigned to the node for usage by Pods on that node. If this field is specified, the 0th entry must match the podCIDR field. It may contain at most 1 value for each of IPv4 and IPv6.
Path: spec.podCIDRs |
| spec.podCIDRs[] | string |
Path: spec.podCIDRs[] |
| status | object |
NodeStatus is information about the current status of a node.
Path: status |
| status.addresses | array |
List of addresses reachable to the node. Queried from cloud provider, if available. More info: https://kubernetes.io/docs/concepts/nodes/node/#addresses Note: This field is declared as mergeable, but the merge key is not sufficiently unique, which can cause data corruption when it is merged. Callers should instead use a full-replacement patch. See http://pr.k8s.io/79391 for an example.
Path: status.addresses |
| status.addresses[] | object |
NodeAddress contains information for the node's address.
Path: status.addresses[] |
| addresses[].address | string |
The node address.
Path: status.addresses[].address |
| addresses[].type | string |
Node address type, one of Hostname, ExternalIP or InternalIP.
Path: status.addresses[].type |
| status.allocatable | object |
Allocatable represents the resources of a node that are available for scheduling. Defaults to Capacity.
Path: status.allocatable |
| status.capacity | object |
Capacity represents the total resources of a node. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity
Path: status.capacity |
| status.conditions | array |
Conditions is an array of current observed node conditions. More info: https://kubernetes.io/docs/concepts/nodes/node/#condition
Path: status.conditions |
| status.conditions[] | object |
NodeCondition contains condition information for a node.
Path: status.conditions[] |
| conditions[].lastHeartbeatTime | string (date-time) |
Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.
Path: status.conditions[].lastHeartbeatTime |
| conditions[].lastTransitionTime | string (date-time) |
Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.
Path: status.conditions[].lastTransitionTime |
| conditions[].message | string |
Human readable message indicating details about last transition.
Path: status.conditions[].message |
| conditions[].reason | string |
(brief) reason for the condition's last transition.
Path: status.conditions[].reason |
| conditions[].status | string |
Status of the condition, one of True, False, Unknown.
Path: status.conditions[].status |
| conditions[].type | string |
Type of node condition.
Path: status.conditions[].type |
| status.daemonEndpoints | object |
NodeDaemonEndpoints lists ports opened by daemons running on the Node.
Path: status.daemonEndpoints |
| daemonEndpoints.kubeletEndpoint | object |
DaemonEndpoint contains information about a single Daemon endpoint.
Path: status.daemonEndpoints.kubeletEndpoint |
| kubeletEndpoint.Port | integer (int32) |
Port number of the given endpoint.
Path: status.daemonEndpoints.kubeletEndpoint.Port |
| status.images | array |
List of container images on this node
Path: status.images |
| status.images[] | object |
Describe a container image
Path: status.images[] |
| images[].names | array |
Names by which this image is known. e.g. ["k8s.gcr.io/hyperkube:v1.0.7", "dockerhub.io/google_containers/hyperkube:v1.0.7"]
Path: status.images[].names |
| images[].names[] | string |
Path: status.images[].names[] |
| images[].sizeBytes | integer (int64) |
The size of the image in bytes.
Path: status.images[].sizeBytes |
| status.nodeInfo | object |
NodeSystemInfo is a set of ids/uuids to uniquely identify the node.
Path: status.nodeInfo |
| nodeInfo.architecture | string |
The Architecture reported by the node
Path: status.nodeInfo.architecture |
| nodeInfo.bootID | string |
Boot ID reported by the node.
Path: status.nodeInfo.bootID |
| nodeInfo.containerRuntimeVersion | string |
ContainerRuntime Version reported by the node through runtime remote API (e.g. docker://1.5.0).
Path: status.nodeInfo.containerRuntimeVersion |
| nodeInfo.kernelVersion | string |
Kernel Version reported by the node from 'uname -r' (e.g. 3.16.0-0.bpo.4-amd64).
Path: status.nodeInfo.kernelVersion |
| nodeInfo.kubeProxyVersion | string |
KubeProxy Version reported by the node.
Path: status.nodeInfo.kubeProxyVersion |
| nodeInfo.kubeletVersion | string |
Kubelet Version reported by the node.
Path: status.nodeInfo.kubeletVersion |
| nodeInfo.machineID | string |
MachineID reported by the node. For unique machine identification in the cluster this field is preferred. Learn more from man(5) machine-id: http://man7.org/linux/man-pages/man5/machine-id.5.html
Path: status.nodeInfo.machineID |
| nodeInfo.operatingSystem | string |
The Operating System reported by the node
Path: status.nodeInfo.operatingSystem |
| nodeInfo.osImage | string |
OS Image reported by the node from /etc/os-release (e.g. Debian GNU/Linux 7 (wheezy)).
Path: status.nodeInfo.osImage |
| nodeInfo.systemUUID | string |
SystemUUID reported by the node. For unique machine identification MachineID is preferred. This field is specific to Red Hat hosts https://access.redhat.com/documentation/en-US/Red_Hat_Subscription_Management/1/html/RHSM/getting-system-uuid.html
Path: status.nodeInfo.systemUUID |