kubeadm compatibility between "--cri-socket" flag and "init phase" argument

9/6/2019

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
cri-o
kubeadm
kubernetes
kubespray

1 Answer

9/9/2019

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.

-- OhHiMark
Source: StackOverflow