RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Fredoline Eruo
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

© 2026 runlocalai.coIndependently operated
RUNLOCALAI · v38
  1. >
  2. Home
  3. /Learn
  4. /Courses
  5. /Production Local AI Deployment
  6. /Ch. 7
Production Local AI Deployment

07. Kubernetes Basics

Chapter 7 of 24 · 20 min
KEY INSIGHT

Kubernetes operates through declarative specifications applied by reconciliation loops, not imperative commands executed at request time.

Kubernetes orchestrates containerized workloads across clusters of machines. The control plane manages cluster state while worker nodes run scheduled workloads. Understanding the core concepts—pods, nodes, namespaces, and the kubectl command-line interface—provides the foundation for production AI deployments.

The control plane components include the API server accepting cluster operations, etcd maintaining consistent state, the scheduler assigning pods to nodes, and the controller manager running reconciliation loops. Control plane high availability requires multiple instances with election-based leadership.

Nodes host pods. Each node runs kubelet, the Kubernetes agent communicating with the control plane, and kube-proxy, the network proxy maintaining service connectivity. Node status reports condition information including memory pressure, disk pressure, and network availability.

Namespaces provide scope for resource isolation. Multi-tenant clusters use namespaces for team separation, resource quotas, and network policies. Resources within namespaces reference each other by name; cross-namespace communication requires explicit naming.

# Cluster exploration commands
kubectl cluster-info                    # Control plane endpoint
kubectl get nodes                       # List worker nodes with status
kubectl describe node <node-name>       # Detailed node information
kubectl api-resources                   # Available resource types
kubectl version --client               # kubectl version

# Namespace operations
kubectl get namespaces                 # List namespaces
kubectl create namespace ai-inference  # Create namespace
kubectl config set-context --current \
  --namespace=ai-inference            # Set default namespace

Pods represent the smallest schedulable unit. A pod contains one or more containers sharing network namespace, process space, and storage volumes. Pods receive unique cluster IP addresses and share thelocalhost interface for intra-pod communication.

The pod lifecycle includes pending while scheduling occurs, running while containers execute, and terminal states succeeded or failed. Pod conditions report Ready, PodScheduled, and Initialized states through the status.conditions field.

kubectl provides the primary interface for interacting with clusters. The verb-noun resource pattern—get pods, describe deployment, logs pod-name—mirrors the Kubernetes API structure. Tab completion accelerates command entry for common operations.

Context switching enables single kubectl installations to manage multiple clusters. kubeconfig files store cluster credentials and context definitions. The current-context determines which cluster receives commands.

EXERCISE

Deploy a simple stateless web service to a local Kubernetes cluster (minikube, kind, or k3s). Create a deployment with the official nginx image, expose it through a NodePort service, verify accessibility, then clean up all resources. Document each command and its effect on cluster state.

# Create deployment
kubectl create deployment nginx \
  --image=nginx:latest \
  --port=80 \
  --replicas=3

# Expose via NodePort
kubectl expose deployment nginx \
  --type=NodePort \
  --port=80

# Verify deployment
kubectl get all
kubectl get pods -o wide

# Access the service
curl http://localhost:<NODE_PORT>

# View logs
kubectl logs deployment/nginx --follow --tail=20

# Cleanup
kubectl delete deployment nginx
kubectl delete service nginx
← Chapter 6
Resource Limits
Chapter 8 →
GPU Node Selection