0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

万が一、microk8sを壊してしまったら

Posted at

まずは状況確認

microk8s kubectl get nodes -o wide

間違ってadd-nodeした場合など (全データー吹っ飛んだと思ったら)

/var/snap/microk8s/current/var/kubernetes/backend.backup/

に過去のログが残っているので

cp -r /var/snap/microk8s/current/var/kubernetes/backend.backup ~/backup-xxx
mv /var/snap/microk8s/current/var/kubernetes/backend/ ~/backup-yyy
mv /var/snap/microk8s/current/var/kubernetes/backend.backup /var/snap/microk8s/current/var/kubernetes/backend

で治る

正しくadd-node / leave しよう

drainで実行しているタスクを移す
それからnodeを外す
leave, joinはマスターではなくクライアント側で実行すること
以下交互に実行する
(必要ならmicrok8s addonもdisable, enableしてもよい)

# If corrupted
microk8s kubectl drain targetpc --ignore-daemonsets
microk8s leave
microk8s remove-node targetpc --force

microk8s add-node
#On *clinet* For example
microk8s join 192.168.0.1:25000/xxxxxx/1234 --worker

参考
Kubernetes道場 21日目 - Cordon / Drain / PodDisruptionBudgetについて

How to drain a node and restart it?

microk8sクラスターのノードを再起動する

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?