Install
openclaw skills install @yoshino-s/k8s-helperOperate Kubernetes clusters via kubectl with a user-supplied kubeconfig (local file path or remote URL). This skill should be used when users want to inspect or manage Kubernetes resources (pods, deployments, services, nodes, namespaces, logs, exec, apply, etc.) against an arbitrary cluster. The skill auto-downloads remote kubeconfigs to a cached location and auto-installs kubectl if it is missing.
openclaw skills install @yoshino-s/k8s-helperRun kubectl against any cluster by pointing at a local kubeconfig file or a remote kubeconfig URL. Bootstrap (kubectl install + kubeconfig download) is handled automatically.
Use this skill whenever the user wants to:
kubectl get pods -A, kubectl describe node ...)kubectl apply -f, kubectl delete, kubectl rollout)kubectl subcommandThe main entry point is scripts/k8s.sh. It is a thin wrapper that:
kubectl is installed (downloads it via the DaoCloud mirror if missing).kubectl --kubeconfig=<resolved-path> <your args...>.bash scripts/k8s.sh \
--kubeconfig /path/to/kubeconfig.yaml \
-- get pods -A
bash scripts/k8s.sh \
--kubeconfig-url https://example.com/kubeconfig.yaml \
-- get nodes -o wide
--kubeconfig and --kubeconfig-url can also be supplied via env vars:
export KUBECONFIG_URL=https://example.com/kubeconfig.yaml
bash scripts/k8s.sh -- get ns
Or:
export KUBECONFIG_PATH=/path/to/kubeconfig.yaml
bash scripts/k8s.sh -- get ns
If both a URL and a local path are provided, the explicit CLI flag wins; otherwise local path takes precedence over URL.
-- separatorAnything after -- is forwarded verbatim to kubectl. The separator is recommended (especially when forwarded args start with -), but the script also tolerates omitting it when no flag ambiguity exists.
| Flag | Env Var | Description |
|---|---|---|
--kubeconfig <path> | KUBECONFIG_PATH | Local kubeconfig file path. |
--kubeconfig-url <url> | KUBECONFIG_URL | Remote kubeconfig URL (http/https). Downloaded once and cached. |
--cache-dir <dir> | K8S_SKILL_CACHE_DIR | Cache directory for downloaded kubeconfigs and kubectl binary. Defaults to $HOME/.cache/k8s-skill. |
--refresh | - | Force re-download of the remote kubeconfig even if cached. |
--kubectl <path> | KUBECTL_BIN | Use a specific kubectl binary instead of auto-detect/install. |
--insecure | - | Pass -k to curl when downloading the kubeconfig (use only for trusted self-signed endpoints). |
-h, --help | - | Print usage. |
All other arguments (or anything after --) are passed straight through to kubectl.
# List namespaces using a local kubeconfig
bash scripts/k8s.sh --kubeconfig ~/.kube/prod.yaml -- get ns
# Tail logs against a remote kubeconfig
bash scripts/k8s.sh \
--kubeconfig-url https://example.com/kubeconfig.yaml \
-- logs -n kube-system -l k8s-app=kube-dns --tail=100 -f
# Apply a manifest
bash scripts/k8s.sh \
--kubeconfig-url https://example.com/kubeconfig.yaml \
-- apply -f ./deploy.yaml
# Force a kubeconfig refresh (re-download)
bash scripts/k8s.sh \
--kubeconfig-url https://example.com/kubeconfig.yaml --refresh \
-- cluster-info
kubectl is missing and no --kubectl/KUBECTL_BIN override is given, the wrapper downloads a stable kubectl binary for the current OS/arch from the DaoCloud mirror (https://files.m.daocloud.io/dl.k8s.io/...) and caches it under <cache-dir>/bin/kubectl. The cache directory is added to PATH for the duration of the command.<cache-dir>/kubeconfigs/<hash>.yaml. Use --refresh to bypass the cache.chmod 600. Avoid logging the file contents.A no-op connectivity probe:
bash scripts/k8s.sh \
--kubeconfig-url https://example.com/kubeconfig.yaml \
-- version --short