kind(Kubernetes in Docker)インストール

 

(22)

https://kind.sigs.k8s.io/docs/user/quick-start/#installation
https://kubernetes.io/ja/docs/tasks/tools/install-kubectl/

 

-- 1. Dockerのインストール


sudo apt remove docker docker-engine docker.io containerd runc

sudo apt update

sudo apt install \
    ca-certificates \
    curl \
    gnupg \
    lsb-release

sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null


sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin


sudo docker run hello-world
sudo docker image ls

sudo usermod -aG docker ubuntu


-- 2. kubectlのインストール

curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
kubectl version --client

 

 

-- 3. kindインストール

curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.14.0/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind

kind create cluster

kubectl get nodes
kubectl get pod -n kube-system


kind delete cluster

 

 

(11)
https://kind.sigs.k8s.io/docs/user/quick-start/#installation
https://kubernetes.io/ja/docs/tasks/tools/install-kubectl/


-- 1. Dockerのインストール


apt remove docker docker-engine docker.io containerd runc

apt update

apt install \
    ca-certificates \
    curl \
    gnupg \
    lsb-release


mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg |  gpg --dearmor -o /etc/apt/keyrings/docker.gpg


echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

 

apt update
apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin

docker run hello-world
docker image ls

-- 2. kubectlのインストール

curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x ./kubectl
mv ./kubectl /usr/local/bin/kubectl
kubectl version --client

 

-- 3. kindインストール

curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.14.0/kind-linux-amd64
chmod +x ./kind
mv ./kind /usr/local/bin/kind

kind create cluster

kubectl get nodes
kubectl get pod -n kube-system


kind delete cluster

 

 

(7)
https://kind.sigs.k8s.io/docs/user/quick-start/#installation
https://kubernetes.io/ja/docs/tasks/tools/install-kubectl/


-- 1. Dockerのインストール

yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine


yum install -y yum-utils

yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo


yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin

systemctl start docker
systemctl status docker

docker run hello-world
docker image ls


-- 2. kubectlのインストール

curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x ./kubectl
mv ./kubectl /usr/local/bin/kubectl
kubectl version --client

 

-- 3. kindインストール

curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.14.0/kind-linux-amd64
chmod +x ./kind
mv ./kind /usr/local/bin/kind

kind create cluster

kubectl get nodes
kubectl get pod -n kube-system


kind delete cluster

 

(2022)

https://blog.nillsf.com/index.php/2020/08/28/running-kind-in-windows/
https://zenn.dev/humi3/articles/29c99753544443d28e9f

https://docs.microsoft.com/ja-jp/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package

 

前提: 仮想マシンのCPU設定でハードウェア仮想化を有効化

 

-- 1. Hyper-Vのインストール
PowerShell Install-WindowsFeature hyper-v
Restart-Computer -Force

 

-- 2. chocolateyのインストール


Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))


-- 3. docker-desktopのインストール

別タームを管理者権限で開く

choco install docker-desktop -y
choco install golang -y

Restart-Computer -Force


-- 4. docker-desktop起動のための追加作業

-- 4.1 LinuxWindows サブシステムを有効にする
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart


-- 4.2 仮想マシンの機能を有効にする
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

-- 4.3 x64 マシン用 WSL2 Linux カーネル更新プログラム パッケージを下記からダウンロードして適用
https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi


-- 4.4 WSL 2 を既定のバージョンとして設定する
wsl --set-default-version 2

 

-- 5. kindのインストール
docker-desktopを起動する


choco install kind -y


-- 6. 動作確認

別タームを管理者権限で開く

kind create cluster


kubectl get nodes
kubectl get pod -n kube-system


kind delete cluster