Skip to main content
Loading
Version: Operator 3.3.1

Draining Kubernetes Nodes

You can drain a Kubernetes node with the kubectl drain command.

Specific manual steps are required if AerospikeCluster uses a local volume provisioner in storage.

danger

This is unsafe if multiPodPerHost is set to true and the namespace replication factor is less than the pods scheduled per node.

To drain the Kubernetes node:

kubectl drain <node-name>
...
pod/aerocluster-1-0 evicted
...

Check the pods.

Example output:

$ kubectl get pods -n aerospike
NAME READY STATUS RESTARTS AGE
aerocluster-1-0 0/1 Pending 0 2m28s
aerocluster-2-0 1/1 Running 0 6m3s

Delete the PVCs of the pods belonging to a particular Kubernetes node.

 % kubectl delete pvc ns-aerocluster-1-0 -n aerospike
persistentvolumeclaim "ns-aerocluster-1-0" deleted

Delete the pending pods on the node.

 % kubectl delete pod aerocluster-1-0 -n aerospike
pod "aerocluster-1-0" deleted

Any pending pods will get rescheduled on another node.

Check the pods.

Output:

$ kubectl get pods -n aerospike
NAME READY STATUS RESTARTS AGE
aerocluster-1-0 1/1 Running 0 10m
aerocluster-2-0 1/1 Running 0 16m