gpt4 book ai didi

kubernetes - 大三角帆/吊索 : Unable to communicate with the Kubernetes cluster

转载 作者:行者123 更新时间:2023-12-02 11:29:32 26 4
gpt4 key购买 nike

我正在尝试在多节点上部署大三角帆。我有 2 个虚拟机:第一个带有 halyard 和 kubectl,第二个包含 kubernetes master api。
我的 kubectl 配置良好,能够与远程 kubernetes api 通信,

“kubectl get namespaces” 有效

kubectl get namespaces
NAME STATUS AGE
default Active 16d
kube-public Active 16d
kube-system Active 16d

但是当我运行这个 cmd
hal config provider -d kubernetes account add spin-kubernetes --docker-registries myregistry 
I get this error
Add the spin-kubernetes account
Failure
Problems in default.provider.kubernetes.spin-kubernetes:
- WARNING You have not specified a Kubernetes context in your
halconfig, Spinnaker will use "default-system" instead.
? We recommend explicitly setting a context in your halconfig, to
ensure changes to your kubeconfig won't break your deployment.
? Options include:
- default-system

! ERROR Unable to communicate with your Kubernetes cluster:
Operation: [list] for kind: [Namespace] with name: [null] in namespace:
[null] failed..
? Unable to authenticate with your Kubernetes cluster. Try using
kubectl to verify your credentials.

- Failed to add account spin-kubernetes for provider
kubernetes.

最佳答案

从错误消息中似乎有两种方法可以解决此问题,将您的 halconfig 设置为与默认系统上下文对话,以便它可以与您的集群通信,或者反过来,即配置您的上下文。

尝试这个:

kubectl config view

我想你会看到那里的上下文和当前上下文是默认系统,请尝试更改它们。
如需更多帮助,请执行
kubectl config --help

我猜您正在寻找 set-context 选项。
希望有帮助。

关于kubernetes - 大三角帆/吊索 : Unable to communicate with the Kubernetes cluster,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44907972/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com