in drainer/k8s_utils.py [0:0]
def cordon_node(api, node_name):
"""Marks the specified node as unschedulable, which means that no new pods can be launched on the
node by the Kubernetes scheduler.
"""
patch_body = {
'apiVersion': 'v1',
'kind': 'Node',
'metadata': {
'name': node_name
},
'spec': {
'unschedulable': True
}
}
api.patch_node(node_name, patch_body)