LoginSignup
0
0

kindをインストールする。

Last updated at Posted at 2024-05-11

うまくできなかったので、ここにkindインストール方法を書きます。

WSLを削除しました。
PowerShellで
wsl --unregister Ubuntu
を使ってUbuntuの登録を解除します。
wsl.exe --install Ubuntu24.04
これで再インストール。

まずubuntuのバージョンを22.04→24.04に上げました。

つぎにgoのインストール

~$ wget https://go.dev/dl/go1.22.2.linux-amd64.tar.gz
~$ tar zxvf go1.22.2.linux-amd64.tar.gz
~$ sudo mv go /usr/local/
~$ rm -rf go1.22.2.linux-amd64.tar.gz
~$ cat << "EOF" >> ~/.bashrc
export PATH=$PATH:/usr/local/go/bin
EOF
~$ /bin/bash
~$ go version
go version go1.22.2 linux/amd64

Docker インストール

~$ sudo apt-get update
~$ sudo apt-get install \
    ca-certificates \
    curl \
    gnupg \
    lsb-release
~$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
~$ echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
~$ sudo apt-get update
~$ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
~$ systemctl is-enabled docker.service
kubectl インストール
~$ curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
~$ curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256"
~$ sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
~$ kubectl version --client

kind インストール

~$ GOPATH=/usr/local/go/ go install sigs.k8s.io/kind@v0.22.0
~$ which kind
/usr/local/go/bin/kind
~$ kind --version
kind version 0.22.0

こうなればOK!

kind create cluster
Creating cluster "kind" ...
 ✓ Ensuring node image (kindest/node:v1.29.2) 🖼 
 ✓ Preparing nodes 📦  
 ✓ Writing configuration 📜 
 ✓ Starting control-plane 🕹️ 
 ✓ Installing CNI 🔌 
 ✓ Installing StorageClass 💾 
Set kubectl context to "kind-kind"
You can now use your cluster with:

kubectl cluster-info --context kind-kind

Have a nice day! 👋

参考サイト

https://techblog.ap-com.co.jp/entry/2024/04/23/120021#kubectl-%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB
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