<p>Attempting to deploy a k8 master node using kubeadm from a fork of the Kubernetes repository, branch release-1.19. What configuration is necessary ahead of running <code>kubeadm init {opts...}</code></p>
<p>The kubeadm <a href="https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/" rel="nofollow noreferrer">guide</a> recommends install of kubeadm, kubectl and kubelet using apt. The guide states, following installation that &quot;The kubelet is now restarting every few seconds, as it waits in a crashloop for kubeadm to tell it what to do.&quot;</p>
<p>From a local repository I'm compiling the Kubernetes binaries (kubeadm, kubectl and kubelet) using the 'make all' method. Then scp'ing them to the master node at /usr/local/bin with exec perms.</p>
<p>Executing kubeadm init fails since the kubelet is not running/configured. However, initialising the required kubelet.service from the kubelet binary seems to require the certs (ca.pem) and configs (kubelet.config.yaml) that I assumed kubeadm generates. So chicken-egg situation regarding kubeadm and the kubelet.</p>
<p>The question then is, what additional configurations does the apt installation complete for initialising the kubelet.service?
Is there a minimal config &amp; service template kubelet can be started with ahead of kubeadm init?
Does kubeadm replace the certs used by the pre-initialised kubelet?</p>
<p>Any help/direction would be hugely appreciated. Online docs/threads for building from source are sparse</p>

DSCrouch
<p>For anyone searching, found the solution to this:</p>
<ol>
<li>Install dependencies through apt: apt-transport-https, conntrack, socat, ipset</li>
<li>Move kubelet, kubeadm, kubectl binaries to /usr/local/bin and give exec perms</li>
<li>Write systemd kubelet.service file to /etc/systemd/system</li>
</ol>
<pre><code>[Unit]
Description=kubelet: The Kubernetes Node Agent
Documentation=https://kubernetes.io/docs/home/
Wants=network-online.target
After=network-online.target

[Service]
ExecStart=/usr/local/bin/kubelet
Restart=always
StartLimitInterval=0
RestartSec=10

[Install]
WantedBy=multi-user.target
</code></pre>
<ol start="4">
<li>Write kubelet config file to /etc/systemd/system/kubelet.service.d</li>
</ol>
<pre><code># Note: This dropin only works with kubeadm and kubelet v1.11+
[Service]
Environment=&quot;KUBELET_KUBECONFIG_ARGS=--bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf&quot;
Environment=&quot;KUBELET_CONFIG_ARGS=--config=/var/lib/kubelet/config.yaml&quot;
# This is a file that &quot;kubeadm init&quot; and &quot;kubeadm join&quot; generates at runtime, populating the KUBELET_KUBEADM_ARGS variable dynamically
EnvironmentFile=-/var/lib/kubelet/kubeadm-flags.env
# This is a file that the user can use for overrides of the kubelet args as a last resort. Preferably, the user should use
# the .NodeRegistration.KubeletExtraArgs object in the configuration files instead. KUBELET_EXTRA_ARGS should be sourced from this file.
EnvironmentFile=-/etc/default/kubelet
Environment=&quot;KUBELET_AUTHZ_ARGS=--authorization-mode=Webhook --client-ca-file=/etc/kubernetes/pki/ca.crt&quot;
Environment=&quot;KUBELET_CGROUP_ARGS=--cgroup-driver=systemd&quot;
ExecStart=
ExecStart=/usr/local/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS
</code></pre>
<ol start="5">
<li><p>Build cni plugins
<a href="https://github.com/containernetworking/plugins" rel="nofollow noreferrer">https://github.com/containernetworking/plugins</a>
ie. For linux, build_linux.sh</p>
</li>
<li><p>Copy cni plugin binaries to /opt/cni</p>
</li>
<li><p>Start Kubelet
<code>systemctl daemon-reload</code>
<code>systemctl enable kubelet --now</code>
<code>systemctl start kubelet</code></p>
</li>
<li><p>Now kubeadm init can run</p>
</li>
</ol>
<p>In short this initialised the kubelet.service systemd process prior to the kubeadm init; with some default/minimal configs. kubeadm init then modifies the process's configs on execution.</p>
