0
1

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 3 years have passed since last update.

Windows Docker Desktopでkubectlコマンドが動かない

Last updated at Posted at 2021-06-23

以前chocolateryでminikubeを入れていたのが原因っぽい。

PowerShellから以下コマンドを実行するとエラーが返ってくる。

> kubectl get pod
Unable to connect to the server: dial tcp 127.0.0.1:62912: connectex: No connection could be made because the target machine actively refused it.

以下コマンドで設定を見てみると、minikubeがデフォルトになっていたので

> kubectl config get-contexts
CURRENT   NAME             CLUSTER          AUTHINFO         NAMESPACE
          docker-desktop   docker-desktop   docker-desktop
*         minikube         minikube         minikube         default

以下を実行して問題解決。

> kubectl config use-context docker-desktop
Switched to context "docker-desktop".
> kubectl config get-contexts
CURRENT   NAME             CLUSTER          AUTHINFO         NAMESPACE
*         docker-desktop   docker-desktop   docker-desktop
          minikube         minikube         minikube         default
> kubectl get pod
No resources found in default namespace.
0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?