New advertisers: 50% off your first month with code FIRSTMONTHSee slots
laurigates avatar

kubernetes-plugin

Kubernetes and Helm skills plus context-safety hooks for deployments, charts, and releases.

version
1.10.4
GitHub stars
60
View on GitHub

What it does

  • Adds k8s-diagnostics agent and skills for kubectl debugging, Kubernetes operations, and ArgoCD CLI SSO login
  • Covers Helm chart development, release management, failed-release recovery, and multi-environment values handling
  • Enforces explicit cluster context via a validate-kubectl-context.sh hook on kubectl, helm, and skaffold commands
  • Adds an inject-kubectl-dry-run.sh hook that rewrites lone kubectl apply, delete, or patch commands to run as dry runs first

Add marketplace

/plugin marketplace add laurigates/claude-plugins

Run it inside Claude Code once, then install the plugin below.

Install

/plugin install kubernetes-plugin@laurigates-claude-plugins

Run it inside Claude Code after adding the marketplace.

Files

Discovered from source

ArgoCD CLI Login

ArgoCD CLI authentication with SSO for the Data Portal cluster.

When to Use This Skill

Use this skill when...Use kubernetes-operations instead when...
Authenticating to ArgoCD CLI via SSOWorking directly with kubectl against the cluster
Resolving ArgoCD CLI auth errors before running argocd commandsInspecting Kubernetes workloads without going through ArgoCD
Setting up gRPC-Web access to argocd.dataportal.fiUsing kubectl-debugging to debug a specific pod or node

When to Use

Use this skill automatically when:

  • User requests ArgoCD login or authentication
  • User mentions accessing ArgoCD cluster or applications
  • User needs to interact with ArgoCD CLI tools
  • Authentication errors occur when using ArgoCD commands

Authentication Command

argocd login argocd.dataportal.fi --grpc-web --sso

Command Breakdown

  • argocd.dataportal.fi - Data Portal ArgoCD server endpoint
  • --grpc-web - Enable gRPC-Web protocol (required for web-based SSO)
  • --sso - Use Single Sign-On authentication (opens browser for OAuth2 flow)

Usage Flow

  1. Detect authentication need:

    • User explicitly requests login
    • ArgoCD command fails with authentication error
    • User mentions accessing ArgoCD cluster
  2. Execute login command:

    argocd login argocd.dataportal.fi --grpc-web --sso
    
  3. Guide user through SSO:

    • Command will open browser automatically
    • User completes SSO authentication in browser
    • CLI receives token upon successful authentication
    • Session is stored in ~/.config/argocd/config
  4. Verify authentication:

    argocd account get-user-info
    

Common ArgoCD Operations (Post-Login)

Application Management

# List applications
argocd app list

# Get application details
argocd app get <app-name>

# Sync application
argocd app sync <app-name>

# View application resources
argocd app resources <app-name>

Cluster Information

# List clusters
argocd cluster list

# Get cluster info
argocd cluster get <cluster-name>

Project Management

# List projects
argocd proj list

# Get project details
argocd proj get <project-name>

Authentication Session

  • Session storage: ~/.config/argocd/config
  • Session persistence: Tokens have configurable expiration
  • Re-authentication: Run login command again when session expires

Troubleshooting

Browser doesn't open

  • Manually open the URL printed by the CLI
  • Complete authentication in browser
  • Token will be received by CLI

gRPC-Web errors

  • Ensure --grpc-web flag is present
  • Check network connectivity to argocd.dataportal.fi
  • Verify firewall/proxy settings allow gRPC-Web traffic

SSO failures

  • Verify SSO provider is accessible
  • Check browser for authentication prompts
  • Ensure popup blockers aren't interfering
  • Try incognito/private browsing mode

Token expiration

  • Re-run login command: argocd login argocd.dataportal.fi --grpc-web --sso
  • Check token validity: argocd account get-user-info

Integration with ArgoCD MCP

This skill complements the ArgoCD MCP server tools:

  • MCP tools (mcp__argocd-mcp__*) require authenticated CLI session
  • Use this skill to establish authentication before MCP operations
  • Both use same configuration (~/.config/argocd/config)

