Minikube : インストール (ホスト)2020/08/05 |
|
シングルノードで Kubernetes クラスターを構成可能な Minikube をインストールします。
仮想マシンを利用しない、ホスト上で Kubernetes クラスターを構成する場合の設定です。
|
| [1] | 必要なパッケージをインストールしておきます。 |
|
root@dlp:~# apt -y install docker.io conntrack
|
| [2] | Minikube と その他 必要なツールをインストールします。 |
|
# kubectl インストール root@dlp:~# snap install kubectl --classic kubectl 1.18.6 from Canonical installed wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 -O minikube root@dlp:~# chmod 755 minikube
root@dlp:~#
root@dlp:~# mv minikube /usr/local/bin/
minikube version minikube version: v1.12.1 commit: 5664228288552de9f3a446ea4f51c6f29bbdd0e0-dirty |
| [3] | root ユーザー権限で [none] ドライバーを指定して Minikube を起動します。 |
|
# minikube 起動 root@dlp:~# minikube start --vm-driver=none
* minikube v1.12.1 on Ubuntu 20.04
* Using the none driver based on user configuration
* Starting control plane node minikube in cluster minikube
* Running on localhost (CPUs=8, Memory=11978MB, Disk=78554MB) ...
* minikube 1.12.2 is available! Download it: https://github.com/kubernetes/minikube/releases/tag/v1.12.2
* To disable this notice, run: 'minikube config set WantUpdateNotification false'
* OS release is Ubuntu 20.04.1 LTS
* Preparing Kubernetes v1.18.3 on Docker 19.03.8 ...
- kubelet.resolv-conf=/run/systemd/resolve/resolv.conf
> kubelet.sha256: 65 B / 65 B [--------------------------] 100.00% ? p/s 0s
> kubeadm.sha256: 65 B / 65 B [--------------------------] 100.00% ? p/s 0s
> kubectl.sha256: 65 B / 65 B [--------------------------] 100.00% ? p/s 0s
> kubeadm: 37.97 MiB / 37.97 MiB [---------------] 100.00% 19.42 MiB p/s 3s
> kubectl: 41.99 MiB / 41.99 MiB [---------------] 100.00% 18.46 MiB p/s 3s
> kubelet: 108.04 MiB / 108.04 MiB [-------------] 100.00% 30.82 MiB p/s 4s
* Configuring local host environment ...
*
! The 'none' driver is designed for experts who need to integrate with an existing VM
* Most users should use the newer 'docker' driver instead, which does not require root!
* For more information, see: https://minikube.sigs.k8s.io/docs/reference/drivers/none/
*
! kubectl and minikube configuration will be stored in /root
! To use kubectl or minikube commands as your own user, you may need to relocate them. For example, to overwrite your own settings, run:
*
- sudo mv /root/.kube /root/.minikube $HOME
- sudo chown -R $USER $HOME/.kube $HOME/.minikube
*
* This can also be done automatically by setting the env var CHANGE_MINIKUBE_NONE_USER=true
* Verifying Kubernetes components...
* Enabled addons: default-storageclass, storage-provisioner
* Done! kubectl is now configured to use "minikube"
# 状態確認 root@dlp:~# 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 | |-------------|------------|--------------|-----|root@dlp:~# kubectl cluster-info Kubernetes master is running at https://10.0.0.30:8443 KubeDNS is running at https://10.0.0.30:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.root@dlp:~# kubectl get nodes -o wide NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME dlp.srv.world Ready master 20m v1.18.3 10.0.0.30 <none> Ubuntu 20.04.1 LTS 5.4.0-33-generic docker://19.3.8 |
| Sponsored Link |
|
|