DevOps Kubernetes

Kubernetes Tutorial from Scratch with Minikube: Complete Step-by-Step Guide

Kubernetes from scratch with Minikube: 49 practical lessons on pods, deployments, autoscaling, Ingress and Helm Charts.

Course description

Kubernetes from Scratch with Minikube: 44 Core Lessons + 5 on Helm Charts

I couldn't find a complete resource on Kubernetes that truly started from the basics and built up to a real system. This course with Minikube fills that gap: we start from the concept of a Pod and arrive at a complete architecture with a REST API, MySQL, autoscaling and Ingress — all locally, with zero cloud spending.

What You'll Learn in 49 Lessons

  • Kubernetes architecture: Master Node, Worker Node and Desired State
  • Pod, Deployment and ReplicaSet: the basics with real YAML manifests and kubectl
  • ConfigMap and Secret: separate configuration and credentials from code
  • Networking: NodePort Service, ClusterIP and Ingress with host-based routing
  • Health monitoring: ReadinessProbe, LivenessProbe and StartupProbe
  • Volumes and storage: emptyDir, Sidecar Pattern, PersistentVolume and PVC
  • Autoscaling with HPA: Horizontal Pod Autoscaler in action under real load
  • Full project: deploy a Java REST API with MySQL on Kubernetes
  • Helm Charts: install, create and deploy an API with your own custom Chart

Why Minikube

Minikube lets you run a complete Kubernetes cluster locally, with no cloud costs. The skills you develop are identical to those you would use on Google GKE, Amazon EKS or Azure AKS: same architecture, same YAML manifests, same kubectl CLI.

Who It's For

Developers who already know Docker but find Kubernetes still distant and complicated. Intermediate level: no prior Kubernetes experience required, but it helps to have worked with a REST API and know what a container is.

Lessons list

I'll show you what Kubernetes is, why it has become the de facto standard for container orchestration, and how it compares to Docker. We start from absolute basics so that anyone, even without prior Kubernetes experience, understands the context before writing their first YAML manifest.

Guarda lezione

Let's explore the Pod concept together — the fundamental unit of Kubernetes. You'll understand why containers are never deployed directly but always through Pods, how they're described in YAML, and the use cases where a single Pod hosts multiple containers.

Guarda lezione

I'll explain Desired State, the core principle driving all of Kubernetes: the cluster receives a declaration of desired state and autonomously works to maintain it. We'll also analyze the Master Node architecture with its key components — API Server, etcd, Scheduler, and Controller Manager.

Guarda lezione

Let's dig into the Worker Nodes — the nodes that actually run Pods. I'll show you the role of kubelet, kube-proxy, and the container runtime, and how they communicate with the Master Node to honor the cluster's Desired State.

Guarda lezione

I'll guide you step by step through the installation of kubectl and Minikube on Windows, macOS, and Linux — from checking prerequisites to configuring the local cluster. By the end of this lesson you'll have a working Kubernetes environment ready for the upcoming exercises.

Guarda lezione

Let's go through the essential kubectl commands for interacting with the Minikube cluster: get, describe, apply, delete, logs, and exec. I'll show you the typical workflow for creating, inspecting, and removing resources directly from the terminal.

Guarda lezione

I'll explain how to use Namespaces to isolate and organize workloads inside the Kubernetes cluster: we'll create different namespaces, assign Pods to each one, and see how kubectl manages the active namespace context.

Guarda lezione

Let's create a Deployment with its ReplicaSet: I'll write the YAML manifest from scratch, apply it with kubectl apply, and show you how Kubernetes always maintains the desired number of active Pods by automatically replacing ones that die.

Guarda lezione

Let's continue analyzing Deployments with a deeper look at practical ReplicaSet management: how to update a container image with kubectl set image, observe the rolling update in action, and interpret the output of kubectl rollout status.

Guarda lezione

I'll show you how to expose a Deployment externally with a NodePort Service: you'll understand how Kubernetes maps a node port to the Pod's port so the application becomes reachable from your browser or via curl.

Guarda lezione

Let's consolidate everything we've covered so far with a concrete Echo Pod example: we'll see how Deployment, ReplicaSet, and NodePort Service interact in an end-to-end flow, making the whole picture clear before moving on.

Guarda lezione

Let's go deeper into the behavior of Deployments and Services through further variations of the Echo Pod example: I'll show you how cluster behavior changes with different configurations, analyzing what happens to Pods during updates and restarts.

Guarda lezione

