-->
  • Recent Articles

    How to Install Minikube in Amazon Linux

     Kubernetes is a container management tool. It is Donated by Google to the Opensource community. It has now become the defacto container management tool of choice.

    In Kubernetes setup we have one master node and multiple worker nodes. The worker-nodes are then managed from the master node, thus ensuring that the cluster is managed from a central point.

    You can also deploy a single-node Kubernetes cluster. You can use Minikube, which is a tool that runs a single-node Kubernetes cluster in a virtual machine on your node.

    minikube is local Kubernetes, focusing on making it easy to learn and develop for Kubernetes.

    All you need is Docker (or similarly compatible) container or a Virtual Machine environment, and Kubernetes is a single command away: minikube start

    What you’ll need

    Docker Installation

    1. Launch an instance from an Amazon Linux 2 or Amazon Linux AMI.
    2. Connect to your instance.
    3. Updates the packages and package caches you have installed on your instance.

    yum update -y

    4. Install the latest Docker Engine packages.

    Amazon Linux 2
    amazon-linux-extras install docker

    Amazon Linux.

    yum install docker

    5. Start the Docker service.

    service docker start

    6. "sudo docker " Add to the group so you can run Docker commands without using "ec2-user".

    usermod -a -G docker ec2-user

    Install Docker Amazon Linux
    Install Docker Amazon Linux

    Install Conntrack:

     yum install conntrack

    minikube_install_amazon_conntrack
    minikube_install_amazon_conntrack


    Minkube Installation

    Binary download

    curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
    sudo install minikube-linux-amd64 /usr/local/bin/minikube
    
    OR 
    wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
    chmod +x minikube-linux-amd64
    mv minikube-linux-amd64 /usr/local/bin/minikube
    minikube version
    

    install minikube_amazon_linux
    install minikube_amazon_linux

    Start your cluster

    From a terminal with administrator access (but not logged in as root), run:

    minikube start --vm-driver=none
    minikube_install_amazon_linux2
    minikube_install_amazon_linux2



    If you already have kubectl installed, you can now use it to access your shiny new cluster:

    kubectl get po -A

    How to Install kubectl on Linux

    Alternatively, minikube can download the appropriate version of kubectl, if you don’t mind the double-dashes in the command-line:

    minikube kubectl -- get po -A

    Deploy applications

    Create a sample deployment and expose it on port 8080:

    kubectl create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.4
    kubectl expose deployment hello-minikube --type=NodePort --port=8080
    

    It may take a moment, but your deployment will soon show up when you run:

    kubectl get services hello-minikube
    

    The easiest way to access this service is to let minikube launch a web browser for you:

    minikube service hello-minikube
    


    Alternatively, use kubectl to forward the port:

    kubectl port-forward service/hello-minikube 7080:8080
    

    Tada! Your application is now available at http://localhost:7080/

    Manage your cluster

    Pause Kubernetes without impacting deployed applications:

    minikube pause
    

    Halt the cluster:

    minikube stop

    Delete all of the minikube clusters:

    minikube delete --all

    No comments