Home / API Documentation / Platform management / Clusters / Node management / Batch removal of nodes

Batch removal of nodes

Requests

HTTP request

DELETE /kubernetes/{cluster}/api/v1/nodes

delete collection of Node

Query parameters

Name Type Required Description
allowWatchBookmarks boolean FalseallowWatchBookmarks requests watch events with type "BOOKMARK". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. This field is beta.
continue string FalseThe continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the "next key". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
dryRun string FalseWhen 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
fieldSelector string FalseA selector to restrict the list of returned objects by their fields. Defaults to everything.
gracePeriodSeconds integer FalseThe duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.
labelSelector string FalseA selector to restrict the list of returned objects by their labels. Defaults to everything.
limit integer Falselimit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
orphanDependents boolean FalseDeprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.
propagationPolicy string FalseWhether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.
resourceVersion string FalseWhen specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
timeoutSeconds integer FalseTimeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.
watch boolean FalseWatch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.
pretty string FalseIf 'true', then the output is pretty printed.

Request body

Content-Type */*

Sample request

DeleteOptions may be provided when deleting an API object.

{
   "apiVersion": "",
   "dryRun": [
     ""
   ],
   "gracePeriodSeconds": 1,
   "kind": "",
   "orphanDependents": false,
   "preconditions": {
     "resourceVersion": "",
     "uid": ""
   },
   "propagationPolicy": ""
 }

Parmeters

Name Type Required Description
apiVersion string FalseSee common parameters
dryRun array 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
Path: dryRun
dryRun[] string False
Path: dryRun[]
gracePeriodSeconds integer (int64) False The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.
Path: gracePeriodSeconds
kind string FalseSee common parameters
orphanDependents boolean False Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.
Path: orphanDependents
preconditions object False Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.
Path: preconditions
preconditions.resourceVersion string False Specifies the target ResourceVersion
Path: preconditions.resourceVersion
preconditions.uid string False Specifies the target UID.
Path: preconditions.uid
propagationPolicy string False Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.
Path: propagationPolicy

Responses

Content-Type application/json, application/yaml, application/vnd.kubernetes.protobuf

Status code: 200

OK

Sample response

Status is a return value for calls that don't return other objects.

{
   "apiVersion": "v1",
   "items": [
     {
       "apiVersion": "v1",
       "kind": "Node",
       "metadata": {
         "annotations": {
           "cpaas.io/display-name": "",
           "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": {
           "alertmanager": "true",
           "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": "3883789",
         "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"
         }
       }
     }
   ],
   "kind": "NodeList",
   "metadata": {
     "resourceVersion": "3963248"
   }
 }

Parameters

Name Type Description
apiVersion string See common parameters
kind string See common parameters
metadata object See common parameters

Other status codes

Status code: 401

Unauthorized