I configure kubernetes multi masters, which should have 2 masters.

On the skin, I start the installation with an indication of the config:

kubeadm init --config = config.yaml

apiVersion: kubeadm.k8s.io/v1alpha3 kind: ClusterConfiguration etcd: endpoints: - https://172.16.100.33:2379 - https://172.16.100.34:2379 caFile: /etc/kubernetes/pki/etcd/ca.pem certFile: /etc/kubernetes/pki/etcd/client.pem keyFile: /etc/kubernetes/pki/etcd/client-key.pem networking: podSubnet: 10.244.0.0/16 

The result is successful. I transfer certificates from one server to another and run a similar command.

But both masters do not see each other:

 kubectl get nodes NAME STATUS ROLES AGE VERSION master4.nullgr.com Ready master 15m v1.12.1 kubectl get node NAME STATUS ROLES AGE VERSION master3.nullgr.com Ready master 27m v1.12.1 

What could be the problem?

    2 answers 2

    The problem was solved by installing the External etcd cluster and adding an external line to the config.yaml file

      apiVersion: kubeadm.k8s.io/v1alpha3 kind: ClusterConfiguration api: advertiseAddress: 172.16.100.33 etcd: external: endpoints: - https://172.16.100.33:2379 - https://172.16.100.34:2379 caFile: /etc/kubernetes/pki/etcd/ca.pem certFile: /etc/kubernetes/pki/etcd/client.pem keyFile: /etc/kubernetes/pki/etcd/client-key.pem keyFile: /etc/kubernetes/pki/etcd/client-key.pem networking: podSubnet: 10.244.0.0/16 

      here is a working example of an init config for a 3 master cluster. etcd on wizards. for each node in the config you need to change the advertiseAddress and nodeName

       apiVersion: kubeadm.k8s.io/v1alpha1 kind: MasterConfiguration api: advertiseAddress: 10.0.2.251 etcd: endpoints: - "http://10.0.2.250:2379" - "http://10.0.2.251:2379" - "http://10.0.2.252:2379" apiServerExtraArgs: storage-backend: etcd3 service-node-port-range: "80-32767" networking: podSubnet: 10.244.0.0/16 nodeName: kuberm2 kubernetesVersion: v1.10.0 apiServerCertSANs: - "10.0.2.250" - "10.0.2.251" - "10.0.2.252" - "127.0.0.1" - "kub.api.damain.ru" token: "9o9333333333q7uib" tokenTTL: "0"