# OCP Worker Node REBOOT

1 - bastion makinesine bağlanılır. (ocp oc komutları yüklü ve ssh key install edilmiş bir linux makinede olur.)

2 - bastion ile cluster yapısına bağlanılır.

3 - `" oc get co "` ile ilk olarak servis durumuna bakılır, yine " oc get nodes " ile nodes durumlarına bakılır.

4 - `" oc adm cordon <node-adı> "` bu komut ile yeni worker yada hangi node reboot edilecek ise üzerine yeni pod alması engellenir.

5 - `" oc adm drain <node-adı> --ignore-daemonsets --delete-emptydir-data --force "` komutu ile worker veya hangi node reboot edilecek ise drain ( üzerindeki pod' lar boşaltılır ) edilir. Bu işlerin yoğunluğu diğer node' ların durumuna göre uzun sürebilir.

NOT : Eğer 5. adım uzun sürer ve hatalar alır iseniz aşağıdaki komutu denemelisiniz.&#x20;

`" oc adm drain <node-adı> --ignore-daemonsets --delete-emptydir-data --force --disable-eviction "`

6 - Sonrasında debug mode geçilir `" oc debug node/<node-adı> "`&#x20;

7 - " chroot /host " host klasörüne geçilir ve sonraki komut uygulanır.

8 - `" systemctl reboot "` system reboot edilir.

REBOOT Sonrası

9 - Fiziki olarak reboot işlemi bittikten sonra oc get nodes komutu ile reboot edilen node durumu ve açık olduğunda emin olunur ama burada üzerine otomatik pod almaz aşağıdaki komutu ile status change yapmamız gerekiyor. `" oc adm uncordon <node-adı> "`

10 - `" oc get nodes "  ve " oc get co "` komutları illede servis ve node durumları kontrol edilebilir.

<mark style="color:red;">**Ek notlar 1 :**</mark> oc get nodes çıktısında status bölümü not ready yazan node üzerinde bu işlemleri yapamazsınız.&#x20;

<mark style="color:red;">**Ek notlar 2 :**</mark> Bunun yerine eğer yine erişim yapılabiliyor iseniz `ssh core@<node-adı>` şeklinde girebilir ve reboot zorlayabilirsiniz. Yada en son çare ILO - İDRAC vb arayüzden erişerek reboot edebilirsiniz. Buradaki yöntemleri redhat support alıyor iseniz uygun görmez ve tavsiye edilmez üzerindeki pod ve container zarar görebilir.

Kısaca;

```
$ oc adm cordon node1.example.com
```

```
$ oc adm drain node1.example.com
```

```
$ oc debug node/node1.example.com

sh-4.4# chroot /host

sh-4.4# systemctl reboot
```

```
$ oc adm uncordon node1.example.com
```

```
$ oc get nodes
```

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ocp.1w2.net/openshift-makaleleri/ocp-worker-node-reboot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