Security Considerations

  • Token storage: CLI tokens stored locally in config file
  • Token scope: Full ArgoCD access (read/write based on RBAC)
  • Token rotation: Re-authenticate periodically for security
  • Shared sessions: CLI and MCP share authentication state

Example Interaction

User: "I need to check the status of my ArgoCD applications"

Claude: I'll log you into ArgoCD first, then check the application status.

[Executes: argocd login argocd.dataportal.fi --grpc-web --sso]

Please complete the SSO authentication in the browser that just opened.
Once authenticated, I'll retrieve your application list.

[After successful auth, executes: argocd app list]

Here are your applications:
...

Related Skills

  • Kubernetes Operations - For kubectl operations on ArgoCD-managed resources
  • GitHub Actions Inspection - For CI/CD pipeline integration with ArgoCD
  • Infrastructure Terraform - For infrastructure managed by ArgoCD applications

References

Readme

Kubernetes Plugin

Comprehensive Kubernetes and Helm operations plugin for Claude Code, providing expert knowledge for K8s cluster management, Helm chart development, and GitOps with ArgoCD.

Overview

This plugin bundles all Kubernetes-related skills for managing cloud-native applications, including:

  • Kubernetes cluster operations and debugging
  • Helm chart development, testing, and packaging
  • Helm release management and recovery
  • Values configuration across environments
  • ArgoCD CLI authentication

Skills Included

Kubernetes Operations

File: skills/kubernetes-operations/SKILL.md

Core Kubernetes cluster management, deployment, and troubleshooting with kubectl mastery.

When to use: User mentions Kubernetes, K8s, kubectl, pods, deployments, services, ingress, ConfigMaps, Secrets, or cluster operations.

Capabilities:

  • Workload management (Deployments, StatefulSets, DaemonSets, Jobs, CronJobs)
  • Networking (Services, Ingress, NetworkPolicies, DNS)
  • Configuration & Storage (ConfigMaps, Secrets, PVs, PVCs)
  • Pod debugging and troubleshooting
  • Context safety (explicit --context usage)

Reference: Includes comprehensive REFERENCE.md with complete kubectl command reference and troubleshooting guides.


Helm Chart Development

File: skills/helm-chart-development/SKILL.md

Create, test, and package Helm charts for Kubernetes applications.

When to use: User wants to create Helm charts, test templates, package charts, or publish to repositories.

Capabilities:

  • Chart scaffolding with helm create
  • Chart.yaml and values.yaml design
  • Template development with best practices
  • Chart validation and testing (lint, template, dry-run)
  • Chart dependencies management
  • Schema validation with values.schema.json
  • Chart packaging and distribution

Helm Debugging

File: skills/helm-debugging/SKILL.md

Debug and troubleshoot Helm deployment failures, template errors, and configuration issues.

When to use: User reports Helm errors, deployment failures, template rendering issues, or needs debugging assistance.

Capabilities:

  • Layered validation approach (lint → template → dry-run → install → test)
  • Template rendering and inspection
  • YAML parse error resolution
  • Value type error fixes
  • Resource conflict resolution
  • Image pull failure debugging
  • CRD and hook troubleshooting
  • Timeout and rollback handling

Helm Release Management

File: skills/helm-release-management/SKILL.md

Day-to-day Helm release operations: install, upgrade, uninstall, and release tracking.

When to use: User requests deploying/installing Helm charts, upgrading releases, or managing deployments.

Capabilities:

  • Install new releases with atomic rollback
  • Upgrade releases with value management
  • Release listing and filtering
  • Release history and status inspection
  • Multi-environment deployment workflows
  • Value override precedence handling
  • Pre-deployment validation

Helm Release Recovery

File: skills/helm-release-recovery/SKILL.md

Recover from failed deployments, rollback releases, and fix stuck release states.

When to use: User needs rollback, reports stuck releases (pending-install/upgrade), or failed deployments.

Capabilities:

  • Rollback to previous revisions
  • Recovery from stuck release states
  • Handling partial deployments
  • Cascading failure recovery across environments
  • History management and cleanup
  • Atomic deployment prevention strategies
  • Pre-upgrade backup procedures

Helm Values Management

File: skills/helm-values-management/SKILL.md

