Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

kubectl-helper

БесплатноБез исполняемых скриптовНе проверен

Kubernetes troubleshooting and resource management with kubectl When user works with Kubernetes, mentions kubectl, pods, deployments, or k8s errors

shepherdjerredот shepherdjerred★ 85 звёзд на GitHub

Об этом скилле

Kubernetes Helper Agent

What's New in Kubernetes 1.33 & 2025

  • Server-Side Apply: Recommended default for applying manifests (better conflict resolution)
  • Server-Side Dry Run: Full API validation before applying changes
  • kubectl diff: Preview changes before applying
  • Containerd Default: containerd is now the default runtime (Docker deprecated)
  • Enhanced Label Selectors: More powerful filtering and bulk operations
  • Rollout Control: Better manual control with kubectl rollout pause

Overview

This agent helps you work with Kubernetes clusters using kubectl for resource management, troubleshooting, and debugging.

CLI Commands

Auto-Approved Commands

The following kubectl commands are auto-approved and safe to use:

  • kubectl get - List resources
  • kubectl describe - Show detailed resource information
  • kubectl logs - View container logs
  • kubectl explain - Show resource documentation
  • kubectl api-resources - List available resource types
  • kubectl version - Show version information
  • kubectl cluster-info - Display cluster information
  • kubectl config - Manage kubeconfig
  • kubectl top - Show resource usage

Modern Apply Patterns (2025)

Server-side apply (recommended):

# Apply with server-side processing (better conflict resolution)
kubectl apply -f deployment.yaml --server-side

# Apply directory recursively
kubectl apply -f ./configs/ --server-side --recursive

# Force conflicts to be resolved server-side
kubectl apply -f deployment.yaml --server-side --force-conflicts

Preview changes before applying:

# Show diff of what will change
kubectl diff -f deployment.yaml

# Dry run with full server-side validation
kubectl apply -f deployment.yaml --dry-run=server

# Client-side dry run (no server validation)
kubectl apply -f deployment.yaml --dry-run=client

Why server-side apply?

  • Better conflict resolution (server decides, not client)
  • Supports collaborative editing (multiple sources can manage same resource)
  • Respects field ownership (who owns each field)
  • Required for some newer Kubernetes features

Common Operations

Get resources:

kubectl get pods
kubectl get pods -n production
kubectl get deployments --all-namespaces
kubectl get nodes
kubectl get services

Advanced label selectors (2025):

# Single label match
kubectl get pods -l app=nginx

# Multiple labels (AND)
kubectl get pods -l app=nginx,env=production

# Set-based selectors
kubectl get pods -l 'env in (production,staging)'
kubectl get pods -l 'tier notin (frontend,backend)'

# Exists/not exists
kubectl get pods -l 'release'  # has 'release' label
kubectl get pods -l '!release'  # doesn't have 'release' label

# Bulk operations with labels
kubectl delete pods -l phase=test
kubectl scale deployment -l app=api --replicas=3

Describe resources:

kubectl describe pod my-pod
kubectl describe node node-1
kubectl describe deployment my-app

View logs:

kubectl logs my-pod
kubectl logs my-pod -c container-name
kubectl logs -f my-pod  # Follow logs
kubectl logs my-pod --previous  # Previous container logs
kubectl logs -l app=nginx  # Logs from all pods with label

Context and namespace management:

kubectl config get-contexts
kubectl config current-context
kubectl config use-context production
kubectl config set-context --current --namespace=my-namespace

Rollout management and canary deployments:

# View rollout status
kubectl rollout status deployment/my-app

# Pause rollout for manual canary analysis
kubectl rollout pause deployment/my-app

# After validation, resume rollout
kubectl rollout resume deployment/my-app

# Rollback if issues found
kubectl rollout undo deployment/my-app

# View rollout history
kubectl rollout history deployment/my-app

# Rollback to specific revision
kubectl rollout undo deployment/my-app --to-revision=2

Canary deployment workflow:

# 1. Update deployment (triggers rollout)
kubectl apply -f deployment.yaml --server-side

# 2. Immediately pause to control rollout
kubectl rollout pause deployment/my-app

# 3. New pods start alongside old pods (manual canary)
kubectl get pods -l app=my-app -L version

# 4. Monitor metrics, test new version
# ... check logs, metrics, error rates ...

# 5. If good, resume full rollout
kubectl rollout resume deployment/my-app

# 6. If bad, rollback
kubectl rollout undo deployment/my-app

Troubleshooting Workflows

Pod Not Starting

# 1. Check pod status
kubectl get pod my-pod -o wide

# 2. Describe pod to see events
kubectl describe pod my-pod

# 3. Check logs
kubectl logs my-pod

# 4. Check previous container logs if crash looping
kubectl logs my-pod --previous

# 5. Check events in namespace
kubectl get events --sort-by='.lastTimestamp' | grep my-pod

Debugging Running Pod

# Execute commands in pod
kubectl exec -it my-pod -- sh
kubectl e
Полный SKILL.md на GitHub

Установить kubectl-helper в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл kubectl-helper?

Kubernetes troubleshooting and resource management with kubectl When user works with Kubernetes, mentions kubectl, pods, deployments, or k8s errors

Как установить скилл kubectl-helper?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл kubectl-helper запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить kubectl-helper с