{"id":13522285,"url":"https://github.com/imyuliz/kubectl-switch","last_synced_at":"2026-03-06T19:02:02.384Z","repository":{"id":57595196,"uuid":"183898528","full_name":"imyuliz/kubectl-switch","owner":"imyuliz","description":"Kubernetes multi-cluster command-line management tool","archived":false,"fork":false,"pushed_at":"2019-05-12T10:39:58.000Z","size":40057,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-15T07:06:38.177Z","etag":null,"topics":["kubectl","kubectl-plugin","kubectl-plugins","kubernetes"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imyuliz.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}},"created_at":"2019-04-28T11:20:07.000Z","updated_at":"2025-02-02T03:49:23.000Z","dependencies_parsed_at":"2022-09-26T19:52:48.364Z","dependency_job_id":null,"html_url":"https://github.com/imyuliz/kubectl-switch","commit_stats":null,"previous_names":["yulibaozi/kubectl-switch"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/imyuliz/kubectl-switch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imyuliz%2Fkubectl-switch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imyuliz%2Fkubectl-switch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imyuliz%2Fkubectl-switch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imyuliz%2Fkubectl-switch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imyuliz","download_url":"https://codeload.github.com/imyuliz/kubectl-switch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imyuliz%2Fkubectl-switch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30168601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T07:56:45.623Z","status":"ssl_error","status_checked_at":"2026-03-06T07:55:55.621Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["kubectl","kubectl-plugin","kubectl-plugins","kubernetes"],"created_at":"2024-08-01T06:00:45.120Z","updated_at":"2026-03-06T19:02:02.348Z","avatar_url":"https://github.com/imyuliz.png","language":"Go","funding_links":[],"categories":["kubectl Plugins"],"sub_categories":["Installing plugins via awesome-kubectl-plugins"],"readme":"# kubectl-switch\n\nkubectl-switch是一个kubernetes命令行工具插件,它做的事情非常简单,即:你可以在一台计算机上可以操作多个kubernetes集群.\n\n### 使用快照\n\n这是一个小示例\n \n### 安装\n\n\n\u003cg-emoji class=\"g-emoji\" alias=\"warning\" fallback-src=\"https://github.githubassets.com/images/icons/emoji/unicode/26a0.png\"\u003e⚠️\u003c/g-emoji\u003e   **警告: `kubectl` 必须在1.12.0及以上**, 你可以使用`kubectl version`命令来查看是否满足前置条件\n\n如果需要安装`kubectl`, 请查看:[Install and Set Up kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)\n\n```\n➜  ~ kubectl version\n\nGitVersion:\"v1.14.1\"\n```\n\n源码编译:\n\n```\ngo get -u github.com/yulibaozi/kubectl-switch\n\ncd $GOPATH/src/github.com/yulibaozi/kubectl-switch\n\ngo build .\n\n# move PATH\nmv  ./kubectl-switch /usr/local/bin/\n```\n\nMac :\n\n```\nbrew tap yulibaozi/tap \u0026\u0026 brew install kubectl-switch\n```\n\nLinux:\n\n```\nexport PLUGIN_VERSION=1.0.1\n# linux x86_64\necho \"https://github.com/yulibaozi/kubectl-switch/releases/download/v${PLUGIN_VERSION}/kubectl-switch_${PLUGIN_VERSION}_linux_amd64.tar.gz\" | xargs curl -o kubectl-switch.tar.gz -Lv\n\n\n# macos\necho \"https://github.com/yulibaozi/kubectl-switch/releases/download/v${PLUGIN_VERSION}/kubectl-switch_${PLUGIN_VERSION}_darwin_amd64.tar.gz\" | xargs curl -o kubectl-switch.tar.gz -Lv\n\n\ntar -zxvf kubectl-switch.tar.gz kubectl-switch\n\nsudo mv kubectl-switch /usr/local/bin/\n```\n\n\n\n### 使用流程\n\nstep 1. 当你安装完`kubectl-switch`后, 需要向`kubectl-switch`注册需要操作的集群\n```\nkubectl switch register      qa     /root/yulibaozi/admin.kubeconfig\n#                         集群名字   集群操作所需要config文件\n```\n\n2. 查看向`kubectl-switch`注册成功的集群列表\n```\nkubectl switch list\n```\n\n3. 查看当前`kubectl`操作的集群\n```\nkubectl switch where\n```\n4. 切换`kubectl`操作的集群\n```\nkubectl switch qa\n```\n5. 正常执行其他kubectl命令\n\n```\n两种方式:\n \n 如获取节点列表列表:\n\n    1. kubectl get node \n    2. kubectl switch qa get node\n```\n\n### 使用惯例\n\n1. 查看支持哪些命令\n```\n\n➜  ~ kubectl switch -h\n\nKubernetes multi-cluster command line management tool.\n\nUsage:\n  kubectl-switch [flags]\n  kubectl-switch [command]\n\nAvailable Commands:\n  help        Help about any command\n  list        List all cluster message\n  where         View cluster of currently in use\n  register    Register cluster in switch plugin\n  remove      Remove the specified cluster name\n  removeall   Removeall cluster config\n  version     view switch plugin version\n\nFlags:\n  -h, --help     help for kubectl-switch\n  -t, --toggle   Help message for toggle\n\nUse \"kubectl-switch [command] --help\" for more information about a command.\n\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimyuliz%2Fkubectl-switch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimyuliz%2Fkubectl-switch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimyuliz%2Fkubectl-switch/lists"}