Initial Setup
Get Kubernetes installed and deploy your first application. This guide walks you through local Kubernetes setup and your first deployment.
π― What You’ll Accomplish
By the end of this tutorial, you’ll have:
- β Kubernetes running locally
- β kubectl CLI configured
- β Your first pod deployed
π Prerequisites
- Docker installed
- Basic command line familiarity
- 4GB RAM minimum
πΎ Step 1: Install Kubernetes
Using Minikube (Recommended for Learning)
# macOS
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
# Windows
choco install minikubeUsing Docker Desktop
Enable Kubernetes in Docker Desktop Settings.
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 kubectl /usr/local/bin/kubectl
# Windows
choco install kubernetes-cliπ Step 2: Start Kubernetes
minikube start
kubectl cluster-info
kubectl get nodesπ¦ Step 3: Deploy Your First Application
kubectl create deployment nginx --image=nginx
kubectl get deployments
kubectl get podsπ Step 4: Expose the Application
kubectl expose deployment nginx --type=NodePort --port=80
kubectl get services
minikube service nginx --urlVisit the URL shown to see nginx running.
β Verification Checklist
Before moving forward, verify:
-
kubectl versionshows client and server versions -
kubectl get nodesshows nodes ready - Deployment created and pod running
- Service accessible via browser
π You’re Done!
You’ve successfully set up Kubernetes and deployed your first application.
π What’s Next?
Quick learner: Kubernetes Quick Start
Code-first learner: Kubernetes By Example
Last updated