2

I'm trying to set which cri-o socket to use by kubeadm !

To achieve this I should use the flag --cri-socket /var/run/crio/crio.sock


The current command is in the form kubeadm init phase <phase_name>. I must add the --cri-socket flag to it.

I edited the command this way kubeadm init --cri-socket /var/run/crio/crio.sock phase <phase_name>.

Unfortunatly I am getting the error Error: unknown flag: --cri-socket.
=> It seems that the argument phase <phase_name> and the flag --cri-socket /var/run/crio/crio.sock is not compatible.

How do I fix that ?
Thx


##################Update 1######################

File : /etc/kubernetes/kubeadm-config.yaml

apiVersion: kubeadm.k8s.io/v1beta2
kind: InitConfiguration
localAPIEndpoint:
  advertiseAddress: 10.10.3.15
  bindPort: 6443
certificateKey: 9063a1ccc9c5e926e02f245c06b8xxxxxxxxxxx
nodeRegistration:
  name: p3kubemaster1
  taints:
  - effect: NoSchedule
    key: node-role.kubernetes.io/master
  criSocket: /var/run/crio/crio.sock
Doctor
  • 7,115
  • 4
  • 37
  • 55

1 Answers1

2

I see two things that may help:

  1. Check /var/lib/kubelet/kubeadm-flags.env if it is properly configured.

In addition to the flags used when starting the kubelet, the file also contains dynamic parameters such as the cgroup driver and whether to use a different CRI runtime socket (--cri-socket).

More details can be found here.

  1. Check your init config file (kubeadm init --config string will show you the path do the configuration file) and try to add something like this:

apiVersion: kubeadm.k8s.io/v1beta1
kind: InitConfiguration
nodeRegistration:
  criSocket: "unix:///var/run/crio/crio.sock"

Please let me know if that helped.

Wytrzymały Wiktor
  • 11,492
  • 5
  • 29
  • 37
  • Thx for your answer ! Unfortunatly setting the flag in `kubeadm-flags.env` did not changed anything. And concerning `kubeadm init --config string`, I checked the content of the file and saw that the socket was already set (as shown in the **Edit 1** of my answer). It was two good ideas though... If you have anymore please don't hesitate ! thx – Doctor Sep 10 '19 at 09:18
  • If you are interested in this issue and want more context you can check this post I made using your help provided above: https://stackoverflow.com/q/57868351/5512455 – Doctor Sep 10 '19 at 10:00
  • Thanks. I have post an answer to your second answer. Please take a look so we could possibly close both of your cases. – Wytrzymały Wiktor Sep 13 '19 at 09:25
  • 1
    **In the end you were right !** The solution was to use the initConfiguration. In my tests it did not work because for some reason Kubespray was not using the initConfiguration that he itself generates (god knows why). So I forced him to use the config by modifying the kubesprays files themselves and adding the `--config` flag. Thx ! – Doctor Sep 18 '19 at 11:48