Kubernetes Specialist
When to Use This Skill
- Deploying workloads (Deployments, StatefulSets, DaemonSets, Jobs)
- Configuring networking (Services, Ingress, NetworkPolicies)
- Managing configuration (ConfigMaps, Secrets, environment variables)
- Setting up persistent storage (PV, PVC, StorageClasses)
- Creating Helm charts for application packaging
- Troubleshooting cluster and workload issues
- Implementing security best practices
Core Workflow
- Analyze requirements — Understand workload characteristics, scaling needs, security requirements
- Design architecture — Choose workload types, networking patterns, storage solutions
- Implement manifests — Create declarative YAML with proper resource limits, health checks
- Secure — Apply RBAC, NetworkPolicies, Pod Security Standards, least privilege
- Validate — Run
kubectl rollout status, kubectl get pods -w, and kubectl describe pod <name> to confirm health; roll back with kubectl rollout undo if needed
Reference Guide
Load detailed guidance based on context:
| Topic |
Reference |
Load When |
| Workloads |
references/workloads.md |
Deployments, StatefulSets, DaemonSets, Jobs, CronJobs |
| Networking |
references/networking.md |
Services, Ingress, NetworkPolicies, DNS |
| Configuration |
references/configuration.md |
ConfigMaps, Secrets, environment variables |
| Storage |
references/storage.md |
PV, PVC, StorageClasses, CSI drivers |
| Helm Charts |
references/helm-charts.md |
Chart structure, values, templates, hooks, testing, repositories |
| Troubleshooting |
references/troubleshooting.md |
kubectl debug, logs, events, common issues |
| Custom Operators |
references/custom-operators.md |
CRD, Operator SDK, controller-runtime, reconciliation |
| Service Mesh |
references/service-mesh.md |
Istio, Linkerd, traffic management, mTLS, canary |
| GitOps |
references/gitops.md |
ArgoCD, Flux, progressive delivery, sealed secrets |
| Cost Optimization |
references/cost-optimization.md |
VPA, HPA tuning, spot instances, quotas, right-sizing |
| Multi-Cluster |
references/multi-cluster.md |
Cluster API, federation, cross-cluster networking, DR |
Constraints
MUST DO
- Use declarative YAML manifests (avoid imperative kubectl commands)
- Set resource requests and limits on all containers
- Include liveness and readiness probes
- Use secrets for sensitive data (never hardcode credentials)
- Apply least privilege RBAC permissions
- Implement NetworkPolicies for network segmentation
- Use namespaces for logical isolation
- Label resources consistently for organization
- Document configuration decisions in annotations
MUST NOT DO
- Deploy to production without resource limits
- Store secrets in ConfigMaps or as plain environment variables
- Use default ServiceAccount for application pods
- Allow unrestricted network access (default allow-all)
- Run containers as root without justification
- Skip health checks (liveness/readiness probes)
- Use latest tag for production images
- Expose unnecessary ports or services
Common YAML Patterns
Deployment with resource limits, probes, and security context
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
namespace: my-namespace
labels:
app: my-app
version: "1.2.3"
spec:
replicas: 3
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
version: "1.2.3"
spec:
serviceAccountName: my-app-sa # never use default SA
securityContext:
runAsNonRoot: true
runAsUser: 1000
fsGroup: 2000
containers:
- name: my-app
image: my-registry/my-app:1.2.3 # never use latest
ports:
- containerPort: 8080
resources:
requests:
cpu: "100m"
memory: "128Mi"
limits:
cpu: "500m"
memory: "512Mi"
livenessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
httpGet:
path: /ready
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: ["ALL"]
envFrom:
- secretRef:
name: my-app-secret # pull credentials from Secret, not ConfigMap
Minimal RBAC (least privilege)
apiVersion: v1
kind: ServiceAccount
metadata:
name: my-app-sa
namespace: my-namespace
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: my-app-role
namespace: my-namespace
rules:
- apiGroups: [""]
resources: ["configmaps"]
verbs: ["get", "list"] # grant only what is needed
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: my-app-rolebinding
namespace: my-namespace
subjects:
- kind: ServiceAccount
name: my-app-sa
namespace: my-namespace
roleRef:
kind: Role
name: my-app-role
apiGroup: rbac.authorization.k8s.io
NetworkPolicy (default-deny + explicit allow)
# Deny all ingress and egress by default
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny-all
namespace: my-namespace
spec:
podSelector: {}
policyTypes: ["Ingress", "Egress"]
---
# Allow only specific traffic
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-my-app
namespace: my-namespace
spec:
podSelector:
matchLabels:
app: my-app
policyTypes: ["Ingress"]
ingress:
- from:
- podSelector:
matchLabels:
app: frontend
ports:
- protocol: TCP
port: 8080
Validation Commands
After deploying, verify health and security posture:
# Watch rollout complete
kubectl rollout status deployment/my-app -n my-namespace
# Stream pod events to catch crash loops or image pull errors
kubectl get pods -n my-namespace -w
# Inspect a specific pod for failures
kubectl describe pod <pod-name> -n my-namespace
# Check container logs
kubectl logs <pod-name> -n my-namespace --previous # use --previous for crashed containers
# Verify resource usage vs. limits
kubectl top pods -n my-namespace
# Audit RBAC permissions for a service account
kubectl auth can-i --list --as=system:serviceaccount:my-namespace:my-app-sa
# Roll back a failed deployment
kubectl rollout undo deployment/my-app -n my-namespace
Output Templates
When implementing Kubernetes resources, provide:
- Complete YAML manifests with proper structure
- RBAC configuration if needed (ServiceAccount, Role, RoleBinding)
- NetworkPolicy for network isolation
- Brief explanation of design decisions and security considerations
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: MIT5---67# Kubernetes Specialist89## When to Use This Skill1011- Deploying workloads (Deployments, StatefulSets, DaemonSets, Jobs)12- Configuring networking (Services, Ingress, NetworkPolicies)13- Managing configuration (ConfigMaps, Secrets, environment variables)14- Setting up persistent storage (PV, PVC, StorageClasses)15- Creating Helm charts for application packaging16- Troubleshooting cluster and workload issues17- Implementing security best practices1819## Core Workflow20211. **Analyze requirements** — Understand workload characteristics, scaling needs, security requirements222. **Design architecture** — Choose workload types, networking patterns, storage solutions233. **Implement manifests** — Create declarative YAML with proper resource limits, health checks244. **Secure** — Apply RBAC, NetworkPolicies, Pod Security Standards, least privilege255. **Validate** — Run `kubectl rollout status`, `kubectl get pods -w`, and `kubectl describe pod <name>` to confirm health; roll back with `kubectl rollout undo` if needed2627## Reference Guide2829Load detailed guidance based on context:3031| Topic | Reference | Load When |32| ----------------- | --------------------------------- | ---------------------------------------------------------------- |33| Workloads | `references/workloads.md` | Deployments, StatefulSets, DaemonSets, Jobs, CronJobs |34| Networking | `references/networking.md` | Services, Ingress, NetworkPolicies, DNS |35| Configuration | `references/configuration.md` | ConfigMaps, Secrets, environment variables |36| Storage | `references/storage.md` | PV, PVC, StorageClasses, CSI drivers |37| Helm Charts | `references/helm-charts.md` | Chart structure, values, templates, hooks, testing, repositories |38| Troubleshooting | `references/troubleshooting.md` | kubectl debug, logs, events, common issues |39| Custom Operators | `references/custom-operators.md` | CRD, Operator SDK, controller-runtime, reconciliation |40| Service Mesh | `references/service-mesh.md` | Istio, Linkerd, traffic management, mTLS, canary |41| GitOps | `references/gitops.md` | ArgoCD, Flux, progressive delivery, sealed secrets |42| Cost Optimization | `references/cost-optimization.md` | VPA, HPA tuning, spot instances, quotas, right-sizing |43| Multi-Cluster | `references/multi-cluster.md` | Cluster API, federation, cross-cluster networking, DR |4445## Constraints4647### MUST DO4849- Use declarative YAML manifests (avoid imperative kubectl commands)50- Set resource requests and limits on all containers51- Include liveness and readiness probes52- Use secrets for sensitive data (never hardcode credentials)53- Apply least privilege RBAC permissions54- Implement NetworkPolicies for network segmentation55- Use namespaces for logical isolation56- Label resources consistently for organization57- Document configuration decisions in annotations5859### MUST NOT DO6061- Deploy to production without resource limits62- Store secrets in ConfigMaps or as plain environment variables63- Use default ServiceAccount for application pods64- Allow unrestricted network access (default allow-all)65- Run containers as root without justification66- Skip health checks (liveness/readiness probes)67- Use latest tag for production images68- Expose unnecessary ports or services6970## Common YAML Patterns7172### Deployment with resource limits, probes, and security context7374```yaml75apiVersion: apps/v176kind: Deployment77metadata:78 name: my-app79 namespace: my-namespace80 labels:81 app: my-app82 version: "1.2.3"83spec:84 replicas: 385 selector:86 matchLabels:87 app: my-app88 template:89 metadata:90 labels:91 app: my-app92 version: "1.2.3"93 spec:94 serviceAccountName: my-app-sa # never use default SA95 securityContext:96 runAsNonRoot: true97 runAsUser: 100098 fsGroup: 200099 containers:100 - name: my-app101 image: my-registry/my-app:1.2.3 # never use latest102 ports:103 - containerPort: 8080104 resources:105 requests:106 cpu: "100m"107 memory: "128Mi"108 limits:109 cpu: "500m"110 memory: "512Mi"111 livenessProbe:112 httpGet:113 path: /healthz114 port: 8080115 initialDelaySeconds: 15116 periodSeconds: 20117 readinessProbe:118 httpGet:119 path: /ready120 port: 8080121 initialDelaySeconds: 5122 periodSeconds: 10123 securityContext:124 allowPrivilegeEscalation: false125 readOnlyRootFilesystem: true126 capabilities:127 drop: ["ALL"]128 envFrom:129 - secretRef:130 name: my-app-secret # pull credentials from Secret, not ConfigMap131```132133### Minimal RBAC (least privilege)134135```yaml136apiVersion: v1137kind: ServiceAccount138metadata:139 name: my-app-sa140 namespace: my-namespace141---142apiVersion: rbac.authorization.k8s.io/v1143kind: Role144metadata:145 name: my-app-role146 namespace: my-namespace147rules:148 - apiGroups: [""]149 resources: ["configmaps"]150 verbs: ["get", "list"] # grant only what is needed151---152apiVersion: rbac.authorization.k8s.io/v1153kind: RoleBinding154metadata:155 name: my-app-rolebinding156 namespace: my-namespace157subjects:158 - kind: ServiceAccount159 name: my-app-sa160 namespace: my-namespace161roleRef:162 kind: Role163 name: my-app-role164 apiGroup: rbac.authorization.k8s.io165```166167### NetworkPolicy (default-deny + explicit allow)168169```yaml170# Deny all ingress and egress by default171apiVersion: networking.k8s.io/v1172kind: NetworkPolicy173metadata:174 name: default-deny-all175 namespace: my-namespace176spec:177 podSelector: {}178 policyTypes: ["Ingress", "Egress"]179---180# Allow only specific traffic181apiVersion: networking.k8s.io/v1182kind: NetworkPolicy183metadata:184 name: allow-my-app185 namespace: my-namespace186spec:187 podSelector:188 matchLabels:189 app: my-app190 policyTypes: ["Ingress"]191 ingress:192 - from:193 - podSelector:194 matchLabels:195 app: frontend196 ports:197 - protocol: TCP198 port: 8080199```200201## Validation Commands202203After deploying, verify health and security posture:204205```bash206# Watch rollout complete207kubectl rollout status deployment/my-app -n my-namespace208209# Stream pod events to catch crash loops or image pull errors210kubectl get pods -n my-namespace -w211212# Inspect a specific pod for failures213kubectl describe pod <pod-name> -n my-namespace214215# Check container logs216kubectl logs <pod-name> -n my-namespace --previous # use --previous for crashed containers217218# Verify resource usage vs. limits219kubectl top pods -n my-namespace220221# Audit RBAC permissions for a service account222kubectl auth can-i --list --as=system:serviceaccount:my-namespace:my-app-sa223224# Roll back a failed deployment225kubectl rollout undo deployment/my-app -n my-namespace226```227228## Output Templates229230When implementing Kubernetes resources, provide:2312321. Complete YAML manifests with proper structure2332. RBAC configuration if needed (ServiceAccount, Role, RoleBinding)2343. NetworkPolicy for network isolation2354. Brief explanation of design decisions and security considerations