【问题标题】:How to fix host-port issue on kubernetes dashboard setup on linux?如何修复 linux 上 kubernetes 仪表板设置上的主机端口问题?
【发布时间】:2020-02-17 06:13:32
【问题描述】:

在尝试安装 Kubernetes 仪表板时,在 Amazon Linux 机器中出现了一个无法预测的错误。

这是 AWS 中的新 Amazon Linux 服务器,在安装 Kubernetes 控制面板时出现有关主机和端口问题的错误,但没有将其配置为新服务器。而且我已经安装了 kubectl 和 awscli 进行检查,但它不起作用。我已经尝试了所有社区支持,但没有像我这样的问题。

在运行命令时

$ kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml 

它会抛出错误

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

【问题讨论】:

  • 你试过这样安装吗? kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta4/aio/deploy/recommended.yamlinstalletion guide
  • 是的,我试过了,同样的错误又抛出了
  • ```无法识别“raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta4/aio/…”:获取localhost:8080/api?timeout=32s:拨打tcp 127.0.0.1:8080:连接:连接被拒绝```
  • 您是否只在创建新资源时遇到此问题?像kubectl get nodeskubectl get pods 这样对api-server 进行调用的其他操作呢?
  • 你确定你kubectl 有效吗?

标签: linux docker kubernetes amazon-linux kubernetes-dashboard


【解决方案1】:

setup kubectl correctly

KUBECONFIG 中添加 admin.conf(您的集群配置)

例子:

export KUBECONFIG=$HOME/.kube/admin.conf

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-06-18
    • 2018-02-17
    • 2020-01-23
    • 2019-05-22
    • 2018-01-21
    • 2018-08-30
    • 2021-06-18
    • 2020-10-31
    相关资源
    最近更新 更多