7
respostas

Minikube não instalar VirtualBox 6.1 -GNU/Linux Pop!_OS 20.04 LTS e Fedora 33

Olá pessoal, eu não estou conseguindo instalar o Minikube no Pop!_OS 20.04 LTS e no Fedora 33, alguém pode me ajudar:

Erro Pop!_OS 20.04 LTS Observação: eu não desejo fazer o downgrade para a versão do VirtualBox version 5.0.12

jackson@pc-pop:~$ minikube start --vm-driver=virtualbox
 minikube v1.12.1 on Debian bullseye/sid
 Using the virtualbox driver based on existing profile
 Starting control plane node minikube in cluster minikube
 Restarting existing virtualbox VM for "minikube" ...
 StartHost failed, but will try again: driver start: Error setting up host only network on machine start: The host-only adapter we just created is not visible. This is a well known VirtualBox bug. You might want to uninstall it and reinstall at least version 5.0.12 that is is supposed to fix this issue
 Restarting existing virtualbox VM for "minikube" ...
 Failed to start virtualbox VM. "minikube start" may fix it: driver start: Error setting up host only network on machine start: The host-only adapter we just created is not visible. This is a well known VirtualBox bug. You might want to uninstall it and reinstall at least version 5.0.12 that is is supposed to fix this issue

 [VBOX_HOST_ADAPTER] error provisioning host Failed to start host: driver start: Error setting up host only network on machine start: The host-only adapter we just created is not visible. This is a well known VirtualBox bug. You might want to uninstall it and reinstall at least version 5.0.12 that is is supposed to fix this issue
 Suggestion: Reboot to complete VirtualBox installation, verify that VirtualBox is not blocked by your system, and/or use another hypervisor
 Documentation: https://stackoverflow.com/questions/52277019/how-to-fix-vm-issue-with-minikube-start
 Related issues:
    ▪ https://github.com/kubernetes/minikube/issues/3614
    ▪ https://github.com/kubernetes/minikube/issues/4222
    ▪ https://github.com/kubernetes/minikube/issues/5817
jackson@pc-pop:~$ 
7 respostas

Mais uma vez sem a ajuda pontual dos moderador eu conseguir resolver em partes o problema:

jackson@pc-pop:~$ minikube start --vm-driver=virtualbox
minikube v1.12.1 on Debian bullseye/sid
Using the virtualbox driver based on existing profile
Starting control plane node minikube in cluster minikube
virtualbox "minikube" VM is missing, will recreate.
Creating virtualbox VM (CPUs=2, Memory=2200MB, Disk=20000MB) ...
Preparing Kubernetes v1.18.3 on Docker 19.03.12 ...
Verifying Kubernetes components...
Enabled addons: default-storageclass, storage-provisioner
Done! kubectl is now configured to use "minikube"

 /usr/local/bin/kubectl is version 1.21.0, which may be incompatible with Kubernetes 1.18.3.
 You can also use 'minikube kubectl -- get pods' to invoke a matching version
jackson@pc-pop:~$ 

DÚVIDA COMO CORRIGIR ESSA INCOMPATIBILIDADE ?

 /usr/local/bin/kubectl is version 1.21.0, which may be incompatible with Kubernetes 1.18.3.
 You can also use 'minikube kubectl -- get pods' to invoke a matching version
jackson@pc-pop:~$ 

TENTEI INVOCAR O COMANDO, MAS APRESENTOU:

jackson@pc-pop:~$ minikube kubectl -- get pods
    > kubectl.sha256: 65 B / 65 B [--------------------------] 100.00% ? p/s 0s
    > kubectl: 41.99 MiB / 41.99 MiB [-------------] 100.00% 879.70 KiB p/s 49s
No resources found in default namespace.
jackson@pc-pop:~$ minikube kubectl -- get pods
No resources found in default namespace.

O QUE DEVEREI FAZER AGORA ?

Oi Jackson, tudo bem?

