docker - "kubeadm init"设置高可用集群失败

标签 docker ubuntu kubernetes ubuntu-18.04

我尝试为 Kubernetes 设置一个 haproxy 的多主节点设置,如 [ 1 中所述。 ]。我的网络配置是:

  • haproxy = 192.168.1.213
  • master0|1|2 = 192.168.1.210|211|212
  • worker0|1|2 = 192.168.1.220|221|222(此时不感兴趣)

  • 所有主机都能够相互连接(为每个节点解析 DNS)。每个节点都运行 Ubuntu 18.04.3 (LTS)。 Docker 安装为
  • docker.io/bionic-updates,bionic-security,now 18.09.7-0ubuntu1~18.04.4 amd64 [已安装]

  • 当前安装的 Kubernetes 包是
  • kubeadm/kubernetes-xenial,现在 1.16.3-00 amd64 [已安装]
  • kubectl/kubernetes-xenial,现在 1.16.3-00 amd64 [已安装]
  • kubelet/kubernetes-xenial,现在 1.16.3-00 amd64 [已安装,自动]
  • kubernetes-cni/kubernetes-xenial,现在 0.7.5-00 amd64 [已安装,自动]

  • 使用 [ 2 中所述的附加存储库](我知道我已经在我的虚拟机上安装了 bionic,但可用的“最新”存储库仍然是 xenial)。

    我的 haproxy 安装为 haproxy/bionic,now 2.0.9-1ppa1~bionic amd64 [installed]来自 [ 3 ] 存储库。
    global
        log /dev/log        local0
        log /dev/log        local1 notice
        chroot /var/lib/haproxy
        stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
        stats timeout 30s
        user haproxy
        group haproxy
        daemon
    
    defaults
        log global
        mode http
        retries 2
        timeout connect 3000ms
        timeout client  5000ms
        timeout server  5000ms
    
    frontend kubernetes
        bind        *:6443
        option      tcplog
        mode        tcp
        default_backend kubernetes-master-nodes
    
    backend kubernetes-master-nodes
        mode    tcp
        balance roundrobin
        option  tcp-check
        server  master0 192.168.1.210:6443 check fall 3 rise 2
        server  master1 192.168.1.211:6443 check fall 3 rise 2
        server  master2 192.168.1.212:6443 check fall 3 rise 2
    

    在尝试设置我的第一个控制平面时,运行 kubeadm init --control-plane-endpoint "haproxy.my.lan:6443" --upload-certs -v=6如 [ 4 中所述] 导致此错误:
    Error writing Crisocket information for the control-plane node
    

    完整登录 [ 5 ]。如果我的 haproxy 配置有错误,或者 docker 或 kubernetes 本身可能有问题,我会很迷茫。

    我的 /etc/docker/daemon.json看起来像这样:
    {
      "exec-opts": ["native.cgroupdriver=systemd"],
      "log-driver": "json-file",
      "log-opts": {
        "max-size": "100m"
      },
      "storage-driver": "overlay2"
    }
    
  • [1] https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/high-availability/
  • [2] https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-using-native-package-management
  • [3] https://launchpad.net/~vbernat/+archive/ubuntu/haproxy-2.0
  • [4] https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/high-availability/#stacked-control-plane-and-etcd-nodes
  • [5] https://pastebin.com/QD5mbiyN
  • 最佳答案

    虽然无法找到合适的解决方案并在 github 的原始“kubeadm”项目中创建了问题,但请参见此处:https://github.com/kubernetes/kubeadm/issues/1930 .

    由于问题中建议的“分类”对我来说是不可行的(Ubuntu 几乎是“设置”),所以我最终设置了另一个 Docker 发行版,如下所述:https://docs.docker.com/install/linux/docker-ce/ubuntu/ , 在开始新设置之前清除已安装的分发。

    运行 Docker 时(社区)v19.03.5通过 kubeadm v1.16.3引发以下警告:

    [WARNING SystemVerification]: this Docker version is not on the list of validated versions: 19.03.5. Latest validated version: 18.09
    

    结果非常好,我设法设置了我的 ha 集群,如原始文档中所述。

    所以,这可以被认为是 解决方法 ,不作为我原来问题的解决方案!

    关于docker - "kubeadm init"设置高可用集群失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58957937/

    相关文章:

    kubernetes - istio 入口网关的外部 IP 保持等待状态

    docker - 在 docker 容器中运行 Jenkins 有什么好处

    linux - 加载共享库时出错 : libssl. so.10:无法在 Docker 中打开共享对象文件

    linux - 502 错误网关 HAproxy

    python - 安装了 Sql Server 的 Ubuntu 16.04 上的 Pyodbc 安装错误

    kubernetes - 当NFS服务器关闭时,如何在kubernetes中安装Pod

    logging - 使用 Sidecar 模式进行 Kubernetes 日志收集

    docker - 自动将日志从Docker容器保存到文件

    docker - 了解Docker链接中的源容器和目标容器

    node.js - npm install, node-gyp build error 仅在两台相同机器中的一台上