Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Deploy and manage Kubernetes workloads: manifests, RBAC, Helm charts, service mesh, GitOps, and troubleshooting.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
SKILL.md
1---2name: kubernetes-specialist3description: Use when deploying or managing Kubernetes workloads. Invoke to create deployment manifests, configure pod security policies, set up service accounts, define network isolation rules, debug pod crashes, analyze resource limits, inspect container logs, or right-size workloads. Use for Helm charts, RBAC policies, NetworkPolicies, storage configuration, performance optimization, GitOps pipelines, and multi-cluster management.4license: MIT5metadata:6author: https://github.com/Jeffallan7version: "1.1.1"8domain: infrastructure9triggers: Kubernetes, K8s, kubectl, Helm, container orchestration, pod deployment, RBAC, NetworkPolicy, Ingress, StatefulSet, Operator, CRD, CustomResourceDefinition, ArgoCD, Flux, GitOps, Istio, Linkerd, service mesh, multi-cluster, cost optimization, VPA, spot instances10role: specialist11scope: infrastructure12output-format: manifests13related-skills: devops-engineer, cloud-architect, sre-engineer, terraform-engineer, security-reviewer, chaos-engineer14---1516# Kubernetes Specialist1718## When to Use This Skill1920- Deploying workloads (Deployments, StatefulSets, DaemonSets, Jobs)21- Configuring networking (Services, Ingress, NetworkPolicies)22- Managing configuration (ConfigMaps, Secrets, environment variables)23- Setting up persistent storage (PV, PVC, StorageClasses)24- Creating Helm charts for application packaging25- Troubleshooting cluster and workload issues26- Implementing security best practices2728## Core Workflow29301. **Analyze requirements** — Understand workload characteristics, scaling needs, security requirements312. **Design architecture** — Choose workload types, networking patterns, storage solutions323. **Implement manifests** — Create declarative YAML with proper resource limits, health checks334. **Secure** — Apply RBAC, NetworkPolicies, Pod Security Standards, least privilege345. **Validate** — Run `kubectl rollout status`, `kubectl get pods -w`, and `kubectl describe pod <name>` to confirm health; roll back with `kubectl rollout undo` if needed3536## Reference Guide3738Load detailed guidance based on context:3940| Topic | Reference | Load When |41|-------|-----------|-----------|42| Workloads | `references/workloads.md` | Deployments, StatefulSets, DaemonSets, Jobs, CronJobs |43| Networking | `references/networking.md` | Services, Ingress, NetworkPolicies, DNS |44| Configuration | `references/configuration.md` | ConfigMaps, Secrets, environment variables |45| Storage | `references/storage.md` | PV, PVC, StorageClasses, CSI drivers |46| Helm Charts | `references/helm-charts.md` | Chart structure, values, templates, hooks, testing, repositories |47| Troubleshooting | `references/troubleshooting.md` | kubectl debug, logs, events, common issues |48| Custom Operators | `references/custom-operators.md` | CRD, Operator SDK, controller-runtime, reconciliation |49| Service Mesh | `references/service-mesh.md` | Istio, Linkerd, traffic management, mTLS, canary |50| GitOps | `references/gitops.md` | ArgoCD, Flux, progressive delivery, sealed secrets |51| Cost Optimization | `references/cost-optimization.md` | VPA, HPA tuning, spot instances, quotas, right-sizing |52| Multi-Cluster | `references/multi-cluster.md` | Cluster API, federation, cross-cluster networking, DR |5354## Constraints5556### MUST DO57- Use declarative YAML manifests (avoid imperative kubectl commands)58- Set resource requests and limits on all containers59- Include liveness and readiness probes60- Use secrets for sensitive data (never hardcode credentials)61- Apply least privilege RBAC permissions62- Implement NetworkPolicies for network segmentation63- Use namespaces for logical isolation64- Label resources consistently for organization65- Document configuration decisions in annotations6667### MUST NOT DO68- Deploy to production without resource limits69- Store secrets in ConfigMaps or as plain environment variables70- Use default ServiceAccount for application pods71- Allow unrestricted network access (default allow-all)72- Run containers as root without justification73- Skip health checks (liveness/readiness probes)74- Use latest tag for production images75- Expose unnecessary ports or services7677## Common YAML Patterns7879### Deployment with resource limits, probes, and security context8081```yaml82apiVersion: apps/v183kind: Deployment84metadata:85name: my-app86namespace: my-namespace87labels:88app: my-app89version: "1.2.3"90spec:91replicas: 392selector:93matchLabels:94app: my-app95template:96metadata:97labels:98app: my-app99version: "1.2.3"100spec:101serviceAccountName: my-app-sa # never use default SA102securityContext:103runAsNonRoot: true104runAsUser: 1000105fsGroup: 2000106containers:107- name: my-app108image: my-registry/my-app:1.2.3 # never use latest109ports:110- containerPort: 8080111resources:112requests:113cpu: "100m"114memory: "128Mi"115limits:116cpu: "500m"117memory: "512Mi"118livenessProbe:119httpGet:120path: /healthz121port: 8080122initialDelaySeconds: 15123periodSeconds: 20124readinessProbe:125httpGet:126path: /ready127port: 8080128initialDelaySeconds: 5129periodSeconds: 10130securityContext:131allowPrivilegeEscalation: false132readOnlyRootFilesystem: true133capabilities:134drop: ["ALL"]135envFrom:136- secretRef:137name: my-app-secret # pull credentials from Secret, not ConfigMap138```139140### Minimal RBAC (least privilege)141142```yaml143apiVersion: v1144kind: ServiceAccount145metadata:146name: my-app-sa147namespace: my-namespace148---149apiVersion: rbac.authorization.k8s.io/v1150kind: Role151metadata:152name: my-app-role153namespace: my-namespace154rules:155- apiGroups: [""]156resources: ["configmaps"]157verbs: ["get", "list"] # grant only what is needed158---159apiVersion: rbac.authorization.k8s.io/v1160kind: RoleBinding161metadata:162name: my-app-rolebinding163namespace: my-namespace164subjects:165- kind: ServiceAccount166name: my-app-sa167namespace: my-namespace168roleRef:169kind: Role170name: my-app-role171apiGroup: rbac.authorization.k8s.io172```173174### NetworkPolicy (default-deny + explicit allow)175176```yaml177# Deny all ingress and egress by default178apiVersion: networking.k8s.io/v1179kind: NetworkPolicy180metadata:181name: default-deny-all182namespace: my-namespace183spec:184podSelector: {}185policyTypes: ["Ingress", "Egress"]186---187# Allow only specific traffic188apiVersion: networking.k8s.io/v1189kind: NetworkPolicy190metadata:191name: allow-my-app192namespace: my-namespace193spec:194podSelector:195matchLabels:196app: my-app197policyTypes: ["Ingress"]198ingress:199- from:200- podSelector:201matchLabels:202app: frontend203ports:204- protocol: TCP205port: 8080206```207208## Validation Commands209210After deploying, verify health and security posture:211212```bash213# Watch rollout complete214kubectl rollout status deployment/my-app -n my-namespace215216# Stream pod events to catch crash loops or image pull errors217kubectl get pods -n my-namespace -w218219# Inspect a specific pod for failures220kubectl describe pod <pod-name> -n my-namespace221222# Check container logs223kubectl logs <pod-name> -n my-namespace --previous # use --previous for crashed containers224225# Verify resource usage vs. limits226kubectl top pods -n my-namespace227228# Audit RBAC permissions for a service account229kubectl auth can-i --list --as=system:serviceaccount:my-namespace:my-app-sa230231# Roll back a failed deployment232kubectl rollout undo deployment/my-app -n my-namespace233```234235## Output Templates236237When implementing Kubernetes resources, provide:2381. Complete YAML manifests with proper structure2392. RBAC configuration if needed (ServiceAccount, Role, RoleBinding)2403. NetworkPolicy for network isolation2414. Brief explanation of design decisions and security considerations242243[Documentation](https://jeffallan.github.io/claude-skills/skills/infrastructure/kubernetes-specialist/)244