Minikube : Install2022/07/20 |
Install Minikube to configure Kubernetes Cluster on single node.
|
[1] |
Install a Hypervisor that is supported by Minikube.
On this example, Install KVM like here of [1] for it. |
[2] | |
[3] | Install Minikube and other required tools. |
# install kubectl [root@dlp ~]# snap install kubectl --classic kubectl 1.20.5 from Canonical✓ installed wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 -O minikube [root@dlp ~]# wget https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-kvm2 [root@dlp ~]# chmod 755 minikube docker-machine-driver-kvm2
[root@dlp ~]#
[root@dlp ~]# mv minikube docker-machine-driver-kvm2 /usr/local/bin/
minikube version minikube version: v1.26.0 commit: f4b412861bb746be73053c9f6d2895f12cf78565 |
[4] | Add users who use Minikube to [libvirt] group. |
[root@dlp ~]# usermod -aG libvirt cent |
[5] | Start Minikube with a user who are in [libvirt] group. |
[cent@dlp ~]$ minikube start --vm-driver=kvm2 * minikube v1.26.0 on Centos 9 (kvm/amd64) * Using the kvm2 driver based on user configuration * Downloading VM boot image ... > minikube-v1.26.0-amd64.iso....: 65 B / 65 B [----------] 100.00% ? p/s 0s > minikube-v1.26.0-amd64.iso: 268.86 MiB / 268.86 MiB 100.00% 18.30 MiB p/ * Starting control plane node minikube in cluster minikube * Downloading Kubernetes v1.24.1 preload ... > preloaded-images-k8s-v18-v1...: 405.83 MiB / 405.83 MiB 100.00% 31.69 Mi * Creating kvm2 VM (CPUs=2, Memory=3900MB, Disk=20000MB) .../ * Preparing Kubernetes v1.24.1 on Docker 20.10.16 ... - Generating certificates and keys ... - Booting up control plane ... - Configuring RBAC rules ... * Verifying Kubernetes components... - Using image gcr.io/k8s-minikube/storage-provisioner:v5 * Enabled addons: storage-provisioner, default-storageclass * Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default # show status [cent@dlp ~]$ minikube status minikube type: Control Plane host: Running kubelet: Running apiserver: Running kubeconfig: Configuredubuntu@dlp:~$ minikube service list |-------------|------------|--------------|-----| | NAMESPACE | NAME | TARGET PORT | URL | |-------------|------------|--------------|-----| | default | kubernetes | No node port | | kube-system | kube-dns | No node port | |-------------|------------|--------------|-----|[cent@dlp ~]$ minikube docker-env export DOCKER_TLS_VERIFY="1" export DOCKER_HOST="tcp://192.168.39.57:2376" export DOCKER_CERT_PATH="/home/cent/.minikube/certs" export MINIKUBE_ACTIVE_DOCKERD="minikube" # To point your shell to minikube's docker-daemon, run: # eval $(minikube -p minikube docker-env)[cent@dlp ~]$ kubectl cluster-info Kubernetes control plane is running at https://192.168.39.57:8443 CoreDNS is running at https://192.168.39.57:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.[cent@dlp ~]$ kubectl get nodes NAME STATUS ROLES AGE VERSION minikube Ready control-plane 8m49s v1.24.1 # possible to access with SSH to the VM [cent@dlp ~]$ minikube ssh _ _ _ _ ( ) ( ) ___ ___ (_) ___ (_)| |/') _ _ | |_ __ /' _ ` _ `\| |/' _ `\| || , < ( ) ( )| '_`\ /'__`\ | ( ) ( ) || || ( ) || || |\`\ | (_) || |_) )( ___/ (_) (_) (_)(_)(_) (_)(_)(_) (_)`\___/'(_,__/'`\____)
$
$ hostname minikube docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES f37e966fbe31 6e38f40d628d "/storage-provisioner" 8 minutes ago Up 8 minutes k8s_storage-provisioner_storage-provisioner_kube-system_54391d95-4506-4f6d-91bb-a7d0b1088c00_1 55b93b6397b4 a4ca41631cc7 "/coredns -conf /etc…" 9 minutes ago Up 9 minutes k8s_coredns_coredns-6d4b75cb6d-8vrft_kube-system_30983de1-07df-45d2-bfc6-c32e1193e208_0 8a3b4442a0d2 beb86f5d8e6c "/usr/local/bin/kube…" 9 minutes ago Up 9 minutes k8s_kube-proxy_kube-proxy-8bbqs_kube-system_04c003bb-916c-4c74-8158-6d4a87c3ea22_0 217c17fa2b91 k8s.gcr.io/pause:3.6 "/pause" 9 minutes ago Up 9 minutes k8s_POD_coredns-6d4b75cb6d-8vrft_kube-system_30983de1-07df-45d2-bfc6-c32e1193e208_0 2bf6aeb538ab k8s.gcr.io/pause:3.6 "/pause" 9 minutes ago Up 9 minutes k8s_POD_kube-proxy-8bbqs_kube-system_04c003bb-916c-4c74-8158-6d4a87c3ea22_0 575844887b93 k8s.gcr.io/pause:3.6 "/pause" 9 minutes ago Up 9 minutes k8s_POD_storage-provisioner_kube-system_54391d95-4506-4f6d-91bb-a7d0b1088c00_0 ccfcba6133c4 aebe758cef4c "etcd --advertise-cl…" 9 minutes ago Up 9 minutes k8s_etcd_etcd-minikube_kube-system_b7ffe82a71ea2140a512d428ae7a9525_0 93ec486b2ce9 18688a72645c "kube-scheduler --au…" 9 minutes ago Up 9 minutes k8s_kube-scheduler_kube-scheduler-minikube_kube-system_bab0508344d11c6fdb45b1f91c440ff5_0 39e516608272 e9f4b425f919 "kube-apiserver --ad…" 9 minutes ago Up 9 minutes k8s_kube-apiserver_kube-apiserver-minikube_kube-system_e879b64daded4ab7b904ff5bed6a6b51_0 d15f25af1328 b4ea7e648530 "kube-controller-man…" 9 minutes ago Up 9 minutes k8s_kube-controller-manager_kube-controller-manager-minikube_kube-system_852f03e6fe9ac86ddd174fb038c47d74_0 b46aa57b382a k8s.gcr.io/pause:3.6 "/pause" 9 minutes ago Up 9 minutes k8s_POD_etcd-minikube_kube-system_b7ffe82a71ea2140a512d428ae7a9525_0 40328d0d0ebb k8s.gcr.io/pause:3.6 "/pause" 9 minutes ago Up 9 minutes k8s_POD_kube-apiserver-minikube_kube-system_e879b64daded4ab7b904ff5bed6a6b51_0 07ddb0590ee6 k8s.gcr.io/pause:3.6 "/pause" 9 minutes ago Up 9 minutes k8s_POD_kube-controller-manager-minikube_kube-system_852f03e6fe9ac86ddd174fb038c47d74_0 7a967bac761f k8s.gcr.io/pause:3.6 "/pause" 9 minutes ago Up 9 minutes k8s_POD_kube-scheduler-minikube_kube-system_bab0508344d11c6fdb45b1f91c440ff5_0
$
exit
# stop minikube [cent@dlp ~]$ minikube stop * Stopping node "minikube" ... * 1 nodes stopped. # start minikube [cent@dlp ~]$ minikube start * minikube v1.26.0 on Centos 9 (kvm/amd64) * Using the kvm2 driver based on existing profile * Starting control plane node minikube in cluster minikube * Restarting existing kvm2 VM for "minikube" ... * Preparing Kubernetes v1.24.1 on Docker 20.10.16 ... * Verifying Kubernetes components... - Using image gcr.io/k8s-minikube/storage-provisioner:v5 * Enabled addons: storage-provisioner, default-storageclass * Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default # remove minikube VM [cent@dlp ~]$ minikube delete * Deleting "minikube" in kvm2 ... * Removed all traces of the "minikube" cluster. |
Sponsored Link |