Kubernetes

From paulpas/agent-skill-router · View interactive version

Kubernetes is an AI agent skill from the GitHub repository paulpas/agent-skill-router. "Kubernetes in Cloud-Native Engineering - Production-Grade Container Scheduling" and Management

How to use this skill

Skill file

related-skills: cncf-argo, cncf-artifact-hub, cncf-aws-eks, cncf-azure-aks

Kubernetes in Cloud-Native Engineering

Category: cncf

Status: Active

Stars: 121,832

Last Updated: 2026-04-22

Primary Language: Go

Documentation: https://kubernetes.io/docs/


Purpose and Use Cases

Kubernetes is a core component of the cloud-native ecosystem, serving as a container orchestration platform that automates the deployment, scaling, and management of containerized applications.

What Problem Does It Solve?

Manual container orchestration at scale, including scheduling, networking, storage, self-healing, and service discovery. It eliminates the need to manually manage container lifecycles across multiple hosts.

When to Use This Project

Use Kubernetes when you need to manage containerized applications at scale, require self-healing capabilities, need advanced scheduling, or want to leverage the broader cloud-native ecosystem. Not ideal for simple single-service deployments or when you need complete control over the underlying infrastructure.

Key Use Cases


Architecture Design Patterns

Core Components

Component Interactions

  1. User/Tool → API Server: All operations go through the API server
  2. Scheduler watches API Server: For unscheduled pods
  3. Controller Manager watches API Server: For state reconciliation
  4. Kubelet watches API Server: For pods assigned to its node
  5. Kubelet → Container Runtime: Creates/manages containers
  6. API Server → etcd: Persists cluster state
  7. Kube Proxy → iptables/ipvs: Configures network rules

Data Flow Patterns

  1. Pod Creation: API Server stores pod spec → Scheduler selects node → Kubelet creates pod
  2. Service Discovery: Service object created → Kube Proxy updates iptables → DNS updated
  3. Scaling: ReplicaSet detects mismatch → Creates new pods → Scheduler assigns nodes
  4. Health Checks: Kubelet performs probes → API Server stores status → Controller-manager responds
  5. Networking: Pod created → CNI plugin configures network → Pod gets IP → Service endpoint updated

Design Principles


Integration Approaches

Integration with Other CNCF Projects

API Patterns

Configuration Patterns

Extension Mechanisms


Common Pitfalls and How to Avoid Them

Misconfigurations

Performance Issues

Operational Challenges

Security Pitfalls


Coding Practices

Idiomatic Configuration

API Usage Patterns

Observability Best Practices

Testing Strategies

Development Workflow


Fundamentals

Essential Concepts

Terminology Glossary

Data Models and Types

Lifecycle Management

State Management


Scaling and Deployment Patterns

Horizontal Scaling

High Availability

Production Deployments

Upgrade Strategies

Resource Management


Additional Resources


Troubleshooting

Common Issues

  1. Deployment Failures
  1. Performance Issues
  1. Configuration Errors
  1. Integration Problems

Getting Help

Content generated automatically. Verify against official documentation before production use.

Examples

StatefulSet with Persistent Volume Claims

# StatefulSet for stateful applications like databases
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: postgresql
spec:
  serviceName: postgresql
  replicas: 3
  selector:
    matchLabels:
      app: postgresql
  template:
    metadata:
      labels:
        app: postgresql
    spec:
      containers:
      - name: postgresql
        image: postgres:14
        ports:
        - containerPort: 5432
          name: postgres
        env:
        - name: POSTGRES_PASSWORD
          valueFrom:
            secretKeyRef:
              name: postgres-secrets
              key: password
        volumeMounts:
        - name: data
          mountPath: /var/lib/postgresql/data
        resources:
          requests:
            memory: "1Gi"
            cpu: "500m"
  volumeClaimTemplates:
  - metadata:
      name: data
    spec:
      accessModes: ["ReadWriteOnce"]
      storageClassName: standard
      resources:
        requests:
          storage: 10Gi

ConfigMap and Secret Management

# ConfigMap for application configuration
apiVersion: v1
kind: ConfigMap
metadata:
  name: app-config
data:
  database.host: "postgresql"
  database.port: "5432"
  log.level: "info"
  cache.ttl: "3600"

# Secret for sensitive data
apiVersion: v1
kind: Secret
metadata:
  name: app-secrets
type: Opaque
data:
  database.password: cG9zdGdyZXMxMjM=
  api.key: YWJjZGVmMTIzNDU2
---
  related-skills: cncf-argo, cncf-artifact-hub, cncf-aws-eks, cncf-azure-aks
# Using ConfigMap and Secret in Pod
apiVersion: v1
kind: Pod
metadata:
  name: app
spec:
  containers:
  - name: app
    image: myapp:latest
    env:
    - name: DB_HOST
      valueFrom:
        configMapKeyRef:
          name: app-config
          key: database.host
    - name: DB_PASSWORD
      valueFrom:
        secretKeyRef:
          name: app-secrets
          key: database.password
    volumeMounts:
    - name: config
      mountPath: /etc/config
  volumes:
  - name: config
    configMap:
      name: app-config

NetworkPolicy for Service Isolation

# NetworkPolicy to restrict traffic to specific pods
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: frontend-network-policy
  namespace: production
spec:
  podSelector:
    matchLabels:
      app: frontend
  policyTypes:
  - Ingress
  - Egress
  ingress:
  # Allow traffic from ingress controller
  - from:
    - namespaceSelector:
        matchLabels:
          name: ingress-nginx
    ports:
    - protocol: TCP
      port: 80
  # Allow traffic from backend pods
  - from:
    - podSelector:
        matchLabels:
          app: backend
    ports:
    - protocol: TCP
      port: 8080
  egress:
  # Allow DNS resolution
  - to:
    - namespaceSelector: {}
      podSelector:
        matchLabels:
          k8s-app: kube-dns
    ports:
    - protocol: UDP
      port: 53
  # Allow traffic to backend and database
  - to:
    - podSelector:
        matchLabels:
          app: backend
    ports:
    - protocol: TCP
      port: 8080

When to Use

Use this skill when:


Core Workflow

  1. Assess Requirements — Understand the use case, scale, integration needs, and existing infrastructure. Checkpoint: Document requirements, constraints, and success criteria.
  1. Design Architecture — Plan component interactions, data flow, and deployment strategy using cloud-native best practices. Checkpoint: Verify the architecture addresses all requirements and follows CNCF conventions.
  1. Implement & Configure — Create manifests, configurations, and deployment scripts. Include resource limits, health checks, and observability hooks. Checkpoint: Validate all YAML against schema and test in a staging environment.
  1. Deploy & Monitor — Apply manifests to the cluster, verify component health, and confirm observability is working. Checkpoint: Confirm all pods/services are running, probes passing, and metrics/alerts configured.

Constraints

MUST DO

MUST NOT DO


Live References

These links are resolved at load time — content is fetched and inlined to provide the latest documentation.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.