首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在Argo CD中添加其他种类的集群

无法在Argo CD中添加其他种类的集群
EN

Stack Overflow用户
提问于 2022-11-01 09:44:20
回答 1查看 56关注 0票数 0

我的本地机器上有两种集群。一个被命名为dev集群,另一个命名为kind.The Argo,它部署并运行在dev集群上。当我尝试使用argocd cluster add kind-kind --name stage命令将第二个集群添加到Argo CD时,我得到以下错误

代码语言:javascript
复制
WARNING: This will create a service account `argocd-manager` on the cluster referenced by context `kind-kind` with full cluster level privileges. Do you want to continue [y/N]? y
INFO[0005] ServiceAccount "argocd-manager" already exists in namespace "kube-system" 
INFO[0005] ClusterRole "argocd-manager-role" updated    
INFO[0005] ClusterRoleBinding "argocd-manager-role-binding" updated 
FATA[0005] rpc error: code = Unknown desc = Get "https://127.0.0.1:45249/version?timeout=32s": dial tcp 127.0.0.1:45249: connect: connection refused

“`kubectl config get上下文”的输出是

代码语言:javascript
复制
CURRENT   NAME               CLUSTER            AUTHINFO           NAMESPACE
*         kind-dev-cluster   kind-dev-cluster   kind-dev-cluster   
          kind-kind          kind-kind          kind-kind          

我尝试使用kubectl port-forward kube-apiserver-kind-control-plane -n kube-system --context kind-kind 45249:45249将一个端口转发到端口45249,并尝试在Argo中添加集群。

此外,我还尝试使用其节点ip将第二个集群添加到Argo CD中。

代码语言:javascript
复制
kubectl get nodes -o wide --context kind-kind

NAME                 STATUS   ROLES           AGE   VERSION   INTERNAL-IP   EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION      CONTAINER-RUNTIME
kind-control-plane   Ready    control-plane   42d   v1.25.0   172.18.0.3    <none>        Ubuntu 22.04.1 LTS   5.15.0-52-generic   containerd://1.6.7
代码语言:javascript
复制
argocd cluster add kind-kind --name stage --server 172.18.0.3:45249

WARNING: This will create a service account `argocd-manager` on the cluster referenced by context `kind-kind` with full cluster level privileges. Do you want to continue [y/N]? y
INFO[0001] ServiceAccount "argocd-manager" already exists in namespace "kube-system" 
INFO[0001] ClusterRole "argocd-manager-role" updated    
INFO[0001] ClusterRoleBinding "argocd-manager-role-binding" updated 
FATA[0001] Failed to establish connection to 172.18.0.3:45249: dial tcp 172.18.0.3:45249: connect: connection refused 

对于这两种情况,都显示了相同的错误。

EN

回答 1

Stack Overflow用户

发布于 2022-11-01 12:11:36

我找到了解决办法。

第二个集群的默认命名空间中的服务kubernetes是一种ClusterIP类型。我已将其更改为NodePort服务。我的kubeconfig使用ip和端口作为第二个集群的127.0.0.1:45249。我将其更改为第二个集群172.18.0.3:31413的kubernetes服务的节点ip地址和172.18.0.3:31413

代码语言:javascript
复制
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: DATA+OMITTED
    server: https://127.0.0.1:44135
  name: kind-dev-cluster
- cluster:
    certificate-authority-data: DATA+OMITTED
    server: https://172.18.0.3:31413
  name: kind-kind
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74274016

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档