gpt4 book ai didi

docker - 无法访问kubernetes + rancher中的KubeAPI端口

转载 作者:行者123 更新时间:2023-12-02 11:43:55 24 4
gpt4 key购买 nike

我有以下配置来启动rke。当我启动rke时。我得到了错误。

rancher-cluster.yml

nodes:
- address: 192.168.88.246
internal_address: 172.17.0.1
user: dockeruser
role: [controlplane,worker,etcd]
- address: 192.168.88.243
internal_address: 172.17.0.1
user: dockeruser
role: [controlplane,worker,etcd]
- address: 192.168.88.245
internal_address: 172.17.0.1
user: dockeruser
role: [controlplane,worker,etcd]

services:
etcd:
snapshot: true
creation: 6h
retention: 24h

当我启动 rke时,出现以下错误
FATA[0059] [network] Can't access KubeAPI port [6443] on Control Plane host: 192.168.88.245

详细日志
[root@localhost ~]# rke up --config ./rancher-cluster.yml
INFO[0000] Building Kubernetes cluster
INFO[0000] [dialer] Setup tunnel for host [192.168.88.243]
INFO[0000] [dialer] Setup tunnel for host [192.168.88.245]
INFO[0000] [dialer] Setup tunnel for host [192.168.88.246]
INFO[0001] [state] Found local kube config file, trying to get state from cluster
INFO[0001] [reconcile] Local config is not valid, rebuilding admin config
INFO[0001] [reconcile] Rebuilding and updating local kube config
INFO[0001] Successfully Deployed local admin kubeconfig at [./kube_config_rancher-cluster.yml]
INFO[0014] Successfully Deployed local admin kubeconfig at [./kube_config_rancher-cluster.yml]
INFO[0026] Successfully Deployed local admin kubeconfig at [./kube_config_rancher-cluster.yml]
INFO[0026] [state] Fetching cluster state from Kubernetes
INFO[0056] Timed out waiting for kubernetes cluster to get state
INFO[0056] [state] Fetching cluster state from Nodes
INFO[0057] [network] Deploying port listener containers
INFO[0058] [network] Successfully started [rke-etcd-port-listener] container on host [192.168.88.246]
INFO[0058] [network] Successfully started [rke-etcd-port-listener] container on host [192.168.88.243]
INFO[0058] [network] Successfully started [rke-etcd-port-listener] container on host [192.168.88.245]
INFO[0059] [network] Successfully started [rke-worker-port-listener] container on host [192.168.88.243]
INFO[0059] [network] Successfully started [rke-worker-port-listener] container on host [192.168.88.246]
INFO[0059] [network] Successfully started [rke-worker-port-listener] container on host [192.168.88.245]
INFO[0059] [network] Port listener containers deployed successfully
INFO[0059] [network] Running etcd <-> etcd port checks
INFO[0060] [network] Successfully started [rke-port-checker] container on host [192.168.88.246]
INFO[0060] [network] Successfully started [rke-port-checker] container on host [192.168.88.243]
INFO[0060] [network] Successfully started [rke-port-checker] container on host [192.168.88.245]
INFO[0060] [network] Running control plane -> etcd port checks
INFO[0061] [network] Successfully started [rke-port-checker] container on host [192.168.88.246]
INFO[0061] [network] Successfully started [rke-port-checker] container on host [192.168.88.243]
INFO[0061] [network] Successfully started [rke-port-checker] container on host [192.168.88.245]
INFO[0061] [network] Running control plane -> worker port checks
INFO[0061] [network] Successfully started [rke-port-checker] container on host [192.168.88.246]
INFO[0061] [network] Successfully started [rke-port-checker] container on host [192.168.88.245]
INFO[0061] [network] Successfully started [rke-port-checker] container on host [192.168.88.243]
INFO[0061] [network] Running workers -> control plane port checks
INFO[0062] [network] Successfully started [rke-port-checker] container on host [192.168.88.245]
INFO[0062] [network] Successfully started [rke-port-checker] container on host [192.168.88.243]
INFO[0062] [network] Successfully started [rke-port-checker] container on host [192.168.88.246]
INFO[0062] [network] Checking KubeAPI port Control Plane hosts
FATA[0062] [network] Can't access KubeAPI port [6443] on Control Plane host: 192.168.88.245
[root@localhost ~]# rke up --config ./rancher-cluster.yml
INFO[0000] Building Kubernetes cluster
INFO[0000] [dialer] Setup tunnel for host [192.168.88.246]
INFO[0000] [dialer] Setup tunnel for host [192.168.88.243]
INFO[0001] [dialer] Setup tunnel for host [192.168.88.245]
INFO[0001] [state] Found local kube config file, trying to get state from cluster
INFO[0001] [reconcile] Local config is not valid, rebuilding admin config
INFO[0001] [reconcile] Rebuilding and updating local kube config
INFO[0001] Successfully Deployed local admin kubeconfig at [./kube_config_rancher-cluster.yml]
INFO[0011] Successfully Deployed local admin kubeconfig at [./kube_config_rancher-cluster.yml]
INFO[0023] Successfully Deployed local admin kubeconfig at [./kube_config_rancher-cluster.yml]
INFO[0023] [state] Fetching cluster state from Kubernetes
INFO[0053] Timed out waiting for kubernetes cluster to get state
INFO[0053] [state] Fetching cluster state from Nodes
INFO[0054] [network] Deploying port listener containers
INFO[0055] [network] Successfully started [rke-etcd-port-listener] container on host [192.168.88.245]
INFO[0055] [network] Successfully started [rke-cp-port-listener] container on host [192.168.88.243]
INFO[0056] [network] Successfully started [rke-worker-port-listener] container on host [192.168.88.245]
INFO[0056] [network] Port listener containers deployed successfully
INFO[0056] [network] Running etcd <-> etcd port checks
INFO[0056] [network] Successfully started [rke-port-checker] container on host [192.168.88.243]
INFO[0056] [network] Successfully started [rke-port-checker] container on host [192.168.88.246]
INFO[0056] [network] Successfully started [rke-port-checker] container on host [192.168.88.245]
INFO[0057] [network] Running control plane -> etcd port checks
INFO[0057] [network] Successfully started [rke-port-checker] container on host [192.168.88.246]
INFO[0057] [network] Successfully started [rke-port-checker] container on host [192.168.88.245]
INFO[0057] [network] Successfully started [rke-port-checker] container on host [192.168.88.243]
INFO[0057] [network] Running control plane -> worker port checks
INFO[0058] [network] Successfully started [rke-port-checker] container on host [192.168.88.245]
INFO[0058] [network] Successfully started [rke-port-checker] container on host [192.168.88.246]
INFO[0058] [network] Successfully started [rke-port-checker] container on host [192.168.88.243]
INFO[0058] [network] Running workers -> control plane port checks
INFO[0058] [network] Successfully started [rke-port-checker] container on host [192.168.88.246]
INFO[0058] [network] Successfully started [rke-port-checker] container on host [192.168.88.245]
INFO[0059] [network] Successfully started [rke-port-checker] container on host [192.168.88.243]
INFO[0059] [network] Checking KubeAPI port Control Plane hosts
FATA[0059] [network] Can't access KubeAPI port [6443] on Control Plane host: 192.168.88.245

在192.168.88.24(节点)中, kube-apiserver已经在运行。

enter image description here

我已经打开了端口
firewall-cmd --zone=public --add-port=6443/tcp --permanent
firewall-cmd --reload

最佳答案

问题是internal_address IP都一样。此设置用于设置节点在节点到节点的连接上应使用的IP地址。
当您的服务器位于NAT之后时,我们通常会看到此选项。
请尝试以下cluster.yml

nodes:
- address: 192.168.88.246
internal_address: 192.168.88.246
user: dockeruser
role: [controlplane,worker,etcd]
- address: 192.168.88.243
internal_address: 192.168.88.243
user: dockeruser
role: [controlplane,worker,etcd]
- address: 192.168.88.245
internal_address: 192.168.88.245
user: dockeruser
role: [controlplane,worker,etcd]

services:
etcd:
snapshot: true
creation: 6h
retention: 24h

关于docker - 无法访问kubernetes + rancher中的KubeAPI端口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54513414/

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