苦労4︓本体のバグ
E0105 21:55:15.865928 1 runtime.go:78] Observed a panic: "invalid memory address or nil pointer dereference" (runtime error: invalid memory address or nil
pointer dereference) goroutine 551 [running]: k8s.io/apimachinery/pkg/util/runtime.logPanic(0x163e040, 0x26dfda0)
/go/pkg/mod/k8s.io/
[email protected]/pkg/util/runtime/runtime.go:74 +0xa3 k8s.io/apimachinery/pkg/util/runtime.HandleCrash(0x0, 0x0, 0x0)
41
CAPIを含むクラスタをリストアすると、 capi-controller-managerがリストア後にpanicする
原因︓
1. Veleroはリソースをアルファベット順で復元する
2. CRDによっては、あるリソースのオブジェクトが先に作られていることを前提としている
(今回の場合はClusterResourceSetBindingsはClusterResourceSetsが
先に起動するのを前提としている)
回避策︓
Veleroの引数で起動順序を指定する(--restore-resource-priorities)
※このオプションで指定したリソースが優先的にリストア
指定しなかったものはアルファベット順
※v1.6.0で対策予定
参考︓ https://github.com/kubernetes-sigs/cluster-api/issues/4105
https://github.com/vmware-tanzu/velero/pull/3446
教訓
• リコンサイルループで復旧しないリソースもある
• CRD関連の挙動を全て把握するのは困難
→ ユースケースベースでの事前検証は⼤事
• 怪しいと思ったら中の⼈に早く聞く
(velero bugコマンド)