quickstart5 min read

First Kubernetes Deployment in 30 Minutes

SFEIR Institute

Key Takeaways

  • Minikube enables local Kubernetes deployment with minimum 4 GB RAM and 2 CPU cores
  • An nginx Deployment exposed via NodePort Service is accessible in 30 minutes
  • 'Essential concepts covered: Pods, Deployments, Services'

This first Kubernetes deployment in 30 minutes guide walks you through deploying your first containerized application step by step. From a local cluster to an application accessible via browser, this tutorial covers essential concepts: Pods, Deployments, Services. You'll complete your first Kubernetes deployment without complex prerequisites.

TL;DR: Install Minikube, create an nginx Deployment, expose it via a NodePort Service. In 30 minutes, you'll have a working application and the foundation to go further.

These fundamentals are at the core of the Kubernetes Fundamentals training.

Prerequisites: What you need for the first Kubernetes deployment in 30 minutes

Hardware and software

ElementMinimum required
RAM4 GB available
CPU2 cores
Disk20 GB free
OSmacOS, Windows 10+, Linux

Install the tools

Step 1: Install Docker Desktop (macOS/Windows) or Docker Engine (Linux)

# Verify Docker installation
docker --version
# Docker version 27.5.0, build ...

Step 2: Install Minikube

# macOS with Homebrew
brew install minikube

# Linux
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube

Step 3: Install kubectl

# macOS
brew install kubectl

# Linux
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
Key takeaway: Minikube creates a single-node local Kubernetes cluster. Ideal for learning without cloud infrastructure.

As The Enterprisers Project reminds us: "Anybody can learn Kubernetes. With abundant documentation and development tools available online, teaching yourself Kubernetes is very much within reach" (The Enterprisers Project).

Start your local Kubernetes cluster

Launch Minikube

minikube start --driver=docker --memory=4096 --cpus=2

# Expected output
# 😄  minikube v1.34.0 on Darwin
# ✨  Using the docker driver
# 🔥  Creating docker container
# 🐳  Kubernetes v1.31.0 on Docker 27.2.0
# ✅  Done! kubectl is now configured

Verify the cluster

kubectl cluster-info
# Kubernetes control plane is running at https://127.0.0.1:55000

kubectl get nodes
# NAME       STATUS   ROLES           AGE   VERSION
# minikube   Ready    control-plane   1m    v1.31.0

With 82% of container users running Kubernetes in production (CNCF Annual Survey 2025), mastering these commands becomes essential.

For more Kubernetes tutorials and practical guides, consult our dedicated hub.

Create your first Deployment

What is a Deployment?

A Deployment is a Kubernetes resource that manages a set of identical Pods. It ensures that the desired number of replicas is always running, manages updates and rollbacks.

Deploy nginx

kubectl create deployment nginx-demo --image=nginx:1.27 --replicas=2
# deployment.apps/nginx-demo created

Verify the Deployment

kubectl get deployments
# NAME         READY   UP-TO-DATE   AVAILABLE   AGE
# nginx-demo   2/2     2            2           30s

kubectl get pods
# NAME                          READY   STATUS    RESTARTS   AGE
# nginx-demo-5d4f6b7c9-abc12    1/1     Running   0          45s
# nginx-demo-5d4f6b7c9-xyz34    1/1     Running   0          45s
Key takeaway: Kubernetes automatically maintains 2 replicas. If a Pod fails, a new one is created immediately.

Consult our guide on Rolling Update Kubernetes to understand zero-downtime updates.

Expose your application with a Service

What is a Service?

A Service is an abstraction that exposes a set of Pods via a stable IP address. Pods are ephemeral; the Service offers a permanent access point.

Create a NodePort Service

kubectl expose deployment nginx-demo --type=NodePort --port=80
# service/nginx-demo exposed

Verify the Service

kubectl get services
# NAME         TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)        AGE
# kubernetes   ClusterIP   10.96.0.1       <none>        443/TCP        10m
# nginx-demo   NodePort    10.96.123.45    <none>        80:31234/TCP   1m

Access the application

minikube service nginx-demo --url
# http://192.168.49.2:31234

Open the URL in your browser. You'll see the nginx welcome page.

Understand the resources created

Your deployment architecture

┌─────────────────────────────────────────────┐
│                 Service                      │
│              (NodePort:31234)                │
└─────────────────┬───────────────────────────┘
│ Load balancing
┌─────────┴─────────┐
▼                   ▼
┌───────────────┐   ┌───────────────┐
│     Pod 1     │   │     Pod 2     │
│  nginx:1.27   │   │  nginx:1.27   │
└───────────────┘   └───────────────┘
│                   │
└─────────┬─────────┘
▼
┌───────────────┐
│  Deployment   │
│  replicas: 2  │
└───────────────┘

Inspect resources in detail

kubectl describe deployment nginx-demo
# Name:                   nginx-demo
# Selector:               app=nginx-demo
# Replicas:               2 desired | 2 updated | 2 available
# StrategyType:           RollingUpdate

For a more complete view, the Kubernetes Deployment and Production hub offers advanced guides.

Modify and update your deployment

Scale the number of replicas

kubectl scale deployment nginx-demo --replicas=4
# deployment.apps/nginx-demo scaled

kubectl get pods
# 4 pods now in Running state

Update the image

kubectl set image deployment/nginx-demo nginx=nginx:1.27.1
# deployment.apps/nginx-demo image updated

kubectl rollout status deployment/nginx-demo
# Waiting for deployment "nginx-demo" rollout to finish: 2 out of 4 new replicas...
# deployment "nginx-demo" successfully rolled out
Key takeaway: Kubernetes performs a rolling update: new Pods start before old ones stop. Zero service interruption.

Go deeper with our guide on Canary Deployment on Kubernetes.

Use a YAML manifest file

Why manifests?

kubectl create commands are suitable for learning. In production, YAML manifests allow:

  • Git versioning
  • Code review
  • Reproducibility

Create a complete manifest

# nginx-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-prod
labels:
app: nginx
environment: production
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.27
ports:
- containerPort: 80
resources:
requests:
memory: "64Mi"
cpu: "100m"
limits:
memory: "128Mi"
cpu: "200m"
---
apiVersion: v1
kind: Service
metadata:
name: nginx-service
spec:
selector:
app: nginx
ports:
- port: 80
targetPort: 80
type: NodePort

Apply the manifest

kubectl apply -f nginx-deployment.yaml
# deployment.apps/nginx-prod created
# service/nginx-service created

To master GitOps, consult our guide GitOps and Kubernetes: principles and implementation.

Clean up resources

# Delete created resources
kubectl delete deployment nginx-demo nginx-prod
kubectl delete service nginx-demo nginx-service

# Stop Minikube
minikube stop

# Delete the cluster (optional)
minikube delete

Next steps after your first deployment

You've completed the first Kubernetes deployment in 30 minutes. Here's how to progress:

  1. ConfigMaps and Secrets: externalize configuration
  2. Persistent volumes: store data
  3. Ingress: expose via domain name
  4. CI/CD: automate deployments via a CI/CD pipeline for Kubernetes

Consult the feedback on migrating to Kubernetes in production to understand scaling challenges.

As TealHQ advises: "Don't let your knowledge remain theoretical - set up a real Kubernetes environment to solidify your skills" (TealHQ Kubernetes DevOps Guide).

Contact our advisors for personalized guidance.

Go further with SFEIR training

This tutorial gave you the basics of Kubernetes deployment. To go further, SFEIR offers:

Deploy your applications with confidence. Contact our advisors to define your Kubernetes training path.