Tag: Minikube

  • Install Minikube with docker driver on Ubuntu

    Install Minikube with docker driver on Ubuntu

    Minikube is a Kubernetes implementation for development and testing. By default, it uses Virtualbox. The newer version support docker driver, this allows you to use docker to run your minikube Kubernetes cluster. You can find documentation for minikube at

    https://minikube.sigs.k8s.io/docs/start/

    First of all, we need to install Docker, for this, run the command.

    You must be user root, if you are not root, run command “sudo su” to become user root.

    wget -qO- https://get.docker.com/ | sh
    

    Minikube only allows us to run as a normal user, so we need to add the user we will be using in group docker.

    usermod -aG docker YOUR_USER_NAME_HERE
    

    Next, install minikube with

    wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
    mv minikube-linux-amd64 /usr/local/bin/minikube
    chmod 755 /usr/local/bin/minikube
    

    We have minikube and docker installed. To continue, we need to switch to a normal user, that is in docker group.

    su - YOUR_USER_NAME_HERE
    

    To delete older minikube installation, run

    minikube delete --all --purge
    

    Now create a new minikube cluster with the command

    minikube start --driver=docker 
    

    minikube docker provider

    To see status

    minikube status
    

    Now you will be able to run all normal kubectl commands. For minikube installation, instead of kubectl, you need to use command “minikube kubectl –“. It is better create an alias, so you don’t need to type “minikube kubectl” every time you need to run kubectl command.

    https://minikube.sigs.k8s.io/docs/handbook/kubectl/

    vi ~/.bashrc
    

    At end of the file, add

    alias kubectl='minikube kubectl --'
    

    Activate it with command

    source ~/.bashrc
    

    To get nodes, pods, and service, you can use commands

    kubectl get nodes
    kubectl get pods
    kubectl get service
    

    See MiniKube

  • Install Minikube in Ubuntu

    Minikube is an easy-to-use Kubernetes that run on one machine. It is used for testing purposes.

    https://github.com/kubernetes/minikube
    Install Minikube with docker driver on Ubuntu

    To install minikube, run

    wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
    sudo mv minikube-linux-amd64 /usr/local/bin/minikube
    sudo chmod 755 /usr/local/bin/minikube
    

    Before you can start minikube, you need to install VirtualBox, this can be done with the command

    sudo apt install virtualbox
    

    To start minikube, run

    minikube start
    

    To stop

    minikube stop
    

    To connect to minikube node

    minikube ssh
    

    See minikube logs

    minikube logs
    

    Delete minikube

    minikube delete
    

    Mount a file system

    minikube mount $(pwd):/var/www/html/
    

    See Kubernetes