<p>I've accidently deleted kube-proxy from my k3s cluster. How can I restore it?
Any object type is non-existent anymore, this command gives an empty result:</p>
<pre><code>kubectl get all --all-namespaces | grep prox
</code></pre>
<p>Initiatlly, I've installed that cluster via arkade / k3sup, using <code>k3sup install --ip $SERVER_IP --user $K3SUPUSER</code></p>
<p>kubectl cluster-info</p>
<pre><code>Kubernetes control plane is running at https://192.168.22.101:6443
CoreDNS is running at https://192.168.22.101:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
Metrics-server is running at https://192.168.22.101:6443/api/v1/namespaces/kube-system/services/https:metrics-server:https/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
</code></pre>
<p>kubectl get node</p>
<pre><code>NAME   STATUS     ROLES                  AGE    VERSION
ras1   Ready      control-plane,master   407d   v1.22.7+k3s1
nuc2   Ready      &lt;none&gt;                 407d   v1.22.7+k3s1
nuc1   Ready      &lt;none&gt;                 407d   v1.22.7+k3s1
nuc0   Ready      &lt;none&gt;                 407d   v1.22.7+k3s1
ras7   Ready      &lt;none&gt;                 379d   v1.22.7+k3s1
ras3   Ready      &lt;none&gt;                 407d   v1.22.7+k3s1
ras0   Ready      &lt;none&gt;                 21m    v1.22.7+k3s1
ras8   Ready      &lt;none&gt;                 379d   v1.22.7+k3s1
ras5   Ready      &lt;none&gt;                 407d   v1.22.7+k3s1
ras9   Ready      &lt;none&gt;                 379d   v1.22.7+k3s1
ras4   Ready      &lt;none&gt;                 407d   v1.22.7+k3s1
ras2   Ready      &lt;none&gt;                 407d   v1.22.7+k3s1
ras6   Ready      &lt;none&gt;                 407d   v1.22.7+k3s1
</code></pre>
<p>kubectl version</p>
<pre><code>Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;23&quot;, GitVersion:&quot;v1.23.4&quot;, GitCommit:&quot;e6c093d87ea4cbb530a7b2ae91e54c0842d8308a&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2022-02-16T12:38:05Z&quot;, GoVersion:&quot;go1.17.7&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
Server Version: version.Info{Major:&quot;1&quot;, Minor:&quot;22&quot;, GitVersion:&quot;v1.22.7+k3s1&quot;, GitCommit:&quot;8432d7f239676dfe8f748c0c2a3fabf8cf40a826&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2022-02-24T23:08:31Z&quot;, GoVersion:&quot;go1.16.10&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/arm64&quot;}
</code></pre>
<p>kubectl  -n kube-system get pod</p>
<pre><code>NAME                                      READY   STATUS      RESTARTS       AGE
helm-install-traefik--1-2d64v             0/1     Completed   15             90m
svclb-traefik-bkv62                       2/2     Running     2 (32m ago)    38m
svclb-traefik-7s99x                       2/2     Running     2 (32m ago)    38m
svclb-traefik-6lh88                       2/2     Running     2 (32m ago)    37m
svclb-traefik-85xdt                       2/2     Running     2 (32m ago)    38m
svclb-traefik-fhg6v                       2/2     Running     2 (32m ago)    37m
svclb-traefik-mnzk5                       2/2     Running     2 (32m ago)    37m
traefik-5dd496474-b922f                   1/1     Running     1 (32m ago)    39m
coredns-96cc4f57d-r8k4h                   1/1     Running     1 (32m ago)    91m
svclb-traefik-jg974                       2/2     Running     2 (32m ago)    37m
svclb-traefik-p69xv                       2/2     Running     2 (32m ago)    38m
svclb-traefik-4sv95                       2/2     Running     2 (34m ago)    38m
svclb-traefik-pj9zm                       2/2     Running     2 (32m ago)    38m
svclb-traefik-xzrgw                       2/2     Running     2 (32m ago)    37m
local-path-provisioner-84bb864455-sd4sc   1/1     Running     17 (32m ago)   91m
svclb-traefik-rkrtd                       2/2     Running     2 (32m ago)    37m
metrics-server-ff9dbcb6c-kxg4z            1/1     Running     17 (32m ago)   91m
svclb-traefik-qh96n                       2/2     Running     0              39m
</code></pre>
<p>I have reinstalled the latest server and agent versions, but the installation process wouldn't install a new kube-proxy.</p>

Michael
<p>Kubernetes allows to reinstall <code>kube-proxy</code>, so the <a href="https://kubernetes.io/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_addon_kube-proxy/" rel="nofollow noreferrer">docs for reinstalling kube-proxy</a> told me to launch this command:</p>
<pre><code>$ kubeadm init phase addon kube-proxy  --kubeconfig ~/.kube/config  --apiserver-advertise-address 192.168.22.101
[addons] Applied essential addon: kube-proxy
</code></pre>
<p>... and tadaah my fault got repaired, kube-proxy was reinstalled in my cluster by creating a <a href="https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/" rel="nofollow noreferrer">DaemonSet</a> and launcing the pods.</p>
