A kubectl plugin to interact with Kubernetes resources through Komodor directly from the command line.
Note: The current context name must either be equal to the cluster name in Komodor, or an ARN that ends with the cluster name in Komodor (e.g.
arn:aws:eks:us-east-1:123456789:cluster/your-cluster-name).
- 🌐 Resource Navigation: Open any Kubernetes resource directly in Komodor's web interface
- 🔍 Root Cause Analysis: Start automated RCA sessions for resources and get detailed analysis results
Note for Alpine Linux users:
The kubectl-komodor binary for Linux (built with Bun) requires the
libstdc++package to be installed on Alpine Linux. This is because Bun's runtime depends on the C++ standard library, and fully static binaries are not currently supported. You can install it with:apk add --no-cache libstdc++Alpine Linux Binaries:
While Krew doesn't support platform-specific selectors for Alpine Linux (musl), Alpine-compatible binaries are available for manual download from the GitHub releases. Look for files with
-muslsuffix:
kubectl-komodor-linux-arm64-musl.tar.gzkubectl-komodor-linux-amd64-musl.tar.gz
kubectl krew install komodorkubectl krew install --manifest-url=https://raw.githubusercontent.com/amitlin/kubectl-komodor/refs/heads/main/komodor.yamlbun install
bun run install-locally-
Authenticate (required for RCA features):
kubectl komodor auth <your-api-key>
-
Open a resource in Komodor:
kubectl komodor open deployment my-deploy
-
Start a Root Cause Analysis:
kubectl komodor rca deployment my-deploy
Save your Komodor API key for authenticated operations.
kubectl komodor auth <api-key>Examples:
kubectl komodor auth your-api-key-hereThe API key is stored securely in ~/.kubectl-komodor/config.json.
Open any Kubernetes resource directly in Komodor's web interface.
kubectl komodor open <resourceType> <resourceName> [--namespace <ns>] [--cluster <cluster>]Arguments:
resourceType- The Kubernetes resource type (e.g., deployment, pod, service)resourceName- The name of the resource
Options:
-n, --namespace <ns>- Specify the namespace (default: current or 'default')-c, --cluster <cluster>- Specify the cluster name (default: derived from current context)
Examples:
kubectl komodor open ds my-daemonset -n kube-system
kubectl komodor open deployment my-deploy -c my-cluster
kubectl komodor open pod my-pod -n default
kubectl komodor open service my-service
kubectl komodor open ingress my-ingressStart an automated root cause analysis session for a resource and get detailed results.
kubectl komodor rca <resourceType> <resourceName> [--namespace <ns>] [--cluster <cluster>]Arguments:
resourceType- The Kubernetes resource type (e.g., deployment, pod, service)resourceName- The name of the resource
Options:
-n, --namespace <ns>- Specify the namespace (default: current or 'default')-c, --cluster <cluster>- Specify the cluster name (default: derived from current context)
Examples:
kubectl komodor rca deployment my-deploy -n default
kubectl komodor rca pod my-pod -c my-cluster
kubectl komodor rca service my-service -n kube-systemNote: This command requires authentication. Run kubectl komodor auth <api-key> first.
The plugin supports all major Kubernetes resource types with common aliases:
- Pod (
pod,pods) - Deployment (
deploy,deployment,deployments) - ReplicaSet (
rs,replicaset,replicasets) - StatefulSet (
sts,statefulset,statefulsets) - DaemonSet (
ds,daemonset,daemonsets) - Job (
job,jobs) - CronJob (
cronjob,cronjobs) - Argo Rollout (
argo,rollout,argo rollout,argo rollouts)
- Service (
svc,service,services) - Ingress (
ing,ingress,ingresses) - Endpoints (
endpoint,endpoints) - EndpointSlice (
endpointslice,endpointslices) - NetworkPolicy (
netpol,networkpolicy,networkpolicies)
- PersistentVolumeClaim (
pvc,pvcs,persistentvolumeclaim,persistentvolumeclaims) - PersistentVolume (
pv,pvs,persistentvolume,persistentvolumes) - StorageClass (
sc,storageclass,storageclasses) - Global resource
- ConfigMap (
cm,configmap,configmaps) - Secret (
secret,secrets) - ResourceQuota (
rq,resourcequota,resourcequotas) - LimitRange (
limitrange,limitranges) - HorizontalPodAutoscaler (
hpa,hpas,horizontalpodautoscaler,horizontalpodautoscalers) - PodDisruptionBudget (
pdb,pdbs,poddisruptionbudget,poddisruptionbudgets) - Namespace (
ns,namespace,namespaces) - Global resource
- ServiceAccount (
sa,serviceaccount,serviceaccounts) - Role (
role,roles) - RoleBinding (
rolebinding,rolebindings) - ClusterRole (
clusterrole,clusterroles) - Global resource - ClusterRoleBinding (
clusterrolebinding,clusterrolebindings) - Global resource
bun ./index.ts komodor open deployment my-deployTo build binaries for all supported platforms and architectures using Docker:
bun run build-artifactsThis script builds binaries for:
- Alpine Linux: ARM64 and AMD64
- Debian Linux: ARM64 and AMD64
- Darwin (macOS): ARM64 and AMD64 (native builds)
The build process:
- Uses Docker containers with Alpine and Debian base images
- Installs bash and bun in each container
- Builds binaries using
bun build --compilewith appropriate targets - Creates tarballs with the binary and LICENSE file
- Cleans up Docker containers and images automatically
Requirements:
- Docker installed and running
- Bun installed locally (for Darwin builds)
Output:
kubectl-komodor-linux-arm64.tar.gzkubectl-komodor-linux-amd64.tar.gzkubectl-komodor-darwin-arm64.tar.gzkubectl-komodor-darwin-amd64.tar.gz
Pull requests are welcome! Please open an issue first to discuss major changes.
- Use conventional commits.
- See
.pre-commit-config.yamlfor linting and formatting hooks.
To create a new release for all supported platforms:
- Make sure your working directory is clean and all changes are committed.
- Bump the version in your package.json if needed.
- Run:
bun run release-allThis will:
- Build binaries for all supported platforms (darwin/linux, amd64/arm64)
- Package each binary and the LICENSE file into a tarball
- Generate or update the
komodor.yamlmanifest with the correct SHA256 and URIs
- Upload the generated tarballs to your GitHub release for the new version.
- Commit and push the updated
komodor.yamlmanifest if needed. - (Optional, but recommended) Update the Krew plugin index:
- Fork and clone https://github.com/kubernetes-sigs/krew-index
- Copy your updated
komodor.yamlmanifest to theplugins/directory in your fork - Open a pull request to the krew-index repository with your changes
- See the Krew plugin submission guide for more details
MIT