diff --git a/.all-contributorsrc b/.all-contributorsrc index f742233b..8ec96c23 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -5,8 +5,7 @@ "repoHost": "https://github.com", "files": [ "README.md", - "docs/en-us/contribute.md", - "docs/zh-cn/contribute.md" + "docs/en-us/contribute.md" ], "imageSize": 100, "commit": true, diff --git a/docs/index.html b/docs/index.html index 2b76c813..d8965768 100644 --- a/docs/index.html +++ b/docs/index.html @@ -68,12 +68,10 @@ search: { placeholder: { '/': 'Type to search', - '/zh-cn/': '搜索', '/en-us/': 'Type to search' }, noData: { '/': 'No Results', - '/zh-cn/': '找不到结果', '/en-us/': 'No Results' } }, diff --git a/docs/zh-cn/README.md b/docs/zh-cn/README.md deleted file mode 100644 index 4efda635..00000000 --- a/docs/zh-cn/README.md +++ /dev/null @@ -1,86 +0,0 @@ -
- -
- -![Go version](https://img.shields.io/github/go-mod/go-version/sunny0826/kubecm) -![Go](https://github.com/sunny0826/kubecm/workflows/Go/badge.svg?branch=master) -[![Go Report Card](https://goreportcard.com/badge/github.com/sunny0826/kubecm)](https://goreportcard.com/report/github.com/sunny0826/kubecm) -![GitHub](https://img.shields.io/github/license/sunny0826/kubecm.svg) -[![GitHub release](https://img.shields.io/github/release/sunny0826/kubecm)](https://github.com/sunny0826/kubecm/releases) -[![codecov](https://codecov.io/gh/sunny0826/kubecm/branch/master/graph/badge.svg?token=KGTLBQ8HYZ)](https://codecov.io/gh/sunny0826/kubecm) -[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6065/badge)](https://bestpractices.coreinfrastructure.org/projects/6065) - -List, switch, add, delete and more interactive operations to manage kubeconfig. It also supports kubeconfig management from cloud. - -```text - - Manage your kubeconfig more easily. - - -██ ██ ██ ██ ██████ ███████ ██████ ███ ███ -██ ██ ██ ██ ██ ██ ██ ██ ████ ████ -█████ ██ ██ ██████ █████ ██ ██ ████ ██ -██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ -██ ██ ██████ ██████ ███████ ██████ ██ ██ - - Tips Find more information at: https://kubecm.cloud - -Usage: - kubecm [command] - -Available Commands: - add Add KubeConfig to $HOME/.kube/config - alias Generate alias for all contexts - clear Clear lapsed context, cluster and user - cloud Manage kubeconfig from cloud - completion Generate completion script - create Create new KubeConfig(experiment) - delete Delete the specified context from the kubeconfig - help Help about any command - list List KubeConfig - merge Merge multiple kubeconfig files into one - namespace Switch or change namespace interactively - rename Rename the contexts of kubeconfig - switch Switch Kube Context interactively - version Print version info - -Flags: - --config string path of kubeconfig (default "$HOME/.kube/config") - -m, --mac-notify enable to display Mac notification banner - -s, --silence-table enable/disable output of context table on successful config update - -h, --help help for kubecm - --ui-size int number of list items to show in menu at once (default 4) - -Use "kubecm [command] --help" for more information about a command. -``` - -## 演示 - - - -## 安装 -使用 [Krew](https://krew.sigs.k8s.io/): - -```bash -kubectl krew install kc -``` - -使用 Homebrew: - -```bash -brew install kubecm -``` - -下载可执行文件: - -[Download the binary](https://github.com/sunny0826/kubecm/releases) - -## 鸣谢 - -- [JetBrains IDEs](https://www.jetbrains.com/?from=kubecm) - -- - - -
diff --git a/docs/zh-cn/_sidebar.md b/docs/zh-cn/_sidebar.md deleted file mode 100644 index 961d2080..00000000 --- a/docs/zh-cn/_sidebar.md +++ /dev/null @@ -1,18 +0,0 @@ -* [介绍](/zh-cn/introduction.md) -* [安装](/zh-cn/install.md) -* CLI 参考 - * [add](/zh-cn/cli/kubecm_add.md) - * [cloud](/zh-cn/cli/kubecm_cloud.md) - * [create(实验性)](/zh-cn/cli/kubecm_create.md) - * [alias](/zh-cn/cli/kubecm_alias.md) - * [completion](/zh-cn/cli/kubecm_completion.md) - * [delete](/zh-cn/cli/kubecm_delete.md) - * [list](/zh-cn/cli/kubecm_list.md) - * [merge](/zh-cn/cli/kubecm_merge.md) - * [namespace](/zh-cn/cli/kubecm_namespace.md) - * [rename](/zh-cn/cli/kubecm_rename.md) - * [switch](/zh-cn/cli/kubecm_switch.md) - * [clear](/en-us/cli/kubecm_clear.md) - * [version](/zh-cn/cli/kubecm_version.md) - * [export](/zh-cn/cli/kubecm_export.md) -* [贡献](/zh-cn/contribute.md) \ No newline at end of file diff --git a/docs/zh-cn/cli/kubecm.md b/docs/zh-cn/cli/kubecm.md deleted file mode 100644 index 1a84077c..00000000 --- a/docs/zh-cn/cli/kubecm.md +++ /dev/null @@ -1,45 +0,0 @@ -## kubecm - -KubeConfig Manager. - -### Synopsis - - -[104m[104m [0m[0m -[104m[104m[97m[97m Manage your kubeconfig more easily. [0m[104m[0m[104m[0m[0m -[104m[104m [0m[0m -[92m[0m -[92m██ ██ ██ ██ ██████ ███████ ██████ ███ ███ [0m -[92m██ ██ ██ ██ ██ ██ ██ ██ ████ ████ [0m -[92m█████ ██ ██ ██████ █████ ██ ██ ████ ██ [0m -[92m██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ [0m -[92m██ ██ ██████ ██████ ███████ ██████ ██ ██[0m -[92m[0m -[44;97m[44;97m Tips [0m[0m [96m[96mFind more information at: [95mhttps://kubecm.cloud[0m[96m[0m[0m - - -### Options - -``` - --config string path of kubeconfig (default "/Users/guoxudong/.kube/config") - -h, --help help for kubecm - -m, --mac-notify enable to display Mac notification banner - -s, --silence-table enable/disable output of context table on successful config update - --ui-size int number of list items to show in menu at once (default 4) -``` - -### SEE ALSO - -* [kubecm add](kubecm_add.md) - Add KubeConfig to $HOME/.kube/config -* [kubecm alias](kubecm_alias.md) - Generate alias for all contexts -* [kubecm clear](kubecm_clear.md) - Clear lapsed context, cluster and user -* [kubecm completion](kubecm_completion.md) - Generate completion script -* [kubecm create](kubecm_create.md) - Create new KubeConfig(experiment) -* [kubecm delete](kubecm_delete.md) - Delete the specified context from the kubeconfig -* [kubecm list](kubecm_list.md) - List KubeConfig -* [kubecm merge](kubecm_merge.md) - Merge multiple kubeconfig files into one -* [kubecm namespace](kubecm_namespace.md) - Switch or change namespace interactively -* [kubecm rename](kubecm_rename.md) - Rename the contexts of kubeconfig -* [kubecm switch](kubecm_switch.md) - Switch Kube Context interactively -* [kubecm version](kubecm_version.md) - Print version info - diff --git a/docs/zh-cn/cli/kubecm_add.md b/docs/zh-cn/cli/kubecm_add.md deleted file mode 100644 index 111657eb..00000000 --- a/docs/zh-cn/cli/kubecm_add.md +++ /dev/null @@ -1,54 +0,0 @@ -## kubecm add - -将 KubeConfig 加入到 `$HOME/.kube/config` - -### 简介 - -将 KubeConfig 加入到 `$HOME/.kube/config` - -``` -kubecm add [flags] -``` - -### 示例 - -``` -# Merge test.yaml with $HOME/.kube/config -kubecm add -f test.yaml -# Merge test.yaml with $HOME/.kube/config and add a prefix before context name -kubecm add -cf test.yaml --context-prefix test -# Merge test.yaml with $HOME/.kube/config and define the attributes used for composing the context name -kubecm add -f test.yaml --context-template user,cluster -# Merge test.yaml with $HOME/.kube/config, define the attributes used for composing the context name and add a prefix before context name -kubecm add -f test.yaml --context-template user,cluster --context-prefix demo -# Merge test.yaml with $HOME/.kube/config and override context name, it's useful if there is only one context in the kubeconfig file -kubecm add -f test.yaml --context-name test -# Merge test.yaml with $HOME/.kube/config and select the context to be added in interactive mode -kubecm add -f test.yaml --select-context -# Merge test.yaml with $HOME/.kube/config and specify the context to be added -kubecm add -f test.yaml --context context1,context2 -# Add kubeconfig from stdin -cat /etc/kubernetes/admin.conf | kubecm add -f - -``` - -### 选项 - -``` - --context strings specify the context to be added - --context-name string override context name when add kubeconfig context, when context-name is set, context-prefix and context-template parameters will be ignored - --context-prefix string add a prefix before context name - --context-template strings define the attributes used for composing the context name, available values: filename, user, cluster, context, namespace (default [context]) - -c, --cover overwrite local kubeconfig files - -f, --file string path to merge kubeconfig files - -h, --help help for add - --select-context select the context to be added in interactive mode -``` - -### 全局选项 - -``` - --config string path of kubeconfig (default "/Users/guoxudong/.kube/config") - -m, --mac-notify enable to display Mac notification banner - -s, --silence-table enable/disable output of context table on successful config update - --ui-size int number of list items to show in menu at once (default 4) -``` diff --git a/docs/zh-cn/cli/kubecm_alias.md b/docs/zh-cn/cli/kubecm_alias.md deleted file mode 100644 index 4bf127f8..00000000 --- a/docs/zh-cn/cli/kubecm_alias.md +++ /dev/null @@ -1,38 +0,0 @@ -## kubecm alias - -为所有 contexts 生成 alias,可自动将其注入到 `.zshrc` 或 `.bash_profile` 中。 - -### 简介 - -为所有 contexts 生成 alias,可自动将其注入到 `.zshrc` 或 `.bash_profile` 中。 - -``` -kubecm alias -``` - -### 示例 - -``` - -$ kubecm alias -o zsh -# add context to ~/.zshrc -$ kubecm alias -o bash -# add context to ~/.bash_profile - -``` - -### 选项 - -``` - -h, --help help for alias - -o, --out string output to ~/.zshrc or ~/.bash_profile -``` - -### 全局选项 - -``` - --config string path of kubeconfig (default "/Users/guoxudong/.kube/config") - -m, --mac-notify enable to display Mac notification banner - -s, --silence-table enable/disable output of context table on successful config update - --ui-size int number of list items to show in menu at once (default 4) -``` diff --git a/docs/zh-cn/cli/kubecm_clear.md b/docs/zh-cn/cli/kubecm_clear.md deleted file mode 100644 index 6585efe2..00000000 --- a/docs/zh-cn/cli/kubecm_clear.md +++ /dev/null @@ -1,37 +0,0 @@ -## kubecm clear - -清理 kubeconfig 中失效的 `context`, `cluster` 和 `user` - -### 简介 - -默认情况下会清理 `~/.kube/confg` 中失效的 `context`, `cluster` 和 `user`,后跟非默认的 kubeconfig 路径,可以清理指定文件,支持指定多文件。 - -``` -kubecm clear -``` - -### 示例 - -``` - -# Clear lapsed context, cluster and user (default is /Users/saybot/.kube/config) -kubecm clear -# 自定义清理 -kubecm clear config.yaml test.yaml - -``` - -### Options - -``` - -h, --help help for clear -``` - -### Options inherited from parent commands - -``` - --config string path of kubeconfig (default "/Users/guoxudong/.kube/config") - -m, --mac-notify enable to display Mac notification banner - -s, --silence-table enable/disable output of context table on successful config update - --ui-size int number of list items to show in menu at once (default 4) -``` diff --git a/docs/zh-cn/cli/kubecm_cloud.md b/docs/zh-cn/cli/kubecm_cloud.md deleted file mode 100644 index aa7cbbec..00000000 --- a/docs/zh-cn/cli/kubecm_cloud.md +++ /dev/null @@ -1,32 +0,0 @@ -## kubecm cloud - -管理云上的 KubeConfig - -### Synopsis - -管理云上的 KubeConfig - -### Options - -``` - --cluster_id string kubernetes cluster id - -h, --help help for cloud - --provider string public cloud - --region_id string cloud region id -``` - -### Options inherited from parent commands - -``` - --config string path of kubeconfig (default "/Users/guoxudong/.kube/config") - -m, --mac-notify enable to display Mac notification banner - -s, --silence-table enable/disable output of context table on successful config update - --ui-size int number of list items to show in menu at once (default 4) -``` - -### SEE ALSO - -* [kubecm](kubecm.md) - KubeConfig Manager. -* [kubecm cloud add](kubecm_cloud_add.md) - Add kubeconfig from cloud -* [kubecm cloud list](kubecm_cloud_list.md) - List Cluster from cloud - diff --git a/docs/zh-cn/cli/kubecm_cloud_add.md b/docs/zh-cn/cli/kubecm_cloud_add.md deleted file mode 100644 index 174e7731..00000000 --- a/docs/zh-cn/cli/kubecm_cloud_add.md +++ /dev/null @@ -1,74 +0,0 @@ -## kubecm cloud add - -添加云上的 kubeconfig 到本地 - -### Synopsis - -添加云上的 kubeconfig 到本地 - -``` -kubecm cloud add [flags] -``` - -### Examples - -``` - -# Supports AWS, Ali Cloud, Tencent Cloud and Rancher -# The AK/AS of the cloud platform will be retrieved directly -# if it exists in the environment variable, -# otherwise a prompt box will appear asking for it. - -# Set env AliCloud secret key -export ACCESS_KEY_ID=YOUR_AKID -export ACCESS_KEY_SECRET=YOUR_SECRET_KEY - -# Set env Tencent secret key -export TENCENTCLOUD_SECRET_ID=YOUR_SECRET_ID -export TENCENTCLOUD_SECRET_KEY=YOUR_SECRET_KEY - -# Set env Rancher secret key -export RANCHER_SERVER_URL=https://xxx -export RANCHER_API_KEY=YOUR_API_KEY - -# Set env AWS secret key -# Note: Please install the AWS CLI before normal use. -export AWS_ACCESS_KEY_ID=YOUR_AKID -export AWS_SECRET_ACCESS_KEY=YOUR_SECRET_KEY - -# Set env Azure secret key -export AZURE_SUBSCRIPTION_ID=YOUR_SUBSCRIPTION_ID -export AZURE_CLIENT_ID=YOUR_CLIENT_ID -export AZURE_CLIENT_SECRET=YOUR_CLIENT_SECRET -export AZURE_TENANT_ID=YOUR_TENANT_ID -export AZURE_OBJECT_ID=YOUR_OBJECT_ID - -# Interaction: select kubeconfig from the cloud -kubecm cloud add -# Add kubeconfig from cloud -kubecm cloud add --provider alibabacloud --cluster_id=xxxxxx - -``` - -### Options - -``` - -h, --help help for add -``` - -### Options inherited from parent commands - -``` - --cluster_id string kubernetes cluster id - --config string path of kubeconfig (default "/Users/guoxudong/.kube/config") - -m, --mac-notify enable to display Mac notification banner - -s, --silence-table enable/disable output of context table on successful config update - --provider string public cloud - --region_id string cloud region id - --ui-size int number of list items to show in menu at once (default 4) -``` - -### SEE ALSO - -* [kubecm cloud](kubecm_cloud.md) - Manage kubeconfig from cloud - diff --git a/docs/zh-cn/cli/kubecm_cloud_list.md b/docs/zh-cn/cli/kubecm_cloud_list.md deleted file mode 100644 index 87f8bfd6..00000000 --- a/docs/zh-cn/cli/kubecm_cloud_list.md +++ /dev/null @@ -1,59 +0,0 @@ -## kubecm cloud list - -列举云上的 KubeConfig - -### Synopsis - -列举云上的 KubeConfig - -``` -kubecm cloud list [flags] -``` - -### Examples - -``` - -# Supports Ali Cloud and Tencent Cloud -# The AK/AS of the cloud platform will be retrieved directly -# if it exists in the environment variable, -# otherwise a prompt box will appear asking for it. - -# Set env AliCloud secret key -export ACCESS_KEY_ID=xxx -export ACCESS_KEY_SECRET=xxx -# Set env Tencent secret key -export TENCENTCLOUD_SECRET_ID=xxx -export TENCENTCLOUD_SECRET_KEY=xxx -# Set env Rancher secret key -export RANCHER_SERVER_URL=https://xxx -export RANCHER_API_KEY=xxx -# Interaction: list kubeconfig from cloud -kubecm cloud list -# Add kubeconfig from cloud -kubecm cloud list --provider alibabacloud --cluster_id=xxxxxx - -``` - -### Options - -``` - -h, --help help for list -``` - -### Options inherited from parent commands - -``` - --cluster_id string kubernetes cluster id - --config string path of kubeconfig (default "/Users/guoxudong/.kube/config") - -m, --mac-notify enable to display Mac notification banner - -s, --silence-table enable/disable output of context table on successful config update - --provider string public cloud - --region_id string cloud region id - --ui-size int number of list items to show in menu at once (default 4) -``` - -### SEE ALSO - -* [kubecm cloud](kubecm_cloud.md) - Manage kubeconfig from cloud - diff --git a/docs/zh-cn/cli/kubecm_completion.md b/docs/zh-cn/cli/kubecm_completion.md deleted file mode 100644 index 184c2c68..00000000 --- a/docs/zh-cn/cli/kubecm_completion.md +++ /dev/null @@ -1,183 +0,0 @@ -## `kubecm` completion - -生成自动补全脚本 - -### 简介 - -请根据下面的指南进行操作为普通的 `kubecm` 和 `kubectl kc`(`kubectl` 插件)配置基本的自动补全功能。 - -#### 配置 `kubecm` 的自动补全 - -Bash: - -```shell -$ source <(kubecm completion bash) - -# 可以通过运行一次下面的命令来为将来的每一个 Shell 会话激活自动补全: -# Linux: -$ kubecm completion bash > /etc/bash_completion.d/kubecm - -# macOS: -$ kubecm completion bash > /usr/local/etc/bash_completion.d/kubecm - -# 在执行完毕后,你需要重新打开一个新的终端才能使补全脚本生效。 -``` - -Zsh: - -```shell -# 如果你当前的 zsh 环境中尚未激活自动补全的功能,你需要先激活它。你 -# 可以通过下面的命令来激活: - -$ echo "autoload -U compinit; compinit" >> ~/.zshrc - -# 可以通过运行一次下面的命令来为将来的每一个 Shell 会话激活自动补全: -$ kubecm completion zsh > "${fpath[1]}/_kubecm" - -# 在执行完毕后,你需要重新打开一个新的终端才能使补全脚本生效。 -``` - -fish: - -```shell -# 可以通过运行一次下面的命令来为当前的 Shell 会话激活自动补全: -$ kubecm completion fish | source - -# 可以通过运行一次下面的命令来为将来的每一个 Shell 会话激活自动补全: -$ kubecm completion fish > ~/.config/fish/completions/kubecm.fish - -# 在执行完毕后,你需要重新打开一个新的终端才能使补全脚本生效。 -``` - -PowerShell: - -```shell -# 可以通过运行一次下面的命令来为当前的 Shell 会话激活自动补全: -PS> kubecm completion powershell | Out-String | Invoke-Expression - -# 为将来的每一个 Shell 会话激活自动补全,请执行下面的命令: -PS> kubecm completion powershell > kubecm.ps1 -# 然后在 PowerShell 的 profile 中引入这个文件。 -``` - -#### 为作为 `kubectl` 插件的 `kubecm` 配置自动补全 - -与直接执行 `kubecm` 不同的是,在作为 `kubectl` 插件(即使用 [`krew`](https://krew.sigs.k8s.io/) 安装的 `kubecm`,或者以 `kubectl kc` 的形式调用)执行时,自动补全需要在[配置 `kubecm` 的自动补全](#配置-kubecm-的自动补全)的基础上进行一些额外的配置才能使 `kubectl kc` + TAB 时的自动补全生效。 - -> 原理是什么? -> -> 简而言之,`kubectl` 的插件会在 `$PATH` 环境变量中寻找遵循 `kubectl_complete-<插件名>` 命名规则的可执行文件作为**约定**,然后在调用 `kubectl <插件名>` 的时候由 `kubectl` 展开参数并传递参数给调用这个按约定配置的自动补全脚本。 - -因此,为了使 `kubectl kc` + TAB 的自动补全生效,下面有几种方案。 - -Note: **PowerShell 的自动补全无需额外配置,开箱即用。** - -##### 使用预编写的自动补全脚本 - -你可以通过执行下面的命令来下载预编写的自动补全脚本并完成配置: - -```shell -mkdir -p ~/.config/.kubectl-plugin-completions && \ - curl -LO "https://raw.githubusercontent.com/sunny0826/kubecm/master/hack/kubectl-plugin-completions/kubectl_complete-kc.sh" && \ - mv kubectl_complete-kc.sh ~/.config/.kubectl-plugin-completions/kubectl_complete-kc && \ - chmod +x ~/.config/.kubectl-plugin-completions/kubectl_complete-kc -``` - -将 `~/.config/.kubectl-plugin-completions` 目录追加到 `$PATH` 环境变量中,以满足 `kubectl` 插件的自动补全约定: - -Bash: - -```shell -echo 'export PATH=$PATH:~/.config/.kubectl-plugin-completions' >> ~/.bashrc -``` - -Zsh: - -```shell -echo 'export PATH=$PATH:~/.config/.kubectl-plugin-completions' >> ~/.zshrc -``` - -Fish: - -```shell -fish_add_path ~/.config/.kubectl-plugin-completions -``` - -##### 手动创建 - -1. 创建用于放置自动补全脚本的目录 `.config/.kubectl-plugin-completions`: - -```shell -mkdir -p ~/.config/.kubectl-plugin-completions -``` - -2. 填充下面的内容到该目录下一个名为 `kubectl_complete-kc` 的可执行文件中: - -```shell -#!/usr/bin/env sh - -# Call the __complete command passing it all arguments -kubectl kc __complete "$@" -``` - -你也可以通过下面的命令来一次性完成这一步骤: - -```shell -cat <Xudong Guo 💻 📖 🚧 |
- Cheng Wang 💻 |
- Neko Ayaka 💻 |
- l1b0k 💻 |
- Zhizhen He 💻 |
- Hang Yu 💻 |
- dennislapchenko 💻 |
-
cnfatal 💻 |
- Se7en 💻 📖 |
- Yarden Shoham 💻 ⚠️ 📖 |
- Vimsucks 💻 |
- Shunsuke Suzuki 💻 |
- YS Liu 💻 |
- Sarun Nuntaviriyakul 💻 |
-
Max Anderson 💻 |
- Mario Fritschen 💻 |
- Jia Sui 💻 |
- AdamRussak 💻 |
- Rui Chen 🚇 |
- Michael Burman 🐛 💻 |
- Jan-Otto Kröpke 💻 |
-
yxxhero 💻 |
- ||||||
- - Add your contributions - - | -