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?

clusterctl move の内容

Posted at

Cluster API の clusterctl move コマンドがどのようにリソースを移動するかのメモ。

作成順序:親から子へ

移動先クラスタでは Cluster(親)から末端の子へ の順で作成される。

Cluster → MachineDeployment → MachineSet → Machine等

ownerReference チェーンに基づき、すべてのオーナーが作成済みのリソースのみが次のグループで処理される。同じ階層のリソースは並行処理。

削除順序:子から親へ(逆順)

移動元クラスタからは 作成の逆順 で削除される。

Machine等 → MachineSet → MachineDeployment → Cluster

3つのアノテーション

1. cluster.x-k8s.io/paused

  • move開始時にCluster/ClusterClassに付与
  • コントローラーのreconciliationを停止

2. clusterctl.cluster.x-k8s.io/block-move

  • プロバイダーが付けることでmove操作をブロック
  • リソースが安全に停止できるまで待機

3. clusterctl.cluster.x-k8s.io/delete-for-move

  • 削除直前に付与
  • Validation webhookがmove操作中であることを判断可能

Finalizerは実行されない

重要: すべてのリソース(親・子問わず)のfinalizerは強制削除される。

// 削除処理の流れ
1. delete-for-move アノテーション付与
2. Delete API 実行
3. Finalizer強制削除  finalizer処理はスキップ
  • リソースは既に宛先クラスタに作成済み
  • ソースクラスタでのクリーンアップは不要(move操作なので)
  • インフラリソースの削除などは発生しない

まとめ

  • 作成: 親→子(ownerReference順)
  • 削除: 子→親(逆順)
  • Finalizerは走らない(すべて強制削除)
  • cluster.x-k8s.io/paused アノテーションでreconciliation停止
  • clusterctl.cluster.x-k8s.io/delete-for-move アノテーションでmove中であることを通知
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?