Agent skill
k8s-planning
Interactive Kubernetes deployment planning through Q&A-based scenario extraction. Use when users want to design K8s architecture, plan microservice deployments, define manifests, ConfigMaps, Secrets, Services, RBAC, or Network Policies. Guides users through structured decision-making to generate consistent deployment documentation.
Install this agent skill to your Project
npx add-skill https://github.com/alijilani-dev/Claude/tree/main/skills/k8s-planning
SKILL.md
Kubernetes Deployment Planning Skill
This skill provides a structured workflow for guiding users through Kubernetes deployment planning via interactive Q&A. It ensures consistent decision-making and generates comprehensive deployment documentation.
When to Trigger This Skill
Trigger conditions:
- User mentions Kubernetes planning: "plan K8s deployment", "design Kubernetes architecture"
- User mentions manifest planning: "what manifests do I need", "plan my deployments"
- User mentions microservices deployment: "deploy my microservices", "containerize my apps"
- User asks about K8s resources: "ConfigMaps vs Secrets", "which Service type", "RBAC setup"
Workflow Overview
Guide users through 5 stages:
- Application Discovery - Identify all apps, their purpose, and communication patterns
- Manifest Selection - Determine required K8s resource types
- Configuration Planning - Design ConfigMaps and Secrets
- Networking Design - Plan Services, Ingress, and Network Policies
- Access Control - Define RBAC strategy with minimal blast-radius
Stage 1: Application Discovery
Goal
Understand the system architecture before making any K8s decisions.
Questions to Ask
-
App Count & Names: How many applications/microservices need deployment?
-
App Descriptions: For each app, ask:
- What is its primary function?
- Is it stateless or stateful?
- What APIs/endpoints does it expose?
-
Communication Patterns:
- Which apps communicate with each other?
- Are there external service dependencies (databases, LLMs, third-party APIs)?
- Is there a frontend that needs public exposure?
-
Data Requirements:
- Does any app require persistent storage?
- Is there a database? (In-cluster or managed external service?)
Output Table Format
| App | Description | Stateless/Stateful | Endpoints | Communicates With |
|-----|-------------|-------------------|-----------|-------------------|
Stage 2: Manifest Selection
Goal
Determine which Kubernetes resource types are needed based on app characteristics.
Decision Framework
| If App Is... | Use Workload Type | Rationale |
|---|---|---|
| Stateless service | Deployment | Rolling updates, easy scaling |
| Stateful (database) | StatefulSet | Stable network IDs, ordered deployment |
| Node-level daemon | DaemonSet | Runs on every node |
| One-time task | Job | Run to completion |
| Scheduled task | CronJob | Periodic execution |
Questions to Ask
-
Workloads: For each app, confirm workload type based on stateless/stateful nature
-
Networking:
- Does any app need external access? (Ingress needed)
- Should traffic between apps be restricted? (NetworkPolicy needed)
-
Storage:
- Does any app need persistent storage? (PV/PVC needed)
-
Configuration:
- Are there environment-specific configs? (ConfigMap needed)
- Are there sensitive credentials? (Secret needed)
Output Table Format
| Category | Manifest Type | Count | Justification |
|----------|--------------|-------|---------------|
| Workloads | Deployment | X | ... |
| Discovery & Networking | Service | X | ... |
Stage 3: Configuration Planning
Goal
Design ConfigMaps and Secrets with clear separation of concerns.
ConfigMap vs Secret Decision
| Data Type | Resource | Example |
|---|---|---|
| Service URLs | ConfigMap | BACKEND_API_URL=http://backend-svc:8080 |
| Feature flags | ConfigMap | ENABLE_FEATURE_X=true |
| Log levels | ConfigMap | LOG_LEVEL=info |
| API keys | Secret | LLM_API_KEY=sk-xxx |
| Database credentials | Secret | DB_PASSWORD=xxx |
| TLS certificates | Secret (type: kubernetes.io/tls) | tls.crt, tls.key |
| Connection strings with passwords | Secret | DATABASE_URL=postgres://user:pass@host |
Questions to Ask
For each app:
- Non-sensitive config: What environment variables does it need that are NOT sensitive?
- Sensitive config: What credentials, API keys, or secrets does it require?
- Security approach: Should secrets use encryption at rest? (Recommend: Yes)
Output Table Format
ConfigMaps:
| ConfigMap Name | Environment Variables | Justification |
|----------------|----------------------|---------------|
Secrets:
| Secret Name | Data Type | Keys | Security Approach | Justification |
|-------------|-----------|------|-------------------|---------------|
Stage 4: Networking Design
Goal
Design service discovery, external access, and network security.
Service Type Decision Framework
| Scenario | Service Type | Rationale |
|---|---|---|
| Internal-only communication | ClusterIP | Default; no external exposure |
| External access (cloud LB) | LoadBalancer | Direct cloud LB provisioning |
| External access (shared entry) | ClusterIP + Ingress | Centralized TLS, path-based routing |
| Access from outside cluster (dev) | NodePort | Simple but not for production |
| External DNS name | ExternalName | Alias to external service |
Consistency Principle
Default to ClusterIP for all services unless there's a specific justification for external exposure. Use a single Ingress for external access to minimize attack surface.
Questions to Ask
- Service Discovery: Confirm each app needs a Service for discovery
- External Access: Which apps need to be accessible from outside the cluster?
- TLS: Is HTTPS required? (Recommend: Always yes for production)
- Traffic Restriction: Should inter-service traffic be restricted? (NetworkPolicy)
Output Table Format
Services:
| Service Name | Type | Justification |
|--------------|------|---------------|
Ingress:
| Host | Path | Backend Service | Description |
|------|------|-----------------|-------------|
Network Policies:
| Policy Name | Pod Selector | Ingress From | Egress To | Justification |
|-------------|--------------|--------------|-----------|---------------|
Stage 5: Access Control (RBAC)
Goal
Design minimal-privilege access control with small blast-radius.
RBAC vs Alternatives Decision
| Requirement | Solution | When to Use |
|---|---|---|
| Basic pod identity | ServiceAccount only | Apps don't need K8s API access |
| ConfigMap/Secret read | Role + RoleBinding | Apps need to read config |
| Cross-namespace access | ClusterRole + ClusterRoleBinding | Avoid unless absolutely necessary |
| Policy enforcement | OPA/Gatekeeper | Complex policies beyond RBAC |
Blast-Radius Principle
Always prefer namespace-scoped (Role) over cluster-scoped (ClusterRole). Each app should have its own ServiceAccount with only the permissions it needs.
Questions to Ask
- K8s API Access: Does any app need to interact with the Kubernetes API?
- Config Reading: Do apps read ConfigMaps/Secrets at runtime via K8s API (vs mounted volumes)?
- Cross-Namespace: Does any app need access to resources in other namespaces?
Output Table Format
RBAC Artifacts:
| Type | Name | Scope | Justification |
|------|------|-------|---------------|
| ServiceAccount | xxx-sa | Namespace | ... |
| Role | xxx-role | Namespace | ... |
| RoleBinding | xxx-rb | Namespace | ... |
Role Permissions:
| Resource | Verbs | Justification |
|----------|-------|---------------|
Final Output: Plan Document
After completing all stages, generate a comprehensive Plan.md with:
- Design Principles Table - Summary of consistency decisions
- Application Architecture - Apps overview + API endpoints
- Manifest Types - Required K8s resources by category
- ConfigMaps - Names, env vars, justifications
- Secrets - Names, data types, security approach
- Deployments - Names with purpose
- Services - Names, types, justifications
- Ingress Configuration - Routing rules
- RBAC Artifacts - ServiceAccounts, Roles, RoleBindings
- Network Policies - Traffic restriction rules
- Communication Flow Diagram - ASCII diagram of architecture
Consistency Guidelines
Ensure these principles are applied consistently throughout planning:
| Principle | Default Decision |
|---|---|
| Internal Communication | ClusterIP |
| External Exposure | Single Ingress |
| Secrets Management | K8s Secrets + encryption at rest |
| RBAC Scope | Namespace-scoped (Role/RoleBinding) |
| Workload Type | Deployment (unless stateful) |
| Namespace Strategy | Single namespace per application domain |
Example Interaction
User: I want to deploy a task management app with a frontend, backend API, and an AI agent.
Assistant: Let me help you plan the Kubernetes deployment. I'll guide you through 5 stages to ensure consistent decisions.
Stage 1: Application Discovery
I see you have 3 apps. Let me ask a few questions:
- Is the frontend a static site or a server-rendered app?
- Does the backend need a database?
- Does the AI agent connect to an external LLM provider?
- Which apps communicate with each other?
[Continue through all 5 stages...]
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
docker-rocker
Production-grade Docker containerization for FastAPI, Pytest, SQLModel, and Pydantic projects. This skill should be used when users ask to dockerize FastAPI applications, create multi-stage Docker builds, optimize Docker images for Python APIs, set up CI/CD Docker pipelines, or deploy containerized Python web APIs with maximum performance and minimal image size.
fastapi-helper
FastAPI development assistant for building modern Python web APIs. Provides guidance on routing, request/response handling, dependency injection, authentication, middleware, WebSockets, testing, and Pydantic models. Use when: (1) Creating FastAPI applications or endpoints, (2) Implementing CRUD operations, (3) Setting up authentication/authorization, (4) Working with request parameters (path, query, body, headers, cookies, forms, files), (5) Configuring middleware or CORS, (6) Implementing WebSocket connections, (7) Writing tests for FastAPI apps, (8) Defining Pydantic models for validation.
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.
internal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).
cover-letter-generator
Generate tailored AI-focused cover letters using the PSI (Problem-Solution-Impact) methodology. Use when: (1) User wants to create cover letters for AI/ML job applications, (2) User provides a resume and wants LinkedIn job matching, (3) User asks for personalized cover letters based on job postings, (4) User mentions applying for AI Engineer, ML Engineer, or similar technical roles. Integrates market intelligence, LinkedIn research via Playwright, and professional writing standards.
skill-validator
Validates skills against production-level criteria with 9-category scoring. This skill should be used when reviewing, auditing, or improving skills to ensure quality standards. Evaluates structure, content, user interaction, documentation, domain standards, technical robustness, maintainability, zero-shot implementation, and reusability. Returns actionable validation report with scores and improvement recommendations.
Didn't find tool you were looking for?