{"id":41849771,"url":"https://github.com/navilg/k8senv","last_synced_at":"2026-01-25T10:19:07.160Z","repository":{"id":147867296,"uuid":"618830645","full_name":"navilg/k8senv","owner":"navilg","description":"Kubernetes client's version manager to manage multiple versions of kubectl, helm and velero clients on same system/jumpbox/bastion.","archived":false,"fork":false,"pushed_at":"2024-11-02T12:21:49.000Z","size":26071,"stargazers_count":36,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T22:38:56.689Z","etag":null,"topics":["helm","k8senv","kubectl","kubernetes","manage-kubernetes-clusters","multi-cluster","rbenv","tfenv","velero","version-control","version-manager"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/navilg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-25T13:34:16.000Z","updated_at":"2025-02-23T19:04:01.000Z","dependencies_parsed_at":"2023-07-25T20:31:21.273Z","dependency_job_id":null,"html_url":"https://github.com/navilg/k8senv","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/navilg/k8senv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navilg%2Fk8senv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navilg%2Fk8senv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navilg%2Fk8senv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navilg%2Fk8senv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/navilg","download_url":"https://codeload.github.com/navilg/k8senv/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navilg%2Fk8senv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28751396,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T09:58:17.166Z","status":"ssl_error","status_checked_at":"2026-01-25T09:55:56.104Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["helm","k8senv","kubectl","kubernetes","manage-kubernetes-clusters","multi-cluster","rbenv","tfenv","velero","version-control","version-manager"],"created_at":"2026-01-25T10:19:06.585Z","updated_at":"2026-01-25T10:19:07.152Z","avatar_url":"https://github.com/navilg.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# k8senv\n\n[Kubernetes](https://kubernetes.io) client's version manager inspired by [tfenv](https://github.com/tfutils/tfenv)\n\nKubernetes clients supported at this moments are `kubectl`, or, `helm`, or, `velero` on Linux servers/machines.\n\nManytimes we need to manage many Kubernetes clusters from same jumpbox or machine or bastion server. Those many cluster may have different versions of Kubernetes. In that case, It becomes difficult to use multiple versions of Kubernetes clients to communicate with those different versions of clusters.\n\nThis small tool is to help manage different versions of Kubernetes clients. Kubernetes clients `kubectl`, `helm` and `velero` are supported at this stage.\n\n- [How to install/setup](https://github.com/navilg/k8senv#how-to-installsetup)\n- [Usage](https://github.com/navilg/k8senv#usage)\n- [Demo](https://github.com/navilg/k8senv#demo)\n\n## How to install/setup\n\n1. Create a directory .k8senv/bin in home directory\n\n```\nmkdir -p ~/.k8senv/bin\n```\n\n2. Download `k8senv` tool into `.k8senv/bin` directory\n\n[amd64](https://github.com/navilg/k8senv/releases/latest/download/k8senv-linux-amd64) Intel or AMD 64-Bit CPU\n\nDownload latest `k8senv` tool:\n```\ncd ~/.k8senv/bin\ncurl -L https://github.com/navilg/k8senv/releases/latest/download/k8senv-linux-amd64 -o k8senv\nchmod +x k8senv\n```\n\nDownload specific version of `k8senv`. For e.g. To download version `v1.0.2`:\n\n```\ncd ~/.k8senv/bin\ncurl -L https://github.com/navilg/k8senv/releases/download/v1.0.2/k8senv-linux-amd64 -o k8senv\nchmod +x k8senv\n```\n\n[arm64](https://github.com/navilg/k8senv/releases/latest/download/k8senv-linux-arm64) Arm-based 64-Bit CPU (i.e. in Raspberry Pi)\n\nDownload latest `k8senv` tool:\n```\ncd ~/.k8senv/bin\ncurl -L https://github.com/navilg/k8senv/releases/latest/download/k8senv-linux-arm64 -o k8senv\nchmod +x k8senv\n```\n\nDownload specific version of `k8senv`. For e.g. To download version `v1.0.2`:\n\n```\ncd ~/.k8senv/bin\ncurl -L https://github.com/navilg/k8senv/releases/download/v1.0.2/k8senv-linux-arm64 -o k8senv\nchmod +x k8senv\n```\n\n3. Add `~/.k8senv/bin` directory to your `PATH` environment variable\n\n```\nexport PATH=\"$HOME/.k8senv/bin:$PATH\"\necho 'export PATH=\"$HOME/.k8senv/bin:$PATH\"' \u003e\u003e ~/.bashrc\nhash -r\n```\n\n```\nwhich k8senv\n# OR\ntype k8senv\n```\n\n## Usage\n\n```bash\nk8senv [VERB] [CLIENT] [VERSION]\n\n# [VERB] can be install, use, list or remove\n# [CLIENT] can be kubectl, velero or helm\n# [VERSION] can be any client's version in format v*.*.* or latest or auto (auto is only supported for kubectl and velero client for install and use subcommands)\n\nexamples:\n\nk8senv use kubectl v1.23.2\nk8senv install velero v1.8.1\nk8senv use velero auto # Automatically detects Velero server version from current context and use same velero client version\nk8senv install kubectl latest # To install latest available kubectl\nk8senv install kubectl auto # Automatically detects Kubernetes version from current context and downloads same kubectl version\n```\n\nExamples:\n\n**Install a kubectl version**\n\nAny of below commands can be used to download 1.26.2 version of kubectl\n\n```\nk8senv install kubectl v1.26.2\nk8senv install kubectl 1.26.2\nk8senv kubectl install v1.26.2\nk8senv install kubectl 1.26.2 --overwrite   # Installs even if it already exists\nk8senv install kubectl latest               # Installs latest stable version of kubectl\nk8s install kubectl v1.19.2 --timeout=300   # Install 1.19.2 with timeout of 300 seconds. Default timeout is 120 seconds.\nk8senv install kubectl auto # Get Kubernetes version from current context and Install same version of kubectl\n```\n\n**List all installed version of kubectl**\n\nAny of below commandds can be used to list all kubectl client's version installed by k8senv.\n\n```\nk8senv list kubectl\nk8senv kubectl list\n```\n\n**Switch to a version of kubectl**\n\nAny of below commands can be used to switch kubectl version to 1.26.2. If version is not available, It will install it automatically.\n\n```\nk8senv use kubectl v1.26.2\nk8senv use kubectl 1.26.2\nk8senv kubectl use v1.26.2\nk8senv use kubectl auto\n```\n\nIf you were using system installed version of `kubectl` in same shell session, you will need to clear the cached path of the kubectl using below command.\n\n```\nhash -d kubectl\n```\n\n**Unuse/Disable k8senv managed kubectl**\n\nAny of the below command can be used to unuse or disable k8senv managed kubectl without uninstalling it. This will reset the system to use system installed kubectl, if present.\n\n```\nk8senv unuse kubectl\nk8senv kubectl unuse\n```\n\nTo clear the cached k8senv path of kubectl, you will need to clear it using below command before you can use system installed version of the tool.\n\n```\nhash -d kubectl\n```\n\n**Remove an existing version of kubectl**\n\nAny of below commands can be used to remove kubectl version 1.26.2.\n\n```\nk8senv remove kubectl v1.26.2\nk8senv remove kubectl 1.26.2\nk8senv kubectl remove v1.26.2\n```\n\n**Similar command can be used to install, use, list and remove velero and helm clients.**\n\nFor e.g.\n\n```\nk8senv install helm v3.10.2\nk8senv remove velero 1.10.1\n```\n\n## Demo\n\n[![Demo](https://asciinema.org/a/dSPtu0bAPvPFxjhqtJR3LNC89.svg)](https://asciinema.org/a/dSPtu0bAPvPFxjhqtJR3LNC89)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavilg%2Fk8senv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnavilg%2Fk8senv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavilg%2Fk8senv/lists"}