Kubernetes Basics for Developers: Getting Started Guide

Published 2026-02-06 • Updated 2026-02-06

Learn Kubernetes fundamentals. Pods, deployments, services, and how to deploy containerized applications at scale.

What is Kubernetes?

Kubernetes (K8s) is an open-source container orchestration platform that automates deployment, scaling, and management of containerized applications.

Why Use Kubernetes?

Core Concepts

1. Pods

The smallest deployable unit in Kubernetes. A pod contains one or more containers.

apiVersion: v1
kind: Pod
metadata:
  name: nginx-pod
spec:
  containers:
  - name: nginx
    image: nginx:latest
    ports:
    - containerPort: 80

2. Deployments

Manages replica sets and rolling updates.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.21
        ports:
        - containerPort: 80

3. Services

Exposes pods to network traffic.

apiVersion: v1
kind: Service
metadata:
  name: nginx-service
spec:
  selector:
    app: nginx
  ports:
  - protocol: TCP
    port: 80
    targetPort: 80
  type: LoadBalancer

Essential kubectl Commands

# Get cluster info
kubectl cluster-info

# List pods
kubectl get pods

# Create deployment
kubectl create deployment nginx --image=nginx

# Scale deployment
kubectl scale deployment nginx --replicas=5

# Expose service
kubectl expose deployment nginx --port=80 --type=LoadBalancer

# View logs
kubectl logs pod-name

# Execute command in pod
kubectl exec -it pod-name -- /bin/bash

# Delete resources
kubectl delete deployment nginx

Kubernetes Architecture

Getting Started

1. 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"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/

2. Local Development

Best Practices

Related Posts

Share This