Kubernetes Using Minikube on Arch Linux

ZenvilaZenvila
5 min read

Introduction

Kubernetes is one of the most powerful and popular container orchestration tools used to manage containers, pods, and clusters. In this post, we’ll walk step-by-step through the fundamentals of Kubernetes, and by the end, we’ll deploy a simple Ubuntu application using Minikube locally on Arch Linux.


🧠 What is Kubernetes?

Kubernetes (K8s) is an open-source container orchestration platform developed by Google and now maintained by the CNCF (Cloud Native Computing Foundation).
It automates the deployment, scaling, and management of containerized applications.

Think of it as an orchestrator for Docker containers — instead of running containers manually, Kubernetes manages everything for you.


🛠️ Understanding the Architecture

Kubernetes has a master node and worker nodes.

  • The master node manages the entire cluster: scheduling, updating, and controlling the system.

  • The worker nodes can be your frontend, backend, or middleware containers.

  • All nodes run containers — and these containers are organized into pods.

You only need to manage the master node (via scripts or kubectl), and it takes care of the rest!


📍 Real-World Scenario

Let’s say someone makes a request to your frontend (a frontend container). The API server receives this request and checks in the cluster for available containers.

This information is stored in etcd, a key-value database that stores the entire cluster’s state.

If a container is available, it schedules a pod using the scheduler.
There’s also a controller manager that monitors all nodes and pods. It ensures:

  • Pods restart if they fail

  • The desired number of replicas are maintained

  • The system self-heals

In short:
Clusters contain multiple nodes, each node contains pods, and each pod contains one or more containers.


🧩 Kubernetes Core Concepts

🔹 What is a Pod?

  • The smallest deployable unit in Kubernetes.

  • Can contain one or more containers that share network and storage.

  • Typically contains one container in most real-world use cases.

Why use Pods?
They wrap your container and allow Kubernetes to manage them effectively.


🔹 What is a Deployment?

  • A higher-level object that manages pods.

  • Supports:

    • Self-healing (auto-restarts failed pods)

    • Rolling updates

    • Scaling


🔹 What is a Service?

  • A way to expose your pods to the network.

Types of Services:

  • ClusterIP – Internal access only

  • NodePort – Access via node IP + port

  • LoadBalancer – Uses an external cloud-based load balancer


🔹 What is a ConfigMap?

A ConfigMap stores key-value configuration data that your app can use.
It allows you to separate config from code, making updates easier without rebuilding your container.


🔹 What is a Secret?

A Secret is used to store sensitive information like:

  • Passwords

  • OAuth tokens

  • API keys

It’s like a secure vault within your cluster for credentials.


🔹 What are Rolling Updates?

Rolling updates allow you to update applications without downtime.
It gradually replaces old pods with new ones, so some instances are always available to serve users.


💻 Setting Up Kubernetes on Arch Linux with Minikube

✅ Why Minikube?

Minikube is perfect for local development.
It provides a lightweight and portable environment to experiment with Kubernetes without needing a cloud provider.

Think of Minikube as a lab where you can learn Kubernetes hands-on.


✅ Why not jump directly to kubectl?

Because:

  • kubectl is just a command-line tool to interact with a cluster.

  • It does not set up a cluster itself.

  • Minikube creates the cluster, while kubectl controls it.


🔧 Install Minikube and kubectl on Arch Linux

Run the following command:

sudo pacman -S minikube kubectl

Start Your Local Kubernetes Cluster

Minikube uses Docker as the default driver.

Note: kubectl does not use Docker; it uses the CRI (Container Runtime Interface).

Start Minikube:

minikube start --driver=docker

This sets up:

  • A Kubernetes control plane

  • A Kubernetes node (running in a VM or container)

⚠️ If errors occur, make sure your Linux headers are updated or use modprobe to manage kernel modules.

Also ensure Docker is enabled and started:

sudo systemctl start docker
sudo systemctl enable docker

Verify Minikube is Running

Check the status:

minikube status

Check the cluster:

kubectl get nodes

If you see something like minikube Ready, then you're good to go!

Deploy a Simple Ubuntu Pod

As Kubernetes uses YAML files for configuration, we’ll write one to create a Pod.

📄 Create ubuntu-pod.yaml:

apiVersion: v1
kind: Pod
metadata:
  name: ubuntu-pod
spec:
  containers:
    - name: ubuntu-container
      image: ubuntu
      command: ["sleep", "3600"]

Explanation:

  • Creates a pod using the Ubuntu image

  • Runs the command sleep 3600 to keep it alive for an hour

    Apply the Pod

      kubectl apply -f ubuntu-pod.yaml
    

  • Check if it’s running:

      kubectl get pods
    

    🐚 Enter the Ubuntu Pod

      kubectl exec -it ubuntu-pod -- bash
    

  • Now you’re inside the Ubuntu container. You can run normal Ubuntu commands like:

      apt update
      ls
      whoami
    

    Exit the container:

      exit
    

    Delete the Pod

      kubectl delete -f ubuntu-pod.yaml
    

    Conclusion:

    So far, we have:

    • Learned what Kubernetes is

    • Understood its components like Pods, Deployments, and Services

    • Installed and started Minikube on Arch Linux

    • Deployed a simple Ubuntu container using Kubernetes

That means — we have successfully created our first local Kubernetes cluster with Minikube!

P.S.
If you spot any mistakes, please don't hesitate to point them out. We're all here to learn together! 😊


Haris
FAST (NUCES)
BS Computer Science | Class of 2027

📌 Portfolio: zenvila.github.io

📌 GitHub: github.com/Zenvila

📌 LinkedIn: linkedin.com/in/haris-shahzad-7b8746291**
📌 Member: COLAB (Research Lab)**

0
Subscribe to my newsletter

Read articles from Zenvila directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Zenvila
Zenvila

I'm Haris aka Zen, currently in my 4th semester of Computer Science at FAST-NUCES and a member of COLAB (Research Lab) in Tier 3. I'm currently exploring AI/ML in its early stages, and also focusing on improving my problem-solving techniques. 🐧 Proud user of Arch Linux | Command line is my playground. I'm interested in Automation & Robotics Automation enthusiast on a mission to innovate! 🚀 Passionate about turning manual tasks into automated brilliance.