APIサーバに定期的に出る
ログを見るとこんな感じで定期的に出てきます。
W0301 08:23:56.457841 1 watcher.go:229] watch chan error: etcdserver: mvcc: required revision has been compacted W0301 08:31:36.434391 1 watcher.go:229] watch chan error: etcdserver: mvcc: required revision has been compacted W0301 08:46:48.806759 1 watcher.go:229] watch chan error: etcdserver: mvcc: required revision has been compacted W0301 09:01:23.817826 1 watcher.go:229] watch chan error: etcdserver: mvcc: required revision has been compacted
このメッセージはetcdが持っている履歴の圧縮を行う処理関連に見てます。
実際、この圧縮はAPIサーバがetcdに司令を投げていますが、特に設定を入れずともデフォルトで以下のように圧縮がかかっているように見えます。
{"level":"info","ts":"2022-03-01T22:56:16.280Z","caller":"mvcc/index.go:214","msg":"compact tree index","revision":4324643} {"level":"info","ts":"2022-03-01T22:56:16.282Z","caller":"mvcc/kvstore_compaction.go:57","msg":"finished scheduled compaction","compact-revision":4324643,"took":"1.114364ms"} {"level":"info","ts":"2022-03-01T23:01:16.318Z","caller":"mvcc/index.go:214","msg":"compact tree index","revision":4325041} {"level":"info","ts":"2022-03-01T23:01:16.321Z","caller":"mvcc/kvstore_compaction.go:57","msg":"finished scheduled compaction","compact-revision":4325041,"took":"1.495808ms"}
結論:正常なので無視してOK
Openshiftでも同事象は起きているようで以下のスレッドがあがっていましたが
openshift-apiserver pod has lots of spam logs "E0331...etcdserver: mvcc: required revision has been compacted"
やり取りとしてはバグなので無視してOK・・とのこと。
実際にetcd側を見ても正常に圧縮がかかっているようにも見えています。もちろんクラスターの状況も問題なし。
# kubectl get cs Warning: v1 ComponentStatus is deprecated in v1.19+ NAME STATUS MESSAGE ERROR etcd-0 Healthy {"health":"true","reason":""} controller-manager Healthy ok scheduler Healthy ok
というわけでerrorといいつつも特に気にしなくても良さそう。