Após resolver esse primeiro problema, quando você tenta criar algum pod e listar, o que acontece?

Tive um problema parecido e resolvi baixando do site do Virtual Box oficial a versão generica para LiNUX. Tenta isto.

Minha versão é Ubuntu 20.04

Obrigado pela Força Fernando, eu já havia conseguir resolver fazendo a atualização do VirtualBox, pois a versão que está anterior provavelmente estava com algum problema. Eu conseguir resolver os problemas utilizando a versão VirtualBox 6.1 | Versão 6.1.20 r143896 (Qt5.12.8).

Oi Daniel Artine, ele foi criado e listado, mas ainda fiquei com dúvidas e pergunto como remover a mensagem de incompatibilidade?

jackson@pc-pop:~$ minikube start --vm-driver=virtualbox
minikube v1.12.1 on Debian bullseye/sid
Using the virtualbox driver based on existing profile
Starting control plane node minikube in cluster minikube
Updating the running virtualbox "minikube" VM ...
Preparing Kubernetes v1.18.3 on Docker 19.03.12 ...
Verifying Kubernetes components...
Enabled addons: default-storageclass, storage-provisioner
Done! kubectl is now configured to use "minikube"

DÚVIDA PORQUE APARECE ESSA INFORMAÇÃO DE INCOMPATIBILIDADE

/usr/local/bin/kubectl is version 1.21.0, which may be incompatible with Kubernetes 1.18.3.

CRIAÇÃO DE POD E LISTANDO O POD



jackson@pc-pop:~$ kubectl run nginx-pod --image=nginx:latest
pod/nginx-pod created
jackson@pc-pop:~$ kubectl get pods
NAME        READY   STATUS              RESTARTS   AGE
nginx-pod   0/1     ContainerCreating   0          25s
jackson@pc-pop:~$

jackson@pc-pop:~$ kubectl get pods --watch
NAME        READY   STATUS    RESTARTS   AGE
nginx-pod   1/1     Running   0          7m54s
jackson@pc-pop:~$ kubectl describe po nginx-pod
EXIBIR SÓ OS EVENTOS:
======================
Events:
  Type    Reason     Age    From               Message
  ----    ------     ----   ----               -------
  Normal  Scheduled  9m42s  default-scheduler  Successfully assigned default/nginx-pod to minikube
  Normal  Pulling    9m41s  kubelet            Pulling image "nginx:latest"
  Normal  Pulled     8m36s  kubelet            Successfully pulled image "nginx:latest"
  Normal  Created    8m36s  kubelet            Created container nginx-pod
  Normal  Started    8m36s  kubelet            Started container nginx-pod

Oi Jackson, tudo bem?

Esse problema de incompatibilidade do kubectl e do Kubernetes se deve pelo fato do kubectl ser feito para se comunicar apenas com o Kubernetes uma versão acima e uma abaixo da que ele mesmo tem, então o kubectl 1.21.x ira se comunicar apenas com com o Kubernetes 1.20.x até o 1.22.x. Como você esta usando o minikube para manejar o kubernets, é necessário atualiza-lo, a ultima versão do minikube é estável é a 1.20.0, que trás com sigo o kubernets 1.20.x que é compatível com o kubectl 1.21.x.

Antes da atualização faça um backup dos seus container pois eles serão apagados, o seguinte comando pode te ajudar:

kubectl get all --export=true -o yaml

Para realizar a atualização é necessário parar a execução do minikube e apagar todos os container com:

minikube delete

Em seguida devemos remover a instalação do minikube com:

(O caminho pode mudar caso não tenha instalado no local recomendado)

(Cuidado com a pasta em que o comando rm -rf vai ser executo, pois pode apagar arquivos importantes do sistema)

sudo rm -rf /usr/local/bin/minikube

Em seguida basta refazer a instalação como descrito no site do minikube, reativar os add-ons e subir o sistema novamente.

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software