kubernetes / kubeadm

Aggregator for issues filed against kubeadm
Apache License 2.0
3.74k stars 712 forks source link

missing cri-socket flag for upload-certs phase #2791

Closed Teresajw closed 1 year ago

Teresajw commented 1 year ago

Problem encountered

kubelet、kubeadm、kubeclt version

kubelet v1.25.5、kubeadm v1.25.5、kubeclt v1.25.5

First-command: kubeadm init phase upload-certs --upload-certs

description:

When I use kubeadm init phase upload certs -- upload certs to upload a certificate, I am prompted that I have not specified criSocket.

result:

[root@k8s-master-01 ~]# kubeadm init phase upload-certs --upload-certs 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

second-command: kubeadm init phase upload-certs --upload-certs --cri-socket unix:///var/run/cri-dockerd.sock

description:

When I add -- criSocket= unix:///var/run/cri-dockerd.socket After that, I am prompted that there is no -- cri socket parameter

result:

unknown flag: --cri-socket
neolit123 commented 1 year ago

we can add the --cri-socket param to this phase, but you can also pass --config with InitConfiguration.noderegistrationoptions.crisocket check the v1beta3 api docs.

in fact using config is always preferred.

Teresajw commented 1 year ago

we can add the --cri-socket param to this phase, but you can also pass --config with InitConfiguration.noderegistrationoptions.crisocket check the v1beta3 api docs.

in fact using config is always preferred.

Thanks for the answer. However, this parameter does not take effect. It is prompted that this option is not available. The command prompt given in the reference is like this. This parameter is not included Look at the figure below,it has no parameter as --cri-socket ,not only one ,The kubeadm init phase subcommand does not include image

SataQiu commented 1 year ago

/assign will add the --cri-socket param to this phase

Teresajw commented 1 year ago

/assign will add the --cri-socket param to this phase no this param image

SataQiu commented 1 year ago

@Teresajw After https://github.com/kubernetes/kubernetes/pull/114443 merged, the --cri-socket flag will be available. For now, you can use configuration to achieve it, like this:

cat <<EOF > kubeadm-init-config
apiVersion: kubeadm.k8s.io/v1beta3
kind: InitConfiguration
nodeRegistration:
  criSocket: unix:///var/run/containerd/containerd.sock
EOF

kubeadm init phase upload-certs --upload-certs --config kubeadm-init-config
Teresajw commented 1 year ago

Many subcommands of kubeadm init phase does not have -- cri socket flag ,It can be repaired together for example kubeadm init phase certs apiserver

Teresajw commented 1 year ago

@Teresajwkubernetes/kubernetes#114443合并 后,--cri-socketflag 将可用。 现在,您可以使用配置来实现它,如下所示:

cat <<EOF > kubeadm-init-config
apiVersion: kubeadm.k8s.io/v1beta3
kind: InitConfiguration
nodeRegistration:
  criSocket: unix:///var/run/containerd/containerd.sock
EOF

kubeadm init phase upload-certs --upload-certs --config kubeadm-init-config

I'll try, thanks