Kubernetes Tutorial Example: A Step-by-Step Beginner’s Guide

Logan Jul 13, 2026

Greetings, aspiring Kubernetes enthusiasts! Today, we delve into a comprehensive, hands-on tutorial that will take you from Kubernetes novice to hands-on practitioner. With a focus on practical examples, we'll ensure you don't just understand Kubernetes but can also apply it in your projects.

a diagram with the words how to learn kubernets on it and an image of
a diagram with the words how to learn kubernets on it and an image of

Before we dive in, a quick primer on Kubernetes (often abbreviated as K8s): It's an open-source system for automating deployment, scaling, and management of containerized applications. In other words, it helps you run and scale your applications more efficiently. Now, let's get started!

Master External Secrets Operator in Kubernetes (ESO Guide)
Master External Secrets Operator in Kubernetes (ESO Guide)

Getting Started with Kubernetes

First things first: Set up a local Kubernetes cluster using Minikube. It's the official tool from the Kubernetes project for running Kubernetes locally.

the 8 kubernets commands are displayed in blue and white, as well as instructions on how to use them
the 8 kubernets commands are displayed in blue and white, as well as instructions on how to use them

Here's how you install and start Minikube:

  1. Install Minikube. For macOS, use Homebrew: brew install minikube.
  2. Start Minikube: minikube start.
a blue and white poster with the words kubernets written in different languages
a blue and white poster with the words kubernets written in different languages

Verifying the Kubernetes Installation

Once started, verify your Kubernetes installation by getting the list of nodes. Run this command in your terminal:

kubectl get nodes

You should see your local Minikube node detailing its status, among other details.

the kubernets basics diagram with several different types of text and symbols on it
the kubernets basics diagram with several different types of text and symbols on it

Deploying Your First Application

Kubernetes uses YAML files to define deployments and other resources. Let's deploy a simple Node.js application using the official Kubernetes Hello World example:

  1. Create a new directory and navigate into it.
  2. Create a new file named deployment.yaml with the following content:
A few things I've learned about Kubernetes
A few things I've learned about Kubernetes

apiVersion: apps/v1
kind: Deployment
metadata:
  name: hello-world
spec:
  selector:
    matchLabels:
      app: hello-world
  replicas: 3
  template:
    metadata:
      labels:
        app: hello-world
    spec:
      containers:
      - name: hello-world
        image: gcr.io/google-samples/node-hello:1.0

This deployment specifies three replicas (instances) of the application. Now, apply the deployment with:

kubectl apply -f deployment.yaml

Verify the deployment with:

an info sheet describing how to learn kubernets
an info sheet describing how to learn kubernets
a handwritten note with the words how kubernets can break
a handwritten note with the words how kubernets can break
A Beginner’s Guide to Kubernetes
A Beginner’s Guide to Kubernetes
Mohamed Abukar on LinkedIn: #kubernetes #architecture #components | 41 comments
Mohamed Abukar on LinkedIn: #kubernetes #architecture #components | 41 comments
GitHub - kubernetes/examples: Kubernetes application example tutorials
GitHub - kubernetes/examples: Kubernetes application example tutorials
the kubernets administration tips and tricks poster
the kubernets administration tips and tricks poster
Chiranjeeb Dash on LinkedIn: 🚀 Mastering Kubernetes: The Ultimate Roadmap for 2024! ☸️ Kubernetes has…
Chiranjeeb Dash on LinkedIn: 🚀 Mastering Kubernetes: The Ultimate Roadmap for 2024! ☸️ Kubernetes has…
a diagram showing the different types of kubernets and what they are used
a diagram showing the different types of kubernets and what they are used
an image of a document with the words, fundamentnal kubernets concept
an image of a document with the words, fundamentnal kubernets concept
Top 10 Useful Kubernetes Commands with Examples
Top 10 Useful Kubernetes Commands with Examples
the info sheet for kubernet's commands and tips to know about it
the info sheet for kubernet's commands and tips to know about it
Kubernetes
Kubernetes
the diagram shows how kubernets architecture works with each other in one area
the diagram shows how kubernets architecture works with each other in one area
the cover of traffic routing in kubernets, with four different types of information
the cover of traffic routing in kubernets, with four different types of information
the kubernets architecture components diagram is shown in blue and pink, with text on
the kubernets architecture components diagram is shown in blue and pink, with text on
a poster with instructions on how to use kubernets
a poster with instructions on how to use kubernets
Investigating Kubernetes from Inside | Apriorit
Investigating Kubernetes from Inside | Apriorit
Mastering Kubernetes: A Comprehensive Tutorial for Container Orchestration
Mastering Kubernetes: A Comprehensive Tutorial for Container Orchestration
☕︎‧₊kubernetes٠࣪⋆💻₊˚ᵎ Devops
☕︎‧₊kubernetes٠࣪⋆💻₊˚ᵎ Devops
a poster with the words kubernets network and other information on it's side
a poster with the words kubernets network and other information on it's side

kubectl get deployments

Watch the pods—PODs are Kubernetes' smallest and simplest units of the Kubernetes Platform—spin up with:

kubectl get pods

Using Pods & Running Commands

Pods are the smallest deployable units in Kubernetes and hold one or more containers. Let's interact with our deployed pod:

Viewing Pod logs

To view the logs of our Hello World application, use:

kubectl logs <POD_NAME>

Executing Commands in the Pod

You can run commands inside running pods using kubectl exec. For instance, to view the environment variables in the pod:

kubectl exec <POD_NAME> -- printenv

And that's a wrap! You've just taken your first steps into the Kubernetes ecosystem.

Kubernetes, like many tools, is best understood through practice. So, keep exploring, experimenting, and expanding your knowledge. Happy K8s-ing!