agentsclimarketplace

K8s operations

Skill ComeOnOliver/skillshub/skills/rohitg00/kubectl-mcp-server/k8s-operations

🧠 The right skill, one API call. AI agent skills registry with token-efficient skill resolution. 5,000+ skills from 500+ top repos.

Install
npx -y skills add ComeOnOliver/skillshub --skill k8s-operations

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

3.9 KB, as published. Nobody here has run it

kubectl Operations

Execute kubectl commands using kubectl-mcp-server's operations tools.

When to Apply

Use this skill when:

  • User mentions: "apply", "patch", "delete", "exec", "scale", "rollout"
  • Operations: modifying resources, running commands, scaling workloads
  • Keywords: "update", "change", "modify", "run command", "restart"

Priority Rules

PriorityRuleImpactTools
1Dry run before apply in productionCRITICALkubectl_apply(dry_run=True)
2Check current state before patchingHIGHdescribe_* tools
3Avoid force delete unless necessaryHIGHkubectl_delete
4Verify rollout status after changesMEDIUMkubectl_rollout_status

Quick Reference

TaskToolExample
Apply manifestkubectl_applykubectl_apply(manifest=yaml)
Patch resourcekubectl_patchkubectl_patch(type, name, namespace, patch)
Delete resourcekubectl_deletekubectl_delete(type, name, namespace)
Exec commandkubectl_execkubectl_exec(pod, namespace, command)
Scale deploymentscale_deploymentscale_deployment(name, namespace, replicas)

Apply Resources

kubectl_apply(manifest="""
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
  namespace: default
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:latest
""")

kubectl_apply(file_path="/path/to/manifest.yaml")

kubectl_apply(manifest="...", dry_run=True)

Patch Resources

kubectl_patch(
    resource_type="deployment",
    name="nginx",
    namespace="default",
    patch={"spec": {"replicas": 5}}
)

kubectl_patch(
    resource_type="deployment",
    name="nginx",
    namespace="default",
    patch=[{"op": "replace", "path": "/spec/replicas", "value": 5}],
    patch_type="json"
)

kubectl_patch(
    resource_type="service",
    name="my-svc",
    namespace="default",
    patch={"metadata": {"annotations": {"key": "value"}}},
    patch_type="merge"
)

Delete Resources

kubectl_delete(resource_type="pod", name="my-pod", namespace="default")

kubectl_delete(
    resource_type="pods",
    namespace="default",
    label_selector="app=test"
)

kubectl_delete(
    resource_type="pod",
    name="stuck-pod",
    namespace="default",
    force=True,
    grace_period=0
)

Execute Commands

kubectl_exec(
    pod="my-pod",
    namespace="default",
    command="ls -la /app"
)

kubectl_exec(
    pod="my-pod",
    namespace="default",
    container="sidecar",
    command="cat /etc/config/settings.yaml"
)

kubectl_exec(
    pod="my-pod",
    namespace="default",
    command="sh -c 'curl -s localhost:8080/health'"
)

Scale Resources

scale_deployment(name="nginx", namespace="default", replicas=5)

scale_deployment(name="nginx", namespace="default", replicas=0)

kubectl_scale(
    resource_type="statefulset",
    name="mysql",
    namespace="default",
    replicas=3
)

Rollout Management

kubectl_rollout_status(
    resource_type="deployment",
    name="nginx",
    namespace="default"
)

kubectl_rollout_history(
    resource_type="deployment",
    name="nginx",
    namespace="default"
)

kubectl_rollout_restart(
    resource_type="deployment",
    name="nginx",
    namespace="default"
)

rollback_deployment(name="nginx", namespace="default", revision=1)

Labels and Annotations

kubectl_label(
    resource_type="pod",
    name="my-pod",
    namespace="default",
    labels={"env": "production"}
)

kubectl_annotate(
    resource_type="deployment",
    name="nginx",
    namespace="default",
    annotations={"description": "Main web server"}
)

Related Skills

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.