kubeadm init with containerd and private image registry (no docker)

  containerd, docker, kubeadm, kubernetes

I’m trying to initialize a kubernetes cluster with kubeadm (v1.20.4) without internet connection.

And this is the problem what I’m facing.

  1. I installed containerd (as container runtime), kubeadm, kubectl, kubectl on master node.
    I did intentionally not install docker-ce, docker-ce-cli since the kubelet detects dockershim as container runtime over containerd when docker is installed on the machine.
    For this reason, I should not install docker on the master.

  2. When I tried to kubeadm init with a config yaml file which have this line:

imageRepository: mycompany-private-registry.com:5000/k8s.gcr.io

And now I need docker-ce and docker-ce-cli on the master node for
a. the configuration of insecure-registry in
b. docker login mycompany-private-registry:5000

Here’s what I have tried, but no luck:

  1. docker login to company registry with docker-ce-cli only (no docker-ce), but it gave me an error like:

http: server gave HTTP response to HTTPS client

So I concluded that I need docker-ce on the master node and configure insecure-registry.
(I cannot change the configuration of registry server since I’m not an admin of the private registry.)

  1. Copied ~/.docker/config.json which have docker login credentials from another machine with docker engine.

Is there any way to detect conatainerd as container runtime of kubelet even when docker is installed ont the same machine?
Or way to login to private registry with out docker-ce/cli?
Source: Docker Questions