Embarking on the Kubernetes Journey: A Learning Experience

Exploring the world of Kubernetes (K8s) and the path we took to master it.


In the realm of cloud computing, the deployment of applications using both Platform as a Service (PaaS) and Infrastructure as a Service (IaaS) has become a necessity. Recently, our team found itself tasked with deploying a simple Laravel project linked to a MySQL database on Azure. The application, a straightforward counter, increments a value in the database each time a button is clicked.

Project screen shot

To kick off the project, we opted to use Azure VMs and scale sets. Our initial architecture included a central VM for logging and Portainer, and at least one VM to run the application with Watchtower and the Portainer agent. However, as we delved into scaling considerations, questions arose about registering a Portainer agent to the central VM and managing network ports with Azure Load Balancer and Vnet.

Various ideas were considered, including scripting the registration of a Portainer agent using an API or implementing a service discovery mechanism. While these ideas seemed plausible, they demanded extensive testing and custom tooling. Fortunately, we discovered an existing solution that addressed our concerns — Kubernetes.

Embracing Kubernetes (K8s)

The decision to embark on a journey to learn Kubernetes was driven by its core concepts:

  • Cluster: A collection of machines that execute our applications, controlled by a single machine.
  • Node: Each machine in the cluster, referred to as a "Node," runs apps and performs other tasks.
  • Pod: A pod comprises one or more containers, with containers in the same pod sharing the same network.
  • Deployment: Describes how a container image will be utilized, the number of replicas, update procedures, and more.
  • Service: Enables the connection of pods within the network.
  • Namespace : To do resources isolation
  • Container : Run the application

Exploring MiniKube

Initially, our approach involved creating multiple VMs on the cloud, intending to build a cluster with one master and multiple nodes. However, a colleague suggested a more efficient learning method — using "MiniKube." MiniKube is a tool designed to run a Kubernetes cluster on a local machine, offering a practical way to learn without incurring cloud resource costs and provisioning time.