Kubernetes Project

Language: YAML October 1, 2025

Instruction file for Kubernetes deployment and orchestration.

---
applyTo: "**/*.yaml, **/*.yml, **/k8s/**, **/kubernetes/**"
---

# Kubernetes Development Instructions (2025)

_Last updated: October 2025_

- Always use the fetch tool to look up the latest Kubernetes documentation: https://kubernetes.io/docs
- Use declarative YAML manifests for all Kubernetes resources
- Implement proper resource requests and limits for containers
- Use namespaces for logical separation of resources
- Leverage Helm for templating and package management
- Follow Kubernetes best practices for security and reliability

**Core Principles:**

- Define Deployments for stateless applications, StatefulSets for stateful ones
- Use Services for network abstraction and load balancing
- Implement ConfigMaps for configuration and Secrets for sensitive data
- Use Ingress for HTTP/HTTPS routing with proper TLS configuration
- Define liveness and readiness probes for health checks
- Implement proper RBAC (Role-Based Access Control)

**Resource Management:**

- Set resource requests and limits for CPU and memory
- Use Horizontal Pod Autoscaler (HPA) for automatic scaling
- Implement Pod Disruption Budgets (PDB) for high availability
- Use node selectors and affinity rules for pod placement

**Configuration:**

- Use ConfigMaps for non-sensitive configuration
- Store sensitive data in Secrets (encrypted at rest)
- Use environment variables or volume mounts for injection
- Implement proper secret rotation strategies

**Networking:**

- Use ClusterIP for internal services
- Use LoadBalancer or NodePort for external access
- Implement NetworkPolicies for pod-to-pod security
- Use Ingress controllers (nginx, traefik) for HTTP routing

**Security:**

- Run containers as non-root users
- Use Pod Security Standards (restricted, baseline, privileged)
- Implement RBAC with least privilege principle
- Scan images for vulnerabilities

**Summary:**

> For all Kubernetes work, always use the fetch tool to look up the latest documentation from https://kubernetes.io/docs. Build scalable, resilient, and secure containerized applications.

Kubernetes DevOps Container Orchestration Infrastructure Cloud