Help us understand the problem. What is going on with this article?

Kubernetes の備忘録

More than 1 year has passed since last update.

概要

Kubernetes を使う上でのちょっとしたネタの備忘録です。

Windows にインストールした minikube クラスタを WSL から叩けるようにする

公式のインストール方法 でインストールした minikube クラスタを、WSL 側にインストールされた kubectl から叩けるようにする設定。

kubectl の設定のうち、クラスタ、ユーザ、コンテキストの3つを全部 WSL 環境にコピーすればよい。なお、そのように設定して、パスを通しても、 minikube コマンド自体は正しく実行出来ない。

設定例

PowerShell 側で:

kubectl config view > kubeconfig

WSL 側で:

mkdir -p ~/.kube
nkf -Luw ~/WinHome/kubeconfig | sed -e 's%\\%/%g' -e 's%C:%/mnt/c%g' | diff -y - ~/.kube/config
nkf -Luw ~/WinHome/kubeconfig | sed -e 's%\\%/%g' -e 's%C:%/mnt/c%g' > ~/.kube/config
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away