kubernetes1.7新特:kubectl支撐中文字符集
阿新 • • 發佈:2018-12-31
背景介紹
在Kubernetes架構圖中可以看到,節點(Node)是一個由管理節點委託執行任務的worker。 它能執行一個或多個Pods,節點(Node)提供了執行容器環境所需要的所有必要條件,在Kubernetes最初版本中叫做Minion。
從這張圖上可以看到,kubectl是對Kubernetes叢集進行管理的命令列工具。
1.7新特性
Kubernetes是通過作業系統LANG環境變數來獲取要顯示的語言字符集的,將來會考慮通過引數或者配置檔案來獲取要顯示的語言字符集。在Kubernetes1.7版本中通過i18n有限的增加了三種語言字符集,其中包括繁體中文、簡體中文和日語。
其中對於簡體中文字符集增加的內容如下所示:
#: pkg/kubectl/cmd/apply.go:104 msgid "Apply a configuration to aresource by filename or stdin" msgstr "通過檔名或標準輸入流(stdin)對資源進行配置。" #: pkg/kubectl/cmd/config/delete_cluster.go:39 msgid "Delete the specified clusterfrom the kubeconfig" msgstr "刪除 kubeconfig 檔案中指定的叢集" #:pkg/kubectl/cmd/config/delete_context.go:39 msgid "Delete the specified contextfrom the kubeconfig" msgstr "刪除 kubeconfig 檔案中指定的上下文" #:pkg/kubectl/cmd/config/get_contexts.go:64 msgid "Describe one or manycontexts" msgstr "描述一個或多個上下文" #:pkg/kubectl/cmd/config/get_clusters.go:41 msgid "Display clusters defined in thekubeconfig" msgstr "顯示 kubeconfig 檔案中定義的叢集" #: pkg/kubectl/cmd/config/view.go:67 msgid "Display merged kubeconfigsettings or a specified kubeconfig file" msgstr "顯示合併的 kubeconfig 配置或一個指定的kubeconfig 檔案" #:pkg/kubectl/cmd/config/current_context.go:49 msgid "Displays thecurrent-context" msgstr "顯示當前的上下文" #: pkg/kubectl/cmd/config/config.go:40 msgid "Modify kubeconfig files" msgstr "修改 kubeconfig 檔案" #:pkg/kubectl/cmd/config/create_cluster.go:68 msgid "Sets a cluster entry inkubeconfig" msgstr "設定 kubeconfig 檔案中的一個叢集條目" #: pkg/kubectl/cmd/config/create_context.go:58 msgid "Sets a context entry inkubeconfig" msgstr "設定 kubeconfig 檔案中的一個上下文條目" #:pkg/kubectl/cmd/config/create_authinfo.go:104 msgid "Sets a user entry inkubeconfig" msgstr "設定 kubeconfig 檔案中的一個使用者條目" #: pkg/kubectl/cmd/config/set.go:60 msgid "Sets an individual value in akubeconfig file" msgstr "設定 kubeconfig 檔案中的一個單個值" #: pkg/kubectl/cmd/config/use_context.go:49 msgid "Sets the current-context in akubeconfig file" msgstr "設定 kubeconfig 檔案中的當前上下文" #: pkg/kubectl/cmd/config/unset.go:48 msgid "Unsets an individual value in akubeconfig file" msgstr "取消設定 kubeconfig 檔案中的一個單個值" #: pkg/kubectl/cmd/annotate.go:116 msgid "Update the annotations on aresource" msgstr "更新一個資源的註解" msgid "" "watch is only supported on individualresources and resource collections - " "%d resources were found" msgid_plural "" "watch is only supported on individualresources and resource collections - " "%d resources were found" msgstr[0] "watch 僅支援單獨的資源或者資源集合- 找到了 %d 個資源" msgstr[1] "watch 僅支援單獨的資源或者資源集合- 找到了 %d 個資源"
如果當前作業系統上LANG環境變數設定成了zh_CN,那麼在執行上述命令時就會顯示簡體中文字符集,同理,如果LANG環境變數設定成了zh_TW,那麼就會顯示繁體中文字符集,如果LANG環境變數設定成了ja_JP,那麼就會顯示日文字符集。