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?

More than 1 year has passed since last update.

dial tcp [::1]:8080: connect: connection refused

Posted at

問題

pod確認しようとしたら

$ kubectl get po
couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused

軽率に minikube delete したりとか心当たりが色々ある。

原因

以下のコマンドで原因判明。

$ kubectl config view

- context:
    cluster: docker-desktop
    user: docker-desktop
  name: docker-desktop
current-context: ""

current-context が空だった。軽率な minikube delete が原因だった模様。

対応

Docker Desktop使ってるのでそこで切り替えた。
https://stackoverflow.com/questions/68730538/docker-desktop-context-select-not-updating-the-kubectl-active-context

コマンドの方はこう。

$ kubectl config use-context <context>

できた。

$ kubectl get po
NAME                                  READY   STATUS      RESTARTS   AGE
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?