Skip to content
kubernetes-essentials logo

Kubernetes Essentials Skill

kubernetes-essentials

Quick reference for Kubernetes core concepts and kubectl commands. This skill should be used as a refresher for basic K8s operations including pods, deployments, services, configmaps, secrets, and namespaces. Use this skill when working with Kubernetes clusters for Phase IV+ deployments.

SKILL.md

Full skill instructions

Kubernetes Essentials Skill

Core Concepts Overview

Kubernetes Architecture

┌─────────────────────────────────────────────────────────────────┐
│                        Control Plane                             │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐  ┌─────────┐ │
│  │ API Server  │  │ Scheduler   │  │ Controller  │  │  etcd   │ │
│  │             │  │             │  │  Manager    │  │         │ │
│  └─────────────┘  └─────────────┘  └─────────────┘  └─────────┘ │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                        Worker Nodes                              │
│  ┌─────────────────────────────────────────────────────────────┐ │
│  │ Node 1                          Node 2                      │ │
│  │ ┌─────────┐ ┌─────────┐        ┌─────────┐ ┌─────────┐     │ │
│  │ │  Pod    │ │  Pod    │        │  Pod    │ │  Pod    │     │ │
│  │ │┌───────┐│ │┌───────┐│        │┌───────┐│ │┌───────┐│     │ │
│  │ ││ Cont. ││ ││ Cont. ││        ││ Cont. ││ ││ Cont. ││     │ │
│  │ │└───────┘│ │└───────┘│        │└───────┘│ │└───────┘│     │ │
│  │ └─────────┘ └─────────┘        └─────────┘ └─────────┘     │ │
│  │      kubelet, kube-proxy            kubelet, kube-proxy    │ │
│  └─────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘

Key Resources

ResourcePurposeShorthand
PodSmallest deployable unit, runs containerspo
DeploymentManages ReplicaSets, handles rolloutsdeploy
ServiceNetwork endpoint for podssvc
ConfigMapConfiguration data (non-sensitive)cm
SecretSensitive configuration datasecret
NamespaceVirtual cluster isolationns
IngressExternal HTTP/​S routinging
PersistentVolumeClaimStorage requestpvc

Essential kubectl Commands

Context and Configuration

# View current context
kubectl config current-context

# List all contexts
kubectl config get-contexts

# Switch context
kubectl config use-context my-context

# Set default namespace
kubectl config set-context --current --namespace=my-namespace

Getting Information

# List resources
kubectl get pods                    # Pods in current namespace
kubectl get pods -A                 # All namespaces
kubectl get pods -o wide            # Additional details (node, IP)
kubectl get pods -o yaml            # Full YAML output
kubectl get all                     # All common resources

# Describe resources (detailed info + events)
kubectl describe pod my-pod
kubectl describe deployment my-deploy

# View logs
kubectl logs my-pod                 # Current logs
kubectl logs my-pod -f              # Follow logs
kubectl logs my-pod -c container    # Specific container
kubectl logs my-pod --previous      # Previous container (after crash)

Creating Resources

# From YAML file
kubectl apply -f manifest.yaml

# Imperative creation
kubectl create deployment nginx --image=nginx
kubectl create service clusterip nginx --tcp=80:80
kubectl create configmap my-config --from-literal=key=value
kubectl create secret generic my-secret --from-literal=password=secret123

# Generate YAML without applying
kubectl create deployment nginx --image=nginx --dry-run=client -o yaml > deploy.yaml

Modifying Resources

# Edit in place
kubectl edit deployment my-deploy

# Scale deployment
kubectl scale deployment my-deploy --replicas=3

# Update image
kubectl set image deployment/​my-deploy container=image:v2

# Patch resource
kubectl patch deployment my-deploy -p '{"spec":{"replicas":5}}'

Deleting Resources

# Delete by name
kubectl delete pod my-pod
kubectl delete deployment my-deploy

# Delete from file
kubectl delete -f manifest.yaml

# Delete all pods in namespace
kubectl delete pods --all -n my-namespace

# Force delete stuck pod
kubectl delete pod my-pod --grace-period=0 --force

Executing Commands

# Run command in pod
kubectl exec my-pod -- ls /​app

# Interactive shell
kubectl exec -it my-pod -- /​bin/​sh

# Specific container
kubectl exec -it my-pod -c my-container -- /​bin/​bash

Port Forwarding

# Forward pod port to local
kubectl port-forward pod/​my-pod 8080:80

# Forward service port
kubectl port-forward svc/​my-service 8080:80

Resource Manifests

Pod

apiVersion: v1
kind: Pod
metadata:
  name: my-pod
  labels:
    app: my-app
spec:
  containers:
    - name: main
      image: nginx:1.21
      ports:
        - containerPort: 80
      resources:
        requests:
          cpu: 100m
          memory: 128Mi
        limits:
          cpu: 500m
          memory: 256Mi

Deployment

apiVersion: apps/​v1
kind: Deployment
metadata:
  name: my-deploy
spec:
  replicas: 3
  selector:
    matchLabels:
      app: my-app
  template:
    metadata:
      labels:
        app: my-app
    spec:
      containers:
        - name: main
          image: nginx:1.21
          ports:
            - containerPort: 80
          livenessProbe:
            httpGet:
              path: /​health
              port: 80
            initialDelaySeconds: 30
            periodSeconds: 10
          readinessProbe:
            httpGet:
              path: /​ready
              port: 80
            initialDelaySeconds: 5
            periodSeconds: 5

