Introduction to Kubernetes

matt
Matthew Gros · Sep 16, 2025

TLDR

Pods run containers, Services expose them, Deployments manage updates. Start with managed K8s (EKS, GKE).

Introduction to Kubernetes

Kubernetes in Plain English

Container orchestration without the buzzwords.

Core Concepts

Pod: One or more containers that run together Service: Stable network endpoint for pods Deployment: Manages pod replicas and updates Namespace: Logical separation of resources

Basic Deployment

# deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-app
spec:
  replicas: 3
  selector:
    matchLabels:
      app: my-app
  template:
    metadata:
      labels:
        app: my-app
    spec:
      containers:
      - name: my-app
        image: my-app:1.0.0
        ports:
        - containerPort: 80

Exposing Services

# service.yaml
apiVersion: v1
kind: Service
metadata:
  name: my-app
spec:
  selector:
    app: my-app
  ports:
  - port: 80
    targetPort: 80
  type: LoadBalancer

Common Commands

# Apply configuration
kubectl apply -f deployment.yaml

# Get resources
kubectl get pods
kubectl get services
kubectl get deployments

# Describe (debug)
kubectl describe pod my-app-xxx

# Logs
kubectl logs my-app-xxx
kubectl logs -f my-app-xxx  # Follow

# Shell into pod
kubectl exec -it my-app-xxx -- /bin/sh

Environment Variables

spec:
  containers:
  - name: my-app
    env:
    - name: DB_HOST
      value: "mysql-service"
    - name: DB_PASSWORD
      valueFrom:
        secretKeyRef:
          name: db-secrets
          key: password

Start Simple

  1. Use managed K8s (EKS, GKE, AKS)
  2. Start with Deployment + Service
  3. Add complexity as needed
  4. Use Helm for complex apps

About the Author

matt

I build and ship automation-driven products using Laravel and modern frontend stacks (Vue/React), with a focus on scalability, measurable outcomes, and tight user experience. I’m based in Toronto, have 13+ years in PHP, and I also hold a pilot’s license. I enjoy working on new tech projects and generally exploring new technology.