首页 > 解决方案 > k3s 获取 Kubernetes 服务器版本失败:获取 https://10.43.0.1:443/version?timeout=32s: dial tcp 10.43.0.1:443: connect: connection refused”

问题描述

我有一个奇怪的问题,我无法理解。在 ubuntu 服务器 18.04 LTS 上运行带有外部 mysql 数据库的 k3s 集群,预安装的所有 pod 都在运行。我将我的 k3s 集群连接到 GitLab,并想在我的集群上安装 Prometheus 和 Runners。但是,pod 安装失败并显示:

Error: looks like "https://gitlab-org.gitlab.io/cluster-integration/helm-stable-archive" is not a valid chart repository or cannot be reached: Get https://gitlab-org.gitlab.io/cluster-integration/helm-stable-archive/index.yaml: dial tcp: lookup gitlab-org.gitlab.io on 10.43.0.10:53: read udp 10.42.0.57:53088->10.43.0.10:53: read: connection refused

ufw 被禁用环顾四周我发现这可能是一个 iptables 问题,所以我尝试添加一些规则:

iptables -I INPUT 3 -s 10.42.0.0/16 -j ACCEPT
iptables -I INPUT 3 -d 10.42.0.0/16 -j ACCEPT

这没有帮助:

我也试过:

sudo iptables -A INPUT -s 10.42.0.0/16 -d <host_ip> -j ACCEPT

还尝试刷新重新安装 k3s 等。似乎没有任何效果。

标签: ubuntugitlabiptablesk3s

解决方案


推荐阅读