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?

kubectl で突然 “v1beta2 が無い” と怒られたら──ディスカバリーキャッシュが犯人だった話

Last updated at Posted at 2025-05-20

エラー

kubectl get machinepool -A
Error from server (NotFound): Unable to list "cluster.x-k8s.io/v1beta2, Resource=machinepools": the server could not find the requested resource (get machinepools.cluster.x-k8s.io)

使ってるのは v1beta1 なのに、なぜ v1beta2?

何が起きた?

  1. sandbox環境で検証で v1beta2 CRD を apply
  2. すぐ消して v1beta1 を apply し直し
  3. kubectl のディスカバリーキャッシュ に v1beta2 が残存
  4. kubectl「v1beta2 あるよね?」→ APIServer「知らん」→ エラー

対処

# キャッシュを爆破
rm -rf ~/.kube/cache/discovery/*

# 再実行
kubectl get machinepool -A

教訓

  • CRD を入れ替えた後に謎エラー→まずキャッシュを疑う
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?