Ubuntu Minikubeをインストールする方法

環境
Ubuntu 24.04

概要
シングルノードで Kubernetes クラスターを構成可能な Minikube をインストールします。

1.kubectlをインストール

# snap install kubectl --classic
kubectl 1.29.4 from Canonical✓ installed

2.Minikube と その他 必要なツールをインストールします。

# wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 -O minikube
# wget https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-kvm2

# chmod 755 minikube docker-machine-driver-kvm2
# mv minikube docker-machine-driver-kvm2 /usr/local/bin/
バージョンを確認します

# minikube version
minikube version: v1.33.0
commit: 75fc9d54fca63f295d8737c8eacdbb7987e89c67

3.minikubeを起動します

$ minikube start --vm-driver=kvm2

状態確認

$ minikube status
minikube
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured

$ minikube service list

|-------------|------------|--------------|-----|
| NAMESPACE | NAME | TARGET PORT | URL |
|-------------|------------|--------------|-----|
| default | kubernetes | No node port | |
| kube-system | kube-dns | No node port | |
|-------------|------------|--------------|-----|

$ minikube docker-env

export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.21.44:2376"
export DOCKER_CERT_PATH="/home/ubuntu/.minikube/certs"
export MINIKUBE_ACTIVE_DOCKERD="minikube"

# To point your shell to minikube's docker-daemon, run:
# eval $(minikube -p minikube docker-env)

 

$ kubectl cluster-info

Kubernetes control plane is running at https://192.168.21.44:8443
CoreDNS is running at https://192.168.21.44:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.

 

$ kubectl get nodes

NAME STATUS ROLES AGE VERSION
minikube Ready control-plane 2m55s v1.30.0

 

# 仮想マシン [minikube] が起動

$ virsh list
 Id   Name       State
--------------------------
 1    minikube   running

# 仮想マシンへ SSH アクセス
$ minikube ssh

IT

Posted by arkgame