I'll explain how to create a ConfigMap in Kubernetes to manage configuration variables separately from application code: we'll write the resource in YAML, apply it to the cluster, and see how Pods access it as environment variables or mounted files.

Guarda lezione

Let's use a Busybox container with an interactive shell to read values stored in a ConfigMap directly: we'll mount the ConfigMap as a volume in a Pod and navigate the data with shell commands — a useful approach for production debugging.

Guarda lezione

I'll show you how to create a Kubernetes Secret to protect credentials and sensitive data, and how to make them available to Pods via environment variables. You'll understand the real difference between Secrets and ConfigMaps and why base64 encoding alone isn't enough.

Guarda lezione

I'll introduce Kubernetes Probes, starting with the ReadinessProbe: I'll explain how the cluster determines when a Pod is ready to receive traffic and how to configure initialDelaySeconds, periodSeconds, and failureThreshold to prevent false starts.

Guarda lezione

Let's explore LivenessProbe and StartupProbe together: I'll show how the LivenessProbe detects a stuck container and forces a restart, and how the StartupProbe protects slow-starting applications from being killed by the LivenessProbe prematurely.

Guarda lezione

I'll explain how volumes work in Kubernetes starting from emptyDir, the temporary volume shared between containers in the same Pod. You'll understand why container filesystems are ephemeral and how emptyDir solves intra-Pod data sharing.

Guarda lezione

Let's go deeper into emptyDir with practical examples where we dynamically manage the Pod name as a PowerShell variable: we'll read, write, and share files between containers in the same Pod using a real script.

Guarda lezione

Let's build a multi-container Pod that shares data via an emptyDir volume and I'll introduce the Sidecar Pattern: you'll understand how to structure an architecture where a main container and a sidecar collaborate on the same local filesystem.

Guarda lezione

Let's transform the multi-container Sidecar Pattern example into a real Kubernetes Deployment: we'll add replicas, manage updates, and keep the emptyDir configuration working with multiple Pod instances running in parallel.

Guarda lezione

Let's move to the first real-world case: deploying a Java REST API published on Docker Hub via a Kubernetes Deployment on Minikube. I'll show you how to configure the image, observe the Pod lifecycle, and verify that the API responds correctly.

Guarda lezione

Let's add two essential production-ready elements to the Java REST API Deployment: Liveness and Readiness Probes and CPU/memory resource management with requests and limits, so Kubernetes knows how many resources to reserve and when to restart the container.

Guarda lezione

Let's fine-tune the REST API Deployment by optimizing Probe parameters and resource limits: I'll show you how to avoid unnecessary restarts caused by an overly aggressive LivenessProbe and how to balance requests and limits to stabilize Pods under load.

Guarda lezione

I'll show you how to expose a REST API internally with a ClusterIP Service: you'll understand why ClusterIP is the default Service type, how the cluster assigns a stable virtual IP, and how Pods communicate with each other using the Service DNS name.

Guarda lezione

Let's go deeper into ClusterIP Service internal routing by analyzing how kube-proxy balances requests across ReplicaSet Pods: we'll look at advanced Service configuration and verify stable communication between the application's components.

Guarda lezione

I'll show you how to use ConfigMaps to inject environment variables into REST API Deployments: we'll separate configuration from code, update parameters without rebuilding the Docker image, and verify the immediate effect on application behavior.

Guarda lezione

I'll introduce the Horizontal Pod Autoscaler (HPA), Kubernetes' mechanism for automatically scaling the number of Pods based on CPU usage: we'll configure HPA on the Deployment, define min and max replica thresholds, and observe the cluster's behavior.

Guarda lezione

Let's analyze the real HPA behavior under load by generating traffic on the REST API: we'll see how Kubernetes interprets CPU usage metrics, when it decides to scale up, and how long it takes to scale back down once the load drops.

Guarda lezione

Let's design a complete Kubernetes architecture with a REST API and MySQL database: I'll show you how to structure the components, which resources we'll create in the upcoming lessons, and why separating the API and DB into distinct Deployments is the right approach.

Guarda lezione

Let's start the MySQL deployment on Kubernetes by creating the database Deployment: we'll configure the official MySQL image, set the initialization environment variables, and verify the Pod starts correctly before connecting the REST API.

Guarda lezione

I'll show you how to use Kubernetes Secrets to protect MySQL credentials: we'll create the Secret with encoded username and password, inject it into the Deployment via environment variables, and verify Pods correctly access the database without exposing sensitive data in the YAML.

Guarda lezione

Let's see how to use a ConfigMap to configure MySQL dynamically, separating environment variables from the image definition: we'll apply the variables to the Deployment and verify MySQL initializes correctly with the configured parameters.

