2

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

牧场主集群.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已经在运行。

在此处输入图像描述

我已经打开了端口

firewall-cmd --zone=public --add-port=6443/tcp --permanent
firewall-cmd --reload
4

1 回答 1

1

问题是 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
于 2020-08-09T07:29:51.717 回答