AGENT SKILL

uninstall-kube-agents

Uninstall kube-agents (the Kubernetes Agentic Harness) — discover and remove the GCP/GKE infrastructure an install provisioned. Use when asked to uninstall, remove, or tear down kube-agents from a project or cluster.

License 许可
Apache-2.0
最近更新
2026-11-14
Stars
★ 126
Forks
44

01 前言 Front Matter

name
uninstall-kube-agents
description
Uninstall kube-agents (the Kubernetes Agentic Harness) — discover and remove the GCP/GKE infrastructure an install provisioned. Use when asked to uninstall, remove, or tear down kube-agents from a project or cluster.

03 SKILL.md 正文

Uninstall Kubernetes Agentic Harness (kube-agents)

Use this skill when asked to remove or uninstall kube-agents infrastructure from a GCP project or GKE cluster.

One-Liner Uninstall Command (Non-Interactive)

To run the project teardown non-interactively, use the uninstall.sh published for the release the install runs, substituting <RELEASE_VERSION> with a release tag from GitHub Releases. The release-pinned script tears the install down with its own release's engine; a copy carrying no baked version falls back to the engine on main, which is not the one that built the install:

curl -fsSL https://raw.githubusercontent.com/gke-labs/kube-agents/<RELEASE_VERSION>/uninstall.sh | bash -s -- \
  --non-interactive \
  --gcp-project-id="<PROJECT_ID>" \
  --gke-cluster-name="<CLUSTER_NAME>" \
  --gcp-region="<REGION>"

On a GitLab install, the installer creates the token Secret, and the CA Secret for a private CA, outside the Helm release. A teardown that deletes the cluster deletes them too. On a cluster that the teardown keeps, tell the operator that the Secrets stay, and give the command in "What a teardown leaves" on the site's uninstall page (docs/site/src/content/docs/install/uninstall.md), or tell the operator to delete the namespace. That command sources the install's install.env in a subshell, the same way the installer reads it, so renamed Secrets or a non-default namespace are found. Then tell the operator to revoke the token in GitLab, and the read-only token too, if the operator made one.

The installer finds install.env in this order: KUBE_AGENTS_INSTALL_ENV, beside install.sh, in the current directory, then the source directory ($HOME/kube-agents under curl … | bash).

Also tell the operator to revoke the token in GitLab, and the read-only token too, if the operator made one.

The engine is lifecycle.sh destroy in terraform/examples/full-install, run against the install's Terraform state in GCS (bucket <project>-kube-agents-tfstate, prefix kube-agents/<cluster> — derived from the coordinates, so a fresh clone finds it). Before terraform destroy it handles the asymmetries a bare destroy trips over: it forgets the undeletable KMS key rings and keys from state (kept usable in GCP, re-adopted on the next apply), and the cluster key's grant to the GKE service agent, which other installs that use the key share; it deletes the PlatformAgent CR and force-clears its finalizer if the operator is wedged, uninstalls the Helm releases with the helm CLI on a cluster the install did not create, purges every backup the GKE BackupPlan owns, and clears the cluster's deletion protection.

When the command does not run from a local kube-agents checkout, the teardown engine is fetched: at the script's own baked release when it has one, and from main when it does not. --source-ref="<SEMVER_TAG_OR_FULL_COMMIT_SHA>" names a revision instead, which is how an unstamped copy is pointed at the release that was installed.

terraform must be on PATH — the teardown engine, which this script never installs for you. On an install made onto a cluster it did not create, put helm on PATH too: without it the teardown only warns and leaves the releases to Terraform's Helm provider. See the site's uninstall page.

No Terraform state anywhere (none in GCS, none locally) means one of two things, and the uninstaller exits 3 without touching anything either way: nothing is installed against these coordinates, or the install was made by a pre-Terraform release. Only the second is recoverable here — re-run with --source-ref=<that release> so that release's own teardown runs instead. Check whether the cluster exists before reaching for a release tag.

Exit 3 is the one non-zero exit that is not a failure; exit 1 means the teardown could not start or started and did not finish. On a cluster the install did not create, a helm list or helm uninstall failure stops the teardown before Terraform removes anything: restore access to the cluster and re-run, or run the helm uninstall command it prints. ./uninstall.sh --help is the contract.

