Minikube. Almalinux 8. Installation: различия между версиями

Материал из Wiki
Перейти к навигации Перейти к поиску
(Новая страница: «= Links = https://technixleo.com/run-minikube-kubernetes-on-centos-almalinux-rhel/ = Description = Minikube requires your system to be running on a virtual machi...»)
 
 
Строка 72: Строка 72:
<code>curl -LO <nowiki>https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64</nowiki></code>
<code>curl -LO <nowiki>https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64</nowiki></code>


install minikube-linux-amd64 /usr/local/bin/minikube
<code>install minikube-linux-amd64 /usr/local/bin/minikube</code>


Check for the Minikube version to confirm successful installation.
Check for the Minikube version to confirm successful installation.

Текущая версия на 19:50, 12 декабря 2024

Links

https://technixleo.com/run-minikube-kubernetes-on-centos-almalinux-rhel/

Description

Minikube requires your system to be running on a virtual machine environment or a docker container.

Common installation

dnf update -y

Install KVM and its dependencies with the following command

dnf install -y qemu-kvm qemu-img libvirt virt-install libvirt-client conntrack

Enable and start the libvirtd service

systemctl enable --now libvirtd

Check for the libvirtd service status

systemctl status libvirtd

Docker install

dnf -y config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

dnf -y remove podman buildah

dnf -y install docker-ce docker-ce-cli containerd.io

systemctl enable --now docker.service

docker version

Create user libvirt and add one to groups libvirt, docker

adduser libvirt -g libvirt

passwd libvirt

sudo usermod -a -G libvirt libvirt

sudo usermod -a -G docker libvirt

newgrp libvirt

Sdoers file edit

nano /etc/sudoers

...
%libvirt ALL=(ALL) NOPASSWD: ALL

Edit the main configuration file

nano /etc/libvirt/libvirtd.conf

Set the UNIX domain socket group ownership to libvirt by uncommenting the following line. In other words, remove the #.

unix_sock_group = "libvirt"

Set the UNIX socket permissions for the R/W socket by uncommenting the following line and setting the correct permissions.

unix_sock_rw_perms = "0770"

Save the file and restart the Libvirtd service.

systemctl restart libvirtd

Install minikube

Download the latest release of Minikube from the Github Latest releases page and install it.

Alternatively, you can install Minikube using the following command.

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64

install minikube-linux-amd64 /usr/local/bin/minikube

Check for the Minikube version to confirm successful installation.

minikube version

Configure kubectl

Install kubectl Locally

curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl

Make the file executable.

chmod +x ./kubectl

Move it to a directory that is on $PATH.

mv ./kubectl /usr/local/bin/kubectl

Confirm successful installation by checking the version.

kubectl version --client -o json

Start minikube

Login to libvirt user

su - libvirt

To start using Minikube as a single node cluster, run the following command

minikube start --addons=ingress

Run as service

EXIT to root

nano /etc/systemd/system/minikube.service

[Unit]
Description=Runs minikube on startup
After=docker

[Service]
ExecStart=/usr/local/bin/minikube start
ExecStop=/usr/local/bin/minikube stop
Type=oneshot
RemainAfterExit=yes
User=libvirt
Group=libvirt

[Install]
WantedBy=multi-user.target

systemctl enable --now minikube

reboot

You have to work with minikube as user "libvirt"

su - libvirt