martes, 17 de septiembre de 2024

Minikube on Amazon Linux 2023

 

Download the latest Minikube version

[ec2-user@ip-172-31-32-118 ~]$ curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-latest.x86_64.rpm

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100 36.2M  100 36.2M    0     0  48.4M      0 --:--:-- --:--:-- --:--:-- 48.4M


Install minikube

[ec2-user@ip-172-31-32-118 ~]$ sudo rpm -Uvh minikube-latest.x86_64.rpm

Verifying...                          ################################# [100%]

Preparing...                          ################################# [100%]

package minikube-1.34.0-0.x86_64 is already installed






If you try to start Minikube you will have the following error.
[ec2-user@ip-172-31-32-118 ~]$ minikube start

😄  minikube v1.34.0 on Amazon 2023.5.20240916 (xen/amd64)

👎  Unable to pick a default driver. Here is what was considered, in preference order:

    ▪ docker: Not healthy: "docker version --format {{.Server.Os}}-{{.Server.Version}}:{{.Server.Platform.Name}}" exit status 1: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.44/version": dial unix /var/run/docker.sock: connect: permission denied

    ▪ docker: Suggestion: Add your user to the 'docker' group: 'sudo usermod -aG docker $USER && newgrp docker' <https://docs.docker.com/engine/install/linux-postinstall/>

💡  Alternatively you could install one of these drivers:

    ▪ kvm2: Not installed: exec: "virsh": executable file not found in $PATH

    ▪ podman: Not installed: exec: "podman": executable file not found in $PATH

    ▪ qemu2: Not installed: exec: "qemu-system-x86_64": executable file not found in $PATH

    ▪ virtualbox: Not installed: unable to find VBoxManage in $PATH


❌  Exiting due to DRV_NOT_HEALTHY: Found driver(s) but none were healthy. See above for suggestions how to fix installed drivers.





So proceed to check for updates and install docker.
[ec2-user@ip-172-31-32-118 ~]$ sudo yum update -y

Last metadata expiration check: 0:44:48 ago on Tue Sep 17 17:37:47 2024.

Dependencies resolved.

Nothing to do.

Complete!


[ec2-user@ip-172-31-32-118 ~]$ sudo yum install -y docker

Last metadata expiration check: 0:45:13 ago on Tue Sep 17 17:37:47 2024.

Package docker-25.0.6-1.amzn2023.0.2.x86_64 is already installed.

Dependencies resolved.

Nothing to do.

Complete!




Add the user ec2-user to the docker group

[ec2-user@ip-172-31-32-118 ~]$ sudo usermod -aG docker $USER && newgrp docker


[ec2-user@ip-172-31-32-118 ~]$ sudo systemctl start docker && sudo systemctl enable docker

Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service.





Check for the current version

[ec2-user@ip-172-31-32-118 ~]$ curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt

v1.31.0




Use the following version to download the kubectl

[ec2-user@ip-172-31-32-118 ~]$ curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.31.0/bin/linux/amd64/kubectl

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100 53.7M  100 53.7M    0     0  61.0M      0 --:--:-- --:--:-- --:--:-- 60.9M

[ec2-user@ip-172-31-32-118 ~]$ sudo chmod +x ./kubectl

[ec2-user@ip-172-31-32-118 ~]$ sudo mv ./kubectl /usr/local/bin/kubectl

[ec2-user@ip-172-31-32-118 ~]$ minikube start

😄  minikube v1.34.0 on Amazon 2023.5.20240916 (xen/amd64)

✨  Automatically selected the docker driver. Other choices: ssh, none

📌  Using Docker driver with root privileges

👍  Starting "minikube" primary control-plane node in "minikube" cluster

🚜  Pulling base image v0.0.45 ...

💾  Downloading Kubernetes v1.31.0 preload ...

    > preloaded-images-k8s-v18-v1...:  326.69 MiB / 326.69 MiB  100.00% 39.54 M

    > gcr.io/k8s-minikube/kicbase...:  487.89 MiB / 487.90 MiB  100.00% 38.87 M

🔥  Creating docker container (CPUs=2, Memory=2200MB) ...

🐳  Preparing Kubernetes v1.31.0 on Docker 27.2.0 ...

    ▪ Generating certificates and keys ...

    ▪ Booting up control plane ...

    ▪ Configuring RBAC rules ...

🔗  Configuring bridge CNI (Container Networking Interface) ...

🔎  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




The Minikube is installed.

[ec2-user@ip-172-31-32-118 ~]$ kubectl get pod -A

NAMESPACE     NAME                               READY   STATUS    RESTARTS   AGE

kube-system   coredns-6f6b679f8f-28vqp           1/1     Running   0          19s

kube-system   etcd-minikube                      1/1     Running   0          26s

kube-system   kube-apiserver-minikube            1/1     Running   0          24s

kube-system   kube-controller-manager-minikube   1/1     Running   0          24s

kube-system   kube-proxy-m4pcg                   1/1     Running   0          19s

kube-system   kube-scheduler-minikube            1/1     Running   0          24s

kube-system   storage-provisioner                1/1     Running   0          23s


No hay comentarios:

Publicar un comentario