Machine-readable JSON status reports are generated at /tmp/kube-agents-uninstall-report.json.

04 同仓库更多 Skills

gke-labs
gke-labs/kube-agents

gke-workload-troubleshooting

Diagnoses GKE workload failures (CrashLoopBackOff, OOMKilled, ImagePullBackOff, Pending, etc.) via logs and events. Use when pods fail to start or crash repeatedly. Don't use for GKE cluster infrastructure provisioning, node pool creation, or non-Kubernetes Google Cloud services.

★ 126
gke-labs
gke-labs/kube-agents

gke-workload-security

Audits, configures, and hardens workload-level security controls for Google Kubernetes Engine (GKE) applications and namespaces. Covers running security audits (`audit_cluster.sh`), enforcing Network Policies (default-deny and Dataplane V2 logging), isolating high-risk pods inside GKE Sandbox (`gVisor`), enforcing Pod Security Standards (`restricted` labeling) and pod securityContext, and mounting Secret Manager secrets via CSI (`SecretProviderClass`). Use when auditing workload security posture, isolating namespaces, applying pod security standards, or configuring network policies and secret volume mounts. Don't use for Workload Identity (use gke-workload-identity), cluster-wide control plane security, RBAC hardening, Binary Authorization, Shielded Nodes, or enabling platform-level GKE add-ons (use gke-platform-security instead).

★ 126
gke-labs
gke-labs/kube-agents

gke-workload-scaling

Manages scaling for GKE workloads using HPA and VPA. Use when configuring Horizontal Pod Autoscaler (HPA), configuring Vertical Pod Autoscaler (VPA), or applying best practices for GKE workload autoscaling. Do not use for cluster-level autoscaling (Cluster Autoscaler), static cluster sizing, or configuring node-level machine styles directly.

★ 126
gke-labs
gke-labs/kube-agents

gke-workload-identity

Configures and diagnoses Workload Identity Federation for GKE authentication failures for Pods (403 "iam.serviceAccounts.getAccessToken" / permission denied, "could not find default credentials", or GKE metadata server unreachable) by verifying cluster and node-pool Workload Identity configuration, the Kubernetes ServiceAccount (KSA) to IAM binding (direct principal binding and legacy Google ServiceAccount impersonation), target-resource IAM roles, and gke-metadata-server health. Use when setting up KSA/GSA bindings (`roles/iam.workloadIdentityUser`, `iam.gke.io/gcp-service-account`) or when a Pod cannot authenticate to Google Cloud APIs. Don't use for in-cluster Kubernetes RBAC errors (API-server authorization), general workload crashes (use gke-workload-troubleshooting), or Pod Security Standards and NetworkPolicies (use gke-workload-security).

★ 126
gke-labs
gke-labs/kube-agents

gke-upgrades

Plans, executes, and validates Google Kubernetes Engine (GKE) cluster upgrades and maintenance operations for both Standard and Autopilot clusters. Produces upgrade plans, pre/post-upgrade checklists, maintenance runbooks with gcloud commands, release channel strategy, and troubleshooting guides. Handles node pool upgrade strategies (surge, blue-green), version compatibility, PDB management, and workload-specific concerns (stateful, GPU, operators). Use this skill whenever the user mentions GKE upgrades, Kubernetes version bumps, node pool maintenance, GKE patching, cluster version management, release channel selection, maintenance windows, surge upgrades, stuck upgrades, or any GKE lifecycle management task — even casual mentions like "we need to upgrade our clusters" or "plan our next GKE maintenance" or "our upgrade is stuck." Don't use for GKE cluster creation, application onboarding, general networking/routing setup, or security policy configurations (use gke-basics or relevant GKE skills instead).

★ 126
gke-labs
gke-labs/kube-agents

gke-tpu-metrics-monitoring

Monitors and troubleshoots GKE TPU workloads, nodes, and node pools using GKE system metrics and PromQL. Use when monitoring TensorCore duty cycle, TPU memory, node readiness, multi-host TPU node pool availability, host maintenance or preemption interruptions, and calculating MTTR or MTBI metrics for GKE TPUs. Don't use for general non-TPU GKE workload monitoring or non-metric TPU debugging.

★ 126