<p>I'm implementing a function which can make a node offline/online from kubernetes cluster. </p>

<p>When I run <code>kubectl delete node $nodename</code>, how can I read this node to the cluster? </p>

<p>It's said that if use API <code>POST /api/v1/nodes</code> will cause the node state <code>Not ready</code>. Is there a way to read the deleted node to cluster?</p>

<p>The way to (re)create a node depends on your cluster setup and Kubernetes version.</p>

<ul>
<li><a href="https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/#joining-your-nodes" rel="noreferrer">kubeadm</a>: run <code>kubeadm reset</code> and <code>kubeadm join ...</code> again on the node (you might need to create a new token if the original one was short-lived, see the linked doc)</li>
<li>most clouds: delete the VM. It will be recreated and will rejoin the cluster</li>
<li>others: see <a href="https://kubernetes.io/docs/concepts/architecture/nodes/#self-registration-of-nodes" rel="noreferrer">self registration</a> and <a href="https://kubernetes.io/docs/concepts/architecture/nodes/#manual-node-administration" rel="noreferrer">manual registration</a> for details.</li>
</ul>
