k8s
Deploy, manage, and troubleshoot Kubernetes workloads. Use for manifest review, Helm chart validation, resource tuning, RBAC, and cluster operations.
What this skill does
# Kubernetes Operations
## Current Versions (Verify Before Use)
```bash
kubectl version --client # kubectl version
kubectl version # client + server versions
helm version # Helm version
```
Check [Kubernetes releases](https://kubernetes.io/releases/) for the latest stable and [Helm releases](https://github.com/helm/helm/releases).
## Core Principles
1. **Declarative over imperative.** Use YAML manifests and `kubectl apply`. Avoid `kubectl run`, `kubectl create` for production.
2. **GitOps is the default.** Every manifest change goes through version control and automated sync (ArgoCD, Flux, or similar).
3. **Resource limits are mandatory.** Every container must have `requests` and `limits` for CPU and memory.
4. **Health probes are mandatory.** Every container must have `livenessProbe` and `readinessProbe`.
5. **Least privilege RBAC.** Every ServiceAccount has the minimum permissions required.
## Manifest Review Checklist
### Deployment / Pod Spec
- [ ] Resource `requests` and `limits` defined for all containers
- [ ] `livenessProbe` and `readinessProbe` defined
- [ ] `securityContext` sets `runAsNonRoot: true`, `readOnlyRootFilesystem: true` where possible
- [ ] `imagePullPolicy: Always` or pinned image digest (no implicit `IfNotPresent` with `latest`)
- [ ] `replicas` appropriate for the workload (not hardcoded to 1 for stateless services)
- [ ] `strategy` defined for rolling updates (`RollingUpdate` with `maxUnavailable`/`maxSurge`)
### Service / Ingress
- [ ] Service selector matches Deployment labels exactly
- [ ] Ingress has TLS configured (no plaintext HTTP in production)
- [ ] Ingress paths don't overlap ambiguously
- [ ] Backend service port matches container port
### Config / Secrets
- [ ] Secrets are base64-encoded (not plaintext in YAML)
- [ ] ConfigMaps don't contain sensitive data (use Secrets)
- [ ] Environment variables reference ConfigMaps/Secrets via `valueFrom` (not hardcoded)
### RBAC
- [ ] Role/ClusterRole has explicit verbs and resources (no wildcard `*`)
- [ ] ServiceAccount is explicitly defined (not default)
- [ ] Bindings are scoped to namespaces where possible
## Validation Commands
```bash
# Dry-run before apply
kubectl apply -f manifest.yaml --dry-run=server
# Validate with strict schema
kubectl apply -f manifest.yaml --dry-run=server --validate=strict
# Check resource usage vs limits
kubectl top pods -n <namespace>
kubectl describe node <node-name>
# Audit security posture
kubectl auth can-i --list --as=system:serviceaccount:<ns>:<sa>
# Helm validation
helm lint ./chart
helm template ./chart | kubectl apply --dry-run=server -f -
helm install --dry-run --debug release-name ./chart
```
## Resource Limits Template
```yaml
resources:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "256Mi"
cpu: "500m"
```
**Rules of thumb:**
- `requests` = observed steady-state usage + 20%
- `limits` = observed peak usage + 50%
- Memory limits are hard limits (OOMKill at limit)
- CPU limits are throttled, not killed
## Health Probe Patterns
```yaml
livenessProbe:
httpGet:
path: /health/live
port: 8080
initialDelaySeconds: 10
periodSeconds: 10
failureThreshold: 3
readinessProbe:
httpGet:
path: /health/ready
port: 8080
initialDelaySeconds: 5
periodSeconds: 5
```
- **Liveness:** Is the process alive? If failing, kubelet restarts the container.
- **Readiness:** Is the pod ready to serve traffic? If failing, pod is removed from Service endpoints.
- **Startup:** For slow-starting apps. Disables liveness/readiness until complete.
## Common Anti-Patterns
| Anti-Pattern | Why It's Wrong | Fix |
|---|---|---|
| No resource limits | Noisy neighbor, unpredictable OOMKills | Set `requests` and `limits` |
| `image: myapp:latest` | Non-reproducible deployments | Pin to digest or version tag |
| Running as root | Container escape risk | `securityContext.runAsNonRoot: true` |
| No health probes | Failed containers stay in rotation | `livenessProbe` + `readinessProbe` |
| Wildcard RBAC (`verbs: ["*"]`) | Principle of least privilege violation | Explicit verbs per resource |
| Hardcoding config in YAML | No environment separation | ConfigMaps + Secrets |
| Using default ServiceAccount | No audit trail, overprivileged | Explicit SA per workload |
| No PodDisruptionBudget | Voluntary disruptions cause downtime | Define `minAvailable` or `maxUnavailable` |
## Troubleshooting Flow
1. **Pod stuck Pending:** `kubectl describe pod` → check node resources, taints, PVC binding
2. **Pod CrashLoopBackOff:** `kubectl logs --previous` → check exit code, OOMKilled, application error
3. **Service not reachable:** Check selector match, endpoints (`kubectl get endpoints`), port alignment
4. **Ingress 502/503:** Check backend health, readiness probe, Service port
5. **High memory usage:** `kubectl top pod` → check limits, consider HPA or VPA
6. **RBAC denied:** `kubectl auth can-i <verb> <resource> --as=system:serviceaccount:<ns>:<sa>`
## Helm Best Practices
```yaml
# Chart.yaml
apiVersion: v2
name: myapp
description: A Helm chart for myapp
type: application
version: 1.0.0
appVersion: "2.0.0"
```
- Use `helm lint` in CI
- Template with `helm template` and pipe to `kubectl apply --dry-run=server`
- Store values per environment (`values-prod.yaml`, `values-staging.yaml`)
- Don't put secrets in `values.yaml` — use external secret operators
## Official Resources
- [Kubernetes API reference](https://kubernetes.io/docs/reference/kubernetes-api/)
- [kubectl cheat sheet](https://kubernetes.io/docs/reference/kubectl/cheatsheet/)
- [Helm docs](https://helm.sh/docs/)
- [Pod Security Standards](https://kubernetes.io/docs/concepts/security/pod-security-standards/)
- [RBAC docs](https://kubernetes.io/docs/reference/access-authn-authz/rbac/)
Related in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.