【问题标题】:Kubectl fails to address correct cluster on EKS and addresses localhost insteadKubectl 无法寻址 EKS 上的正确集群,而是寻址本地主机
【发布时间】:2022-11-14 10:08:28
【问题描述】:

我正在研究 EKS(AWS 管理的 Kubernetes),每当我尝试使用 kubectl 时,我都会收到此消息。 到目前为止我为配置我的配置所做的工作:

  1. 我已经设置了上下文

    kubectl 配置集上下文 arn:aws:eks:eu-west-1:myaccountid:cluster/myclustername

  2. 我已经切换到这个上下文

    kubectl 配置使用上下文 arn:aws:eks:eu-west-1:myaccountid:cluster/myclustername

  3. 验证我确实在正确的上下文中

    kubectl 配置获取上下文

    收到了我当前集群的 arn 而且,是的,我已经完成了aws eks update-kubeconfig --name <EKS_Cluster_Name> --region <Region_Name> 但是当我尝试使用最简单的命令时,例如

    kubectl cluster-info dump
    

    或任何其他 kubectl 命令,我都会收到

    Unable to connect to the server: dial tcp [::1]:8080: connectex: No connection could be made because the target machine actively refused it.
    

    或者

    The connection to the server localhost:8080 was refused - did you specify the right host or port?
    

    如果上下文设置为特定集群,为什么它会尝试连接到本地主机?我该如何纠正这个问题?

【问题讨论】:

    标签: amazon-eks


    【解决方案1】:

    做过

    kubectl --kubeconfig ~/.kube/config  get nodes
    

    出于某种原因,在我收到我的节点后,一切都开始工作了

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-25
      • 1970-01-01
      • 2017-04-02
      • 2015-12-22
      • 2017-12-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多