如何让 mobaxterm 与 kubectl 一起使用?

如何让 mobaxterm 与 kubectl 一起使用?

与 kubectl 一起使用时,mobaxterm 无法读取 kube 配置设置。

我使用的是 MobaXterm_21.2 安装版本。当我运行 - kubectl 版本时,它按预期工作

 kubectl version
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.3", GitCommit:"5e53fd6bc17c0dec8434817e69b04a25d8ae0ff0", GitTreeState:"clean", BuildDate:"2019-06-06T01:44:30Z", G
oVersion:"go1.12.5", Compiler:"gc", Platform:"windows/amd64"}
Unable to connect to the server: dial tcp [::1]:8080: connectex: No connection could be made because the target machine actively refused it.  

但它无法读取 .kube/config 文件或无法获取通过 ENV 变量 KUBECONFIG 或 --kubeconfig 给出的配置文件。见下面的回复

  export KUBECONFIG=/drives/path/to/config/file.config

  kubectl config view
apiVersion: v1
clusters: []
contexts: []
current-context: ""
kind: Config
preferences: {}
users: []

                                                                                                                                                                                    

而且下面都没有工作 -

 kubectl config --kubeconfig=/drives/path/to/config/file.config  view
apiVersion: v1
clusters: []
contexts: []
current-context: ""
kind: Config
preferences: {}
users: []

这对我来说是一种阻碍问题。谁能指导我如何让 kubectl 在 mobaxterm 中工作。任何帮助将不胜感激。

相关内容