Service

# ClusterIP (internal only)
apiVersion: v1
kind: Service
metadata:
  name: my-service
spec:
  type: ClusterIP
  selector:
    app: my-app
  ports:
    - port: 80
      targetPort: 8080

---
# NodePort (external via node IP)
apiVersion: v1
kind: Service
metadata:
  name: my-nodeport
spec:
  type: NodePort
  selector:
    app: my-app
  ports:
    - port: 80
      targetPort: 8080
      nodePort: 30080

---
# LoadBalancer (cloud provider LB)
apiVersion: v1
kind: Service
metadata:
  name: my-lb
spec:
  type: LoadBalancer
  selector:
    app: my-app
  ports:
    - port: 80
      targetPort: 8080

ConfigMap

apiVersion: v1
kind: ConfigMap
metadata:
  name: my-config
data:
  DATABASE_HOST: postgres
  DATABASE_PORT: "5432"
  config.json: |
    {
      "debug": true,
      "logLevel": "info"
    }

Secret

apiVersion: v1
kind: Secret
metadata:
  name: my-secret
type: Opaque
data:
  # base64 encoded values
  password: cGFzc3dvcmQxMjM=
  api-key: YWJjZGVmMTIzNDU2

Ingress

apiVersion: networking.k8s.io/​v1
kind: Ingress
metadata:
  name: my-ingress
  annotations:
    nginx.ingress.kubernetes.io/​rewrite-target: /
spec:
  ingressClassName: nginx
  rules:
    - host: myapp.local
      http:
        paths:
          - path: /​api
            pathType: Prefix
            backend:
              service:
                name: api-service
                port:
                  number: 8000
          - path: /
            pathType: Prefix
            backend:
              service:
                name: web-service
                port:
                  number: 3000

Using ConfigMaps and Secrets

As Environment Variables

spec:
  containers:
    - name: app
      env:
        # Single value from ConfigMap
        - name: DATABASE_HOST
          valueFrom:
            configMapKeyRef:
              name: my-config
              key: DATABASE_HOST
        # Single value from Secret
        - name: API_KEY
          valueFrom:
            secretKeyRef:
              name: my-secret
              key: api-key
      # All values from ConfigMap
      envFrom:
        - configMapRef:
            name: my-config
        - secretRef:
            name: my-secret

As Volumes

spec:
  containers:
    - name: app
      volumeMounts:
        - name: config-volume
          mountPath: /​etc/​config
  volumes:
    - name: config-volume
      configMap:
        name: my-config

Debugging Quick Reference

# Pod not starting?
kubectl describe pod my-pod          # Check Events section
kubectl get events --sort-by='.lastTimestamp'

# Container crashing?
kubectl logs my-pod --previous       # Logs from crashed container

# Network issues?
kubectl exec -it my-pod -- nslookup my-service
kubectl exec -it my-pod -- wget -qO- http://my-service:80

# Check resource usage
kubectl top pods
kubectl top nodes

Resources

Refer to references/​troubleshooting.md for common issues and solutions.

More DevOps & CI/CD skills

Project scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.

6K 472.6K
View

Set up tracing, logging, and monitoring for deployed ADK agents across Cloud Trace, BigQuery, and third-party platforms.

6K 472.6K
View

Enterprise Azure infrastructure architect generating Bicep or Terraform from workload descriptions.

1.5K 454.3K
View
azure-kubernetes logo
DevOps & CI/CD

azure-kubernetes

Plan and configure production-ready Azure Kubernetes Service clusters with Day-0 and Day-1 best practices.

1.5K 447.1K
View

Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.

92.7K 354.9K
View
just-scrape logo
DevOps & CI/CD

just-scrape

Web search, scraping, extraction, crawling, and monitoring via ScrapeGraph AI CLI.

69 245K
View

Skill for working with Firebase Hosting (Classic). Use this when you want to deploy static web apps, Single Page Apps (SPAs), or simple microservices. Do NOT use for Firebase App Hosting.

462 159.7K
View

Deploy and manage web apps with Firebase App Hosting. Use this skill when deploying Next.js/Angular apps with backends.

462 159.1K
View
deploy-to-vercel logo
DevOps & CI/CD

deploy-to-vercel

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

31.9K 146.6K
View
programmatic-seo logo
DevOps & CI/CD

programmatic-seo

Build SEO-optimized pages at scale using templates, data, and proven playbook patterns.

53.3K 140.1K
View

Design and build isolated, reusable Convex backend components with clear boundaries and app-facing wrappers.

63 123.5K
View

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

31.9K 116.1K
View

Coding & apps AI tools

Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View
I
Coding & apps

Imagica

Build a no-code AI app in minutes.

Freemium
View
E
Coding & apps

Emergent.sh

An IDE for code migration from legacy to modern frameworks through coding agents.

Freemium
View
Wonder Dynamics logo
Coding & apps

Wonder Dynamics

Automate CGI animation in live-action scenes

Paid
View
M
Coding & apps

Mixo

Launch a website in seconds with AI.

Paid
View
AI Code Convert logo
Coding & apps

AI Code Convert

Streamline Your Coding Experience with AI Code Helper

Free
View