Manage Helm values across environments with override precedence and secret management.

When to use: User needs environment-specific configs, values.yaml management, or configuration strategies.

Capabilities:

  • Value override precedence (chart defaults → files → --set)
  • Multi-environment value organization (dev/staging/prod)
  • Values file layering and composition
  • Secret management strategies
  • Schema validation with values.schema.json
  • Value syntax and type handling
  • Template value rendering best practices

ArgoCD Login

File: skills/argocd-login/SKILL.md

ArgoCD CLI authentication with SSO for GitOps workflows.

When to use: User mentions ArgoCD login, authentication, or accessing ArgoCD applications.

Capabilities:

  • SSO authentication with gRPC-Web
  • Post-login application management
  • Cluster and project information access
  • Session management and troubleshooting
  • Integration with ArgoCD MCP tools

Installation

Manual Installation (Required)

Since the skills directory was not automatically populated, you need to manually copy the skills:

cd /Users/lgates/repos/laurigates/claude-plugins/kubernetes-plugin

# Copy all skills
for skill in kubernetes-operations helm-chart-development helm-debugging helm-release-management helm-release-recovery helm-values-management argocd-login; do
  cp -r /Users/lgates/.local/share/chezmoi/exact_dot_claude/skills/$skill skills/
done

# Verify skills were copied
ls -la skills/

Expected structure:

kubernetes-plugin/
├── .claude-plugin/
│   └── plugin.json
├── skills/
│   ├── kubernetes-operations/
│   │   ├── SKILL.md
│   │   └── REFERENCE.md
│   ├── helm-chart-development/
│   │   └── SKILL.md
│   ├── helm-debugging/
│   │   └── SKILL.md
│   ├── helm-release-management/
│   │   └── SKILL.md
│   ├── helm-release-recovery/
│   │   └── SKILL.md
│   ├── helm-values-management/
│   │   └── SKILL.md
│   └── argocd-login/
│       └── SKILL.md
└── README.md

Usage

Loading the Plugin

  1. Install plugin in your project or globally:

    # In your project
    claude plugins add /Users/lgates/repos/laurigates/claude-plugins/kubernetes-plugin
    
    # Or globally
    claude plugins add --global /Users/lgates/repos/laurigates/claude-plugins/kubernetes-plugin
    
  2. The plugin will automatically activate when you mention Kubernetes or Helm topics

Skill Activation

Skills are automatically activated based on user queries:

  • "Deploy my app to Kubernetes" → Activates kubernetes-operations
  • "Create a Helm chart" → Activates helm-chart-development
  • "My Helm upgrade failed" → Activates helm-debugging and helm-release-recovery
  • "Configure values for production" → Activates helm-values-management
  • "Login to ArgoCD" → Activates argocd-login

Common Workflows

Deploy Application with Helm
  1. Create chart: helm-chart-development
  2. Validate chart: helm-debugging
  3. Install release: helm-release-management
  4. Verify deployment: kubernetes-operations
Troubleshoot Failed Deployment
  1. Debug failure: helm-debugging
  2. Inspect K8s resources: kubernetes-operations
  3. Rollback if needed: helm-release-recovery
Multi-Environment Setup
  1. Configure values: helm-values-management
  2. Deploy to dev/staging/prod: helm-release-management
  3. Monitor and debug: kubernetes-operations + helm-debugging

Best Practices

Context Safety

All skills emphasize explicit context specification:

# Always use --context / --kube-context
kubectl --context=prod-cluster get pods
helm --kube-context=prod-cluster status myapp
skaffold --kube-context=prod-cluster deploy

Never rely on current context to prevent accidental operations on wrong clusters.

