Install Minikube on Oracle Linux

1
0
Send lab feedback

Install minikube on Oracle Linux

Introduction

minikube is a popular tool for developers and administrators to run a fully functional Kubernetes cluster in their local environment.

Although minikube is cross-platform, this tutorial only guides you through the installation and configuration of minikube with the podman driver.

Objectives

In this tutorial, you'll learn to:

  • Download & install minikube
  • Configure minikube to use the podman driver
  • Verify the installation of minikube

Prerequisites

  • Minimum of a single Oracle Linux system

  • Each system should have Oracle Linux installed and configured with:

    • A non-root user account with sudo access
    • Podman and cURL packages

Deploy Oracle Linux

Note: If running in your own tenancy, read the linux-virt-labs GitHub project README.md and complete the prerequisites before deploying the lab environment.

  1. Open a terminal on the Luna Desktop.

  2. Clone the linux-virt-labs GitHub project.

    git clone https://github.com/oracle-devrel/linux-virt-labs.git
  3. Change into the working directory.

    cd linux-virt-labs/ol
  4. Install the required collections.

    ansible-galaxy collection install -r requirements.yml
  5. Deploy the lab environment.

    ansible-playbook create_instance.yml -e localhost_python_interpreter="/usr/bin/python3.6" -e use_podman=true -e update_all=true

    The free lab environment requires the extra variable local_python_interpreter, which sets ansible_python_interpreter for plays running on localhost. This variable is needed because the environment installs the RPM package for the Oracle Cloud Infrastructure SDK for Python, located under the python3.6 modules.

    Important: Wait for the playbook to run successfully and reach the pause task. At this stage of the playbook, the installation of Oracle Cloud Native Environment is complete, and the instances are ready. Take note of the previous play, which prints the public and private IP addresses of the nodes it deploys and any other deployment information needed while running the lab.

Install minikube

This installation method uses the podman driver for minikube to spin up a Podman container on Oracle Linux for running a Kubernetes cluster.

  1. Open a terminal and connect via SSH to the ol-node-01 instance.

    ssh oracle@<ip_address_of_instance>
  2. Download the minikube binary.

    cd ~; curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
    
  3. Install the minikube binary.

    sudo install minikube-linux-amd64 /usr/local/bin/minikube && rm minikube-linux-amd64
    

    The install program copies a compiled binary into the location specified and does not present any output when performing this task. The rest of the command removes the binary file downloaded to your home directory by cURL.

Start Cluster

  1. Start minikube using the podman driver.

    minikube start --driver=podman

    Example Output:

    [oracle@ol-minikube ~]$ minikube start --driver=podman
    ����  minikube v1.30.1 on Oracle 9.1 (amd64)
    ���  Using the podman driver based on user configuration
    ����  Using Podman driver with root privileges
    ����  Starting control plane node minikube in cluster minikube
    ����  Pulling base image ...
    E0613 21:04:34.634685   13717 cache.go:188] Error downloading kic artifacts:  not yet implemented, see issue #8426
    ����  Creating podman container (CPUs=2, Memory=3900MB) ...| 
    ����  Preparing Kubernetes v1.26.3 on Docker 23.0.2 ...
        ��� Generating certificates and keys ...
        ��� Booting up control plane ...
        ��� Configuring RBAC rules ...
    ����  Configuring bridge CNI (Container Networking Interface) ...
        ��� Using image gcr.io/k8s-minikube/storage-provisioner:v5
    ����  Verifying Kubernetes components...
    ����  Enabled addons: storage-provisioner, default-storageclass
    ����  kubectl not found. If you need it, try: 'minikube kubectl -- get pods -A'
    ����  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default

    Note: The E0413 14:04:23.810646 97911 cache.go:203] Error downloading kic artifacts: not yet implemented, see issue #8426 is a known issue in the current version of Podman, which the developer plans to resolve in a future version (This doesn't impact most deployment scenarios)

    Emoji Note: The ���� in the Minkube console output displays on this platform due to a missing font with emoji support, such as google-noto-emoji-color-fonts. To avoid this issue, set the MINIKUBE_IN_STYLE environment variable to 0 or false like this: MINIKUBE_IN_STYLE=0 minikube start --driver=podman. See the minikube faq for more details.

    The start process can take several minutes, so let me explain what is occurring now. Because this is the first time starting the minikube process on this system, it downloads the latest version of Kubernetes certified to run on minikube. Once downloaded, it installs and configures the cluster, which is ready for later use.

  2. Confirm you have a functional system.

    minikube kubectl -- get pods -A

    Example Output:

    [oracle@ol-minikube ~]$ minikube kubectl -- get pods -A
    kubectl.sha256:  64 B / 64 B [-------------------------] 100.00% ? p/s 0s
    kubectl:  45.81 MiB / 45.81 MiB [------------] 100.00% 28.18 MiB p/s 1.8s
    NAMESPACE     NAME                               READY   STATUS    RESTARTS     AGE
    kube-system   coredns-787d4945fb-f8hv6           1/1     Running   0            6m30s
    kube-system   etcd-minikube                      1/1     Running   0            6m43s
    kube-system   kube-apiserver-minikube            1/1     Running   0            6m43s
    kube-system   kube-controller-manager-minikube   1/1     Running   0            6m43s
    kube-system   kube-proxy-bqk4k                   1/1     Running   0            6m30s
    kube-system   kube-scheduler-minikube            1/1     Running   0            6m44s
    kube-system   storage-provisioner                1/1     Running   1 (6m ago)   6m41s

    The output confirms everything is running correctly and ready to deploy locally developed applications to minikube for testing.

  3. (Optional) Create an alias

    To avoid extra typing, create an alias for kubectl in the shell config.

    echo 'alias kubectl="minikube kubectl --"' >> ~/.bashrc
    source ~/.bashrc

    Test the alias using kubectl get pods -A.

Summary

Getting minikube installed is only the start, and it's a helpful tool to aid with local testing and development. Keep checking back for further examples of using minikube with Podman on Oracle Linux.

For More Information

SSR