k8s
Expertise in orchestrating and managing containerized applications at scale using Kubernetes.
What this skill does
# k8s
## Purpose
This skill enables the AI to orchestrate and manage containerized applications using Kubernetes, focusing on scaling, deployment, and maintenance of pods, services, and deployments in a cluster.
## When to Use
Use this skill for deploying multi-container apps, scaling workloads dynamically, managing resources in production environments, or troubleshooting cluster issues. Apply it when handling container orchestration beyond basic Docker, such as in CI/CD pipelines or microservices architectures.
## Key Capabilities
- Deploy and manage pods using YAML manifests or imperative commands.
- Scale applications with deployments and replicasets, e.g., autoscaling based on CPU metrics.
- Expose services via ClusterIP, NodePort, or LoadBalancer types.
- Handle storage with PersistentVolumes and PersistentVolumeClaims.
- Monitor and debug resources using built-in tools like kubectl logs and events.
- Integrate with networking plugins for service discovery and load balancing.
- Manage secrets and config maps for secure configuration.
## Usage Patterns
Always authenticate with a valid kubeconfig file, set via the $KUBECONFIG environment variable. For declarative setups, write YAML files and apply them; for imperative tasks, use kubectl directly. Pattern: Load context with `kubectl config use-context my-context`, then perform actions. Include error checks in scripts, e.g., verify command exit codes.
Example 1: Deploy a simple Nginx pod.
- Create a pod: `kubectl run nginx-pod --image=nginx --port=80`
- Expose it: `kubectl expose pod nginx-pod --type=NodePort --port=80`
- Verify: `kubectl get pods -l run=nginx-pod`
Example 2: Scale a deployment.
- Apply a deployment YAML: `kubectl apply -f deployment.yaml`
- Where deployment.yaml contains: `apiVersion: apps/v1 kind: Deployment metadata: name: my-app spec: replicas: 3 selector: matchLabels: app: my-app template: metadata: labels: app: my-app spec: containers: - name: my-container image: my-image`
- Scale it: `kubectl scale deployment my-app --replicas=5`
- Check status: `kubectl get deployments my-app`
## Common Commands/API
Use kubectl for CLI interactions; for API access, target the Kubernetes API server at endpoints like /api/v1/pods. Always specify namespaces with --namespace flag if needed.
- Get resources: `kubectl get pods --namespace=default -o wide` (flags: -o for output format, --namespace for scope)
- Create resources: `kubectl apply -f pod.yaml --record` (flags: -f for file, --record for history)
- Delete resources: `kubectl delete deployment my-app --cascade=foreground` (flags: --cascade for dependent cleanup)
- Update resources: `kubectl set image deployment/my-app my-container=my-image:new-tag`
- API endpoints: Use curl with authentication, e.g., `curl -k -H "Authorization: Bearer $KUBE_TOKEN" https://api.example.com/api/v1/namespaces/default/pods`
- Config formats: YAML for manifests, e.g., `apiVersion: v1 kind: Pod metadata: name: example spec: containers: - name: example image: nginx`
- Environment setup: Export $KUBECONFIG=/path/to/config for authentication.
## Integration Notes
Integrate Kubernetes with other tools via the Kubernetes API or operators. For authentication, use $KUBECONFIG for kubeconfig files or $KUBE_API_KEY for API tokens. Pattern: In scripts, check if $KUBECONFIG is set; if not, prompt or error out. For CI/CD, use tools like Argo CD or Jenkins plugins; example: Helm charts for packaging, installed via `helm install my-chart ./chart-dir`. Ensure compatibility with cloud providers like AWS EKS by setting provider-specific configs in kubeconfig.
## Error Handling
Always check kubectl exit codes; if non-zero, use `kubectl describe <resource>` for details. Common errors: "NotFound" for missing resources—handle by checking existence first with `kubectl get`; "Forbidden" for permissions—verify RBAC roles. In code, wrap commands in try-catch blocks, e.g., in Python: `import subprocess; try: subprocess.run(['kubectl', 'get', 'pods'], check=True) except subprocess.CalledProcessError as e: print(f"Error: {e}")`. For API calls, handle HTTP errors like 403 or 500 by retrying with exponential backoff. Log events with `kubectl get events --namespace=default` to diagnose issues.
## Graph Relationships
- Related to cluster: devops-sre (e.g., links to other devops skills like CI/CD tools).
- Connected via tags: kubernetes (e.g., relates to container management skills), k8s (synonym for kubernetes), containers (links to Docker or orchestration skills).
- Potential edges: This skill depends on networking and storage skills; it provides outputs for monitoring skills like Prometheus.
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.