The validate-kubectl-context.sh PreToolUse hook enforces this for all three tools: it blocks cluster-mutating kubectl, helm, and skaffold commands that omit an explicit context flag. skaffold is included because skaffold deploy/run/dev/delete write to the current kubectl context by default and would otherwise bypass the guard (see issue #1870). Pin the context per-command with --kube-context, or in skaffold.yaml via deploy.kubeContext.

Dry-Run Checkpoint

The inject-kubectl-dry-run.sh PreToolUse hook rewrites a lone kubectl apply|delete|patch … to carry --dry-run=client and allows it, so the first run shows what would change. Re-run with --dry-run=none to apply for real; a kubectl call that already carries any --dry-run (also spelled --dry_run, or split by quotes or a line continuation as in --dry-r''un) is left alone.

The decision is made on the ast-grep --lang bash parse (issues #2734, #2887). The hook allows only a single kubectl call whose words it can read in full, after joining line continuations the way bash does; everything else goes to your normal permission flow. The flag goes at the end of the kubectl command node, because kubectl uses the last --dry-run it sees, and a second copy goes right after the verb:

Command shapeResult
One simple kubectl apply|delete|patch command, optionally with a trailing commentRewritten (kubectl apply --dry-run=client -f x.yaml --dry-run=client # note) and allowed
Global flags before the verb, from a bounded list: --context, --kubeconfig, -n/--namespace, --cluster, --user, --as, --as-group, --request-timeout, -s/--server, --token, -v, as --flag=value or --flag value (#2888)Rewritten — so the kubectl --context=staging apply -f x.yaml form that validate-kubectl-context.sh asks for gets the checkpoint
Any other flag before the verb, or a quoted flag value there (--context "staging")No output
Behind timeout DURATION or env KUBECONFIG=… (timeout 60 kubectl apply …)Rewritten
Behind sudo, env with an option or another assignment, or as a path (/usr/local/bin/kubectl, ./kubectl — any binary can carry that name)No output
kubectl apply view-last-applied / edit-last-applied, which register no --dry-run (set-last-applied does and is rewritten)No output
The command has a -- argument (also when quoted, as in '--' or \--), which ends option parsingNo output
Anything beyond one simple command — &&, ;, a pipe, a redirect (leading or trailing), a heredoc, a herestring, a substitution, a subshell or loopNo output: not rewritten, not allowed — your normal permission flow decides
Any $, backtick, {, <, >, *, ? or [ in the kubectl command — an expansion, substitution, brace expansion or glob, and also a JSON patch such as -p '{"spec":…}'No output
--raw (kubectl sends the raw request before it reads --dry-run), --profile… or --cache-dir (a dry run still writes those files), also when split by a line continuation (--ra\ then w on the next line)No output
An environment assignment before kubectl other than KUBECONFIG=…, such as PATH=… or LD_PRELOAD=…, which can run another binary or libraryNo output
The last word is a flag without =, such as -o or --as, which would take the injected flag as its valueNo output
kubectl apply only in quoted text, a heredoc body, or bash -c "…"Not a kubectl node, so not rewritten
ast-grep missing or failing, a parse ERROR, or an unterminated quoteNo output

Without ast-grep on PATH the hook does nothing, and the dry-run checkpoint is back to being a convention.

Atomic Deployments

Use atomic flags for production:

helm upgrade myapp ./chart --namespace prod --atomic --wait --timeout 10m

Layered Validation

Always progress through validation layers:

helm lint ./chart --strict              # 1. Static analysis
helm template myapp ./chart --debug     # 2. Render locally
helm install myapp ./chart --dry-run    # 3. Server validation
helm install myapp ./chart --atomic     # 4. Actual deployment
helm test myapp                          # 5. Post-deploy tests

Value Management

Organize values hierarchically:

values/
├── common.yaml         # Base values
├── dev.yaml           # Dev overrides
├── staging.yaml       # Staging overrides
└── production.yaml    # Production overrides

Deploy with layered values:

helm upgrade --install myapp ./chart \
  -f values/common.yaml \
  -f values/production.yaml \
  --atomic --wait

Keywords

kubernetes, helm, k8s, deployments, charts, releases, kubectl, argocd, gitops, cloud-native, containers, pods, services, ingress, configmaps, secrets, statefulsets, daemonsets

Version

1.0.0

License

Same as Claude Code configuration

Details

Marketplace
laurigates/claude-plugins
Source
kubernetes-plugin
Author
Lauri Gates
Category
Infrastructure
License
MIT
Keywords
kubernetes, helm, k8s, deployments
Listed since
Apr 7, 2026

More from laurigates/claude-plugins

All 52

Similar to kubernetes-plugin

More DevOps & Cloud