Guarda lezione

Let's create a ClusterIP Service to expose MySQL inside the Kubernetes cluster: I'll explain how REST APIs reach the database via the Service DNS name, ensuring complete external isolation and stable communication between Pods.

Guarda lezione

Let's start connecting the Java REST API to the MySQL database on Kubernetes: we'll configure the connection variables via Secret and ConfigMap, define the API Deployment, and verify it can reach MySQL through the ClusterIP Service.

Guarda lezione

Let's complete the REST API deployment by adding its Service and verifying the end-to-end flow between client, API, and MySQL database: I'll show you how to expose the application with NodePort, test the endpoints, and confirm the integration is working correctly.

Guarda lezione

Let's apply the Horizontal Pod Autoscaler on a real system with REST API and MySQL: we'll generate load, observe how Kubernetes scales API Pods in response to CPU consumption, and analyze reaction times and scale-down behavior.

Guarda lezione

I'll explain why Kubernetes Pods are ephemeral and how this causes data loss in stateful containers like MySQL: I'll introduce PersistentVolume (PV) and PersistentVolumeClaim (PVC), the resources for declaring and requesting persistent storage in the cluster.

Guarda lezione

Let's move to practice by creating a PersistentVolume and a PersistentVolumeClaim for MySQL: we'll define storage capacity, the ReadWriteOnce access mode, and link PV and PVC so Kubernetes knows where to write data durably.

Guarda lezione

Let's complete the persistence integration by attaching the PVC to the MySQL Deployment via a VolumeMount: we'll mount the volume at MySQL's data path, verify that data survives Pod restarts, and close the full persistent storage cycle on Kubernetes.

Guarda lezione

I'll introduce Ingress, the Kubernetes resource that lets you expose multiple applications externally through a single HTTP/HTTPS entry point: we'll see why Ingress surpasses NodePort limitations, how the Ingress Controller works, and how I'll prepare the environment for upcoming examples.

Guarda lezione

I'll show you how to enable the Ingress addon on Minikube with minikube addons enable ingress, verify the NGINX controller is active, and prepare the Deployments and Services we'll use as backends for the upcoming routing configurations.

Guarda lezione

Let's build the first Ingress configuration by connecting a ClusterIP Service to the NGINX controller: we'll write the Ingress resource in YAML with path-based routing, apply it to the cluster, and verify that HTTP requests are correctly routed to the backend.

Guarda lezione

Let's configure Ingress with Host-Based Routing to route traffic to different services based on the domain: we'll add custom hosts to the local hosts file, define per-domain rules in the Ingress manifest, and verify routing across multiple APIs with a single IP.

Guarda lezione

I'll explain what a Helm Chart is and why Helm has become the standard package manager for Kubernetes: you'll understand how a Chart bundles YAML templates, values, and metadata into a reusable package, eliminating the need to manage dozens of separate manifest files.

Guarda lezione

Let's install Helm and connect it to the local Kubernetes cluster with Minikube: I'll show you how Helm Repositories work, add the official Bitnami repository, and learn how to search, download, and inspect Charts from the public registry.

Guarda lezione

Let's run the first Helm Chart deploy and analyze in detail what happens under the hood: how Helm renders templates with values, creates Kubernetes resources, and manages the Release — so that helm install becomes intuitive rather than mechanical.

Guarda lezione

I'll guide you through creating a custom Helm Chart with helm create: we'll analyze the generated structure — Chart.yaml, values.yaml, templates/ — understand the role of each file, and see how Go templates combine with values to produce dynamic Kubernetes manifests.

Guarda lezione

Let's apply everything we've learned by deploying a real REST API from Docker Hub with our custom Helm Chart: we'll configure the image in values.yaml, adapt the Deployment and Service templates, and get the API running on Minikube with a single helm install.

Guarda lezione
Giovanni Pace

Giovanni Pace

Ingegnere Informatico · Pratola Peligna

  • 107 Courses
About the teacher

Sono un ingegnere informatico con oltre 15 anni di esperienza nel settore ICT. Mi occupo di sviluppo software, cybersecurity, data science e intelligenza artificiale, con particolare attenzione all’innovazione e all’automazione dei processi aziendali. Da anni svolgo anche attività di docenza e formazione, creando percorsi pratici e coinvolgenti su programmazione, DevOps, AI e sicurezza informatica.

This course includes

  • Lessons 49
  • Duration 9h 41m
  • Difficulty intermedio
  • Language it
  • Certificate No

Recently viewed