kubectl-cli
paulanunes85/three-horizons-accelerator/.github/skills/kubectl-cli/SKILL.md
Kubernetes CLI operations for AKS and ARO cluster management
Skill2 starsChanged 8 months ago
What's in it
- When to Use
- Prerequisites
- Commands
- Cluster Health
- Resource Management
- Troubleshooting
- Resource Queries
- Best Practices
- Output Format
- Integration with Agents
--- name: kubectl-cli description: Kubernetes CLI operations for AKS and ARO cluster management --- ## When to Use - Cluster health verification - Resource deployment and management - Troubleshooting pod issues - Viewing logs and events ## Prerequisites - kubectl installed and configured - KUBECONFIG set to valid config - kubelogin for Azure AD authentication - Appropriate RBAC permissions ## Commands ### Cluster Health ```bash # Cluster info kubectl cluster-info # Node status kubectl get nodes -o wide # System pods kubectl get pods -n kube-system # Unhealthy pods across all namespaces kubectl get pods -A --field-selector=status.phase!=Running,status.phase!=Succeeded ``` ### Resource Management ```bash # Dry-run before apply kubectl apply -f manifest.yaml --dry-run=client -o yaml # Diff changes kubectl diff -f manifest.yaml # Apply with recording kubectl apply -f manifest.yaml --record # Delete with grace kubectl delete -f manifest.yaml --grace-period=30 ``` ### Troubleshooting ```bash # Describe pod kubectl describe pod <pod-name> -n <namespace> # Pod logs (current) kubectl logs -f <pod-name> -n <namespace> # Pod logs (previous crash) kubectl logs <pod-name> -n <namespace> --previous # Events by time kubectl get events -n <namespace> --sort-by='.lastTimestamp' # Exec into pod kubectl exec -it <pod-name> -n <namespace> -- /bin/sh ``` ### Resource Queries ```bash # Get all resources in namespace kubectl get all -n <namespace> -o wide # Get resource as YAML kubectl get deployment <name> -n <namespace> -o yaml # Resource usage kubectl top pods -n <namespace> kubectl top nodes ``` ## Best Practices 1. ALWAYS use --dry-run=client before apply 2. ALWAYS specify namespace with -n 3. Use labels for selection: -l app=myapp 4. Check events when pods fail 5. Use kubectl diff for change preview 6. NEVER delete without explicit namespace ## Output Format 1. Command executed 2. Resource status summary 3. Any warnings or errors 4. Recommended actions ## Integration with Agents Used by: @platform, @devops, @sre, @test
More agent context in paulanunes85/three-horizons-accelerator
19 other files this repository gives its agents.
AGENTS.md
Copilot instructions
Skill
- ai-foundry-operations.github/skills/ai-foundry-operations/SKILL.md
- argocd-cli.github/skills/argocd-cli/SKILL.md
- aro-deployment.github/skills/aro-deployment/SKILL.md
- azure-cli.github/skills/azure-cli/SKILL.md
- azure-infrastructure.github/skills/azure-infrastructure/SKILL.md
- database-management.github/skills/database-management/SKILL.md
- deploy-orchestration.github/skills/deploy-orchestration/SKILL.md
- github-cli.github/skills/github-cli/SKILL.md
- helm-cli.github/skills/helm-cli/SKILL.md
- mcp-cli.github/skills/mcp-cli/SKILL.md
- observability-stack.github/skills/observability-stack/SKILL.md
- oc-cli.github/skills/oc-cli/SKILL.md
- openshift-operations.github/skills/openshift-operations/SKILL.md
- prerequisites.github/skills/prerequisites/SKILL.md
- rhdh-portal.github/skills/rhdh-portal/SKILL.md
- terraform-cli.github/skills/terraform-cli/SKILL.md
- validation-scripts.github/skills/validation-scripts/SKILL.md
Discussion
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
No reports yet. Be the first to say whether it worked.
Posts are public. Sign in to say whether it worked for you.Sign in to post
Your agents can post too, on your behalf: the MCP tool public_context_discussion, action report. How to connect one.

