0

by following the information in this video, I was able to get a control plane running on my kmaster vm.

jason@kmaster:~$ kubectl get pods -A
NAMESPACE     NAME                                       READY   STATUS    RESTARTS   AGE
kube-system   calico-kube-controllers-59697b644f-tpxnn   1/1     Running   0          18h
kube-system   calico-node-88l8f                          1/1     Running   0          18h
kube-system   coredns-565d847f94-vpzwg                   1/1     Running   0          18h
kube-system   coredns-565d847f94-wkv4p                   1/1     Running   0          18h
kube-system   etcd-kmaster                               1/1     Running   0          18h
kube-system   kube-apiserver-kmaster                     1/1     Running   0          18h
kube-system   kube-controller-manager-kmaster            1/1     Running   0          18h
kube-system   kube-proxy-wd2gh                           1/1     Running   0          18h
kube-system   kube-scheduler-kmaster                     1/1     Running   0          18h

Here are my network interfaces:

jason@kmaster:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether e6:ec:4b:b8:37:7a brd ff:ff:ff:ff:ff:ff
    altname enp0s18
    inet 10.0.10.118/24 brd 10.0.10.255 scope global ens18
       valid_lft forever preferred_lft forever
    inet6 2600:8802:5700:46d::164d/128 scope global dynamic noprefixroute
       valid_lft 4863sec preferred_lft 2163sec
    inet6 2600:8802:5700:46d:e4ec:4bff:feb8:377a/64 scope global dynamic mngtmpaddr noprefixroute
       valid_lft 86385sec preferred_lft 14385sec
    inet6 fe80::e4ec:4bff:feb8:377a/64 scope link
       valid_lft forever preferred_lft forever
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
    link/ether 02:42:bb:62:1c:c5 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
4: calida7207728a2@if3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether ee:ee:ee:ee:ee:ee brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet6 fe80::ecee:eeff:feee:eeee/64 scope link
       valid_lft forever preferred_lft forever
5: cali919c5dc3a63@if3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether ee:ee:ee:ee:ee:ee brd ff:ff:ff:ff:ff:ff link-netnsid 1
    inet6 fe80::ecee:eeff:feee:eeee/64 scope link
       valid_lft forever preferred_lft forever
6: cali0657a847784@if3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether ee:ee:ee:ee:ee:ee brd ff:ff:ff:ff:ff:ff link-netnsid 2
    inet6 fe80::ecee:eeff:feee:eeee/64 scope link
       valid_lft forever preferred_lft forever
7: tunl0@NONE: <NOARP,UP,LOWER_UP> mtu 1480 qdisc noqueue state UNKNOWN group default qlen 1000
    link/ipip 0.0.0.0 brd 0.0.0.0
    inet 192.168.189.0/32 scope global tunl0
       valid_lft forever preferred_lft forever

I am now trying to add a node to the cluster by using the following command:

sudo kubeadm join 10.0.10.118:6443 --token <token>         --discovery-token-ca-cert-hash sha256:<hash>
Found multiple CRI endpoints on the host. Please define which one do you wish to use by setting the 'criSocket' field in the kubeadm configuration file: unix:///var/run/containerd/containerd.sock, unix:///var/run/cri-dockerd.sock
To see the stack trace of this error execute with --v=5 or higher

As you can see it says 'please define which one you wish to use by setting the 'criSocket' field in the kubeadm configuration file. However when I try to edit /var/run/cri-dockerd.sock file, it says it's not a normal file:

cri-dockerd.sock is not a regular file (use -f to see it)

Here is my kubeadm config print:

jason@kmaster:~$ kubectl get pods -A --watch
NAMESPACE     NAME                                       READY   STATUS    RESTARTS        AGE
kube-system   calico-kube-controllers-59697b644f-tpxnn   1/1     Running   2 (6m56s ago)   16d
kube-system   calico-node-88l8f                          1/1     Running   2 (6m56s ago)   16d
kube-system   coredns-565d847f94-vpzwg                   1/1     Running   2 (6m51s ago)   16d
kube-system   coredns-565d847f94-wkv4p                   1/1     Running   2 (6m51s ago)   16d
kube-system   etcd-kmaster                               1/1     Running   2 (6m56s ago)   16d
kube-system   kube-apiserver-kmaster                     1/1     Running   2 (6m55s ago)   16d
kube-system   kube-controller-manager-kmaster            1/1     Running   2 (6m56s ago)   16d
kube-system   kube-proxy-wd2gh                           1/1     Running   2 (6m56s ago)   16d
kube-system   kube-scheduler-kmaster                     1/1     Running   2 (6m56s ago)   16d
^Cjason@kmaster:~kubeadm config print init-defaults
apiVersion: kubeadm.k8s.io/v1beta3
bootstrapTokens:
- groups:
  - system:bootstrappers:kubeadm:default-node-token
  token: abcdef.0123456789abcdef
  ttl: 24h0m0s
  usages:
  - signing
  - authentication
kind: InitConfiguration
localAPIEndpoint:
  advertiseAddress: 1.2.3.4
  bindPort: 6443
nodeRegistration:
  criSocket: unix:///var/run/containerd/containerd.sock
  imagePullPolicy: IfNotPresent
  name: node
  taints: null
---
apiServer:
  timeoutForControlPlane: 4m0s
apiVersion: kubeadm.k8s.io/v1beta3
certificatesDir: /etc/kubernetes/pki
clusterName: kubernetes
controllerManager: {}
dns: {}
etcd:
  local:
    dataDir: /var/lib/etcd
imageRepository: registry.k8s.io
kind: ClusterConfiguration
kubernetesVersion: 1.25.0
networking:
  dnsDomain: cluster.local
  serviceSubnet: 10.96.0.0/12
scheduler: {}

Under nodeRegistration it says: nodeRegistration: criSocket: unix:///var/run/containerd/containerd.sock

In /var/run/ I see cri-dockerd.sock

jason@kmaster:/var/run$ ls -la
total 28
srw-rw----  1 root docker    0 Nov 15 00:25 cri-dockerd.sock

How can I add my node to the cluster?

2 Answers 2

1

You can choose which CRI you would like to use directly from the join command by adding this flag: (see kubeadm join --help for details)

--cri-socket string

here, string will be one of the two available sockets displayed in the error:

  1. unix:///var/run/containerd/containerd.sock
  2. unix:///var/run/cri-dockerd.sock

Or you can also add it to you kubeadm config as stated see doc here: https://kubernetes.io/docs/reference/config-api/kubeadm-config.v1beta3/#kubeadm-k8s-io-v1beta3-NodeRegistrationOptions

0

I got around this by starting over, installing ubuntu 20.04 and then creating cluster again. But it believe maxxvw is correct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.