---
# System prepended metadata

title: OCP delete node & restore node
tags: [Container]

---

###### tags: `Container`  
# OCP delete node & restore node  
## delete node  
#### check node name & status  
``` script=
oc get no
```
#### change node to unschedulable status  
``` script=
oc adm cordon <node_name>
```
#### clean pods on node  
```script=
oc adm drain <node_name> --ignore-daemonsets --force --grace-period=30 --delete-local-data
```
#### backup node for restore  
```script=
oc get node <node_name> -o yaml > backup_<nodename>.yaml
```
#### delete node  
```script=
oc delete node <node_name>
```
## restore node  
```script=
oc create -f backup_<nodename>.yaml
```
