Kubeadm join fail. Is my master cluster IP 192.168.0.9 or 10.96.0.1?

2/7/2019

When I run the kubeadm token create --print-join-command, I get this:

"kubeadm join 192.168.0.9:6443 --token ff9ega.4ad2z5yn2gicfvmc --discovery-token-ca-cert-hash sha256:66884e1573b3aa1644ba5c724a53703d2c497f9c0e9131325866057937e8c154"

When I run that join command on my node, I get this error:

[discovery] Trying to connect to API Server "192.168.0.9:6443" [discovery] Created cluster-info discovery client, requesting info from "https://192.168.0.9:6443" [discovery] Failed to request cluster info, will try again: [Get https://192.168.0.9:6443/api/v1/namespaces/kube-public/configmaps/cluster-info: dial tcp 192.168.0.9:6443: i/o timeout]

When I run a kubectl get svc kubernetes -o yaml

I get this, showing a cluster IP of 10.96.0.1:

"apiVersion: v1 kind: Service metadata: creationTimestamp: "2019-02-07T00:44:45Z" labels: component: apiserver provider: kubernetes name: kubernetes namespace: default resourceVersion: "6" selfLink: /api/v1/namespaces/default/services/kubernetes uid: 833b1756-2a71-11e9-9ef2-fa163ec9e592 spec: clusterIP: 10.96.0.1 ports: - name: https port: 443 protocol: TCP targetPort: 6443 sessionAffinity: None type: ClusterIP status: loadBalancer: {}"

-- user1348692
kubeadm
kubernetes

2 Answers

4/22/2019

You can advertise that IP address which is accessible from your nodes.

sudo kubeadm init --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=192.168.0.9

If you have executed kubeadm init. You can revert any changes made by kubeadm init or kubeadm join.

kubeadm reset

After this, you can run it again.

sudo kubeadm init --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=192.168.0.9
-- Karen Danielyan
Source: StackOverflow

2/7/2019

10.96.0. 1 is api server container ip address which is rout able inside k8s cluster. The other ip you mentioned that is 192.168.0.9 is the master server ip address. Ensure nodes can reach the master server before you run join command

-- P Ekambaram
Source: StackOverflow