<p>I'm trying to set which cri-o socket to use by kubeadm !  </p>

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

<hr>

<p>The current command is in the form <code>kubeadm init phase &lt;phase_name&gt;</code>. I must add the <code>--cri-socket</code> flag to it.  </p>

<p>I edited the command this way <code>kubeadm init --cri-socket /var/run/crio/crio.sock phase &lt;phase_name&gt;</code>.</p>

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

<p>How do I fix that ?<br>
Thx</p>

<hr>

<p><strong>##################Update 1######################</strong>  </p>

<p><strong>File</strong> :  <em>/etc/kubernetes/kubeadm-config.yaml</em>  </p>

<pre><code>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
</code></pre>

Doctor
<p>I see two things that may help:</p>

<ol>
<li>Check <code>/var/lib/kubelet/kubeadm-flags.env</code> if it is properly configured. </li>
</ol>

<blockquote>
  <p>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).</p>
</blockquote>

<p>More details can be found <a href="https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/kubelet-integration/#workflow-when-using-kubeadm-init" rel="nofollow noreferrer">here</a>.</p>

<ol start="2">
<li>Check your init config file (<code>kubeadm init --config string</code> will show you the path do the configuration file) and try to add something like this:</li>
</ol>

<hr>

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

<hr>

<p>Please let me know if that helped.</p>
