<p>I was trying to renew the expired certificates, i followed below steps and kubectl service started failing. I'm new to kubernetes please help me.</p>
<pre><code># kubeadm alpha certs check-expiration
CERTIFICATE                EXPIRES                  RESIDUAL TIME   EXTERNALLY MANAGED
admin.conf                 Nov 11, 2020 12:52 UTC   &lt;invalid&gt;       no
apiserver                  Nov 11, 2020 12:52 UTC   &lt;invalid&gt;       no
apiserver-etcd-client      Nov 11, 2020 12:52 UTC   &lt;invalid&gt;       no
apiserver-kubelet-client   Nov 11, 2020 12:52 UTC   &lt;invalid&gt;       no
controller-manager.conf    Nov 11, 2020 12:52 UTC   &lt;invalid&gt;       no
etcd-healthcheck-client    Nov 11, 2020 12:52 UTC   &lt;invalid&gt;       no
etcd-peer                  Nov 11, 2020 12:52 UTC   &lt;invalid&gt;       no
etcd-server                Nov 11, 2020 12:52 UTC   &lt;invalid&gt;       no
front-proxy-client         Nov 11, 2020 12:52 UTC   &lt;invalid&gt;       no
scheduler.conf             Nov 11, 2020 12:52 UTC   &lt;invalid&gt;       no

# kubeadm alpha certs renew all
certificate embedded in the kubeconfig file for the admin to use and for kubeadm itself renewed
certificate for serving the Kubernetes API renewed
certificate the apiserver uses to access etcd renewed
certificate for the API server to connect to kubelet renewed
certificate embedded in the kubeconfig file for the controller manager to use renewed
certificate for liveness probes to healthcheck etcd renewed
certificate for etcd nodes to communicate with each other renewed
certificate for serving etcd renewed
certificate for the front proxy client renewed
certificate embedded in the kubeconfig file for the scheduler manager to use renewed

 # kubeadm alpha certs check-expiration
CERTIFICATE                EXPIRES                  RESIDUAL TIME   EXTERNALLY MANAGED
admin.conf                 Nov 17, 2021 05:49 UTC   364d            no
apiserver                  Nov 17, 2021 05:49 UTC   364d            no
apiserver-etcd-client      Nov 17, 2021 05:49 UTC   364d            no
apiserver-kubelet-client   Nov 17, 2021 05:49 UTC   364d            no
controller-manager.conf    Nov 17, 2021 05:49 UTC   364d            no
etcd-healthcheck-client    Nov 17, 2021 05:49 UTC   364d            no
etcd-peer                  Nov 17, 2021 05:49 UTC   364d            no
etcd-server                Nov 17, 2021 05:49 UTC   364d            no
front-proxy-client         Nov 17, 2021 05:49 UTC   364d            no
scheduler.conf             Nov 17, 2021 05:49 UTC   364d            no

 :~&gt; mkdir -p $HOME/.kube
 :~&gt; sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
 :~&gt; sudo chown $(id -u):$(id -g) $HOME/.kube/config

 :~&gt; sudo systemctl daemon-reload
 :~&gt; sudo systemctl stop kubelet
 :~&gt; sudo systemctl start kubelet
 :~&gt; sudo systemctl enable kubelet
 :~&gt; sudo systemctl stop docker 
 :~&gt; sudo systemctl start docker

  :~&gt; kubectl get pods
The connection to the server 10.xx.xx.74:6443 was refused - did you specify the right host or port?
 
# kubectl version
Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;16&quot;, GitVersion:&quot;v1.16.2&quot;, GitCommit:&quot;c97fe5036ef3df2967d086711e6c0c405941e14b&quot;, GitTreeState:&quot;clean&quot;GoVersion:&quot;go1.12.10&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
The connection to the server 10.xx.xx.74:6443 was refused - did you specify the right host or port?
</code></pre>
<p>Kubectl status:</p>
<pre><code> #  systemctl status kubelet
  kubelet.service - kubelet: The Kubernetes Node Agent
   Loaded: loaded (/usr/lib/systemd/system/kubelet.service; enabled; vendor preset: disabled)
  Drop-In: /usr/lib/systemd/system/kubelet.service.d
           └─10-kubeadm.conf
   Active: activating (auto-restart) (Result: exit-code) since Tue 2020-11-17 08:18:20 UTC; 1s ago
     Docs: https://kubernetes.io/docs/
  Process: 1452 ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS (code=exited, sta
 Main PID: 1452 (code=exited, status=255)

Nov 17 08:18:20 c536gocrb systemd[1]: Unit kubelet.service entered failed state.
Nov 17 08:18:20 c536gocrb systemd[1]: kubelet.service failed.

</code></pre>
<p>tried adding environment variable to admin 10.kubeadm.conf</p>
<p>Environment=&quot;KUBELET_SYSTEM_PODS_ARGS=--pod-manifest-path=/etc/kubernetes/manifests --allow-privileged=true --fail-swap-on=false&quot;</p>
<p>kubeadm conf file:</p>
<pre><code> cat /usr/lib/systemd/system/kubelet.service.d/10-kubeadm.conf
# 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;
Environment=&quot;KUBELET_SYSTEM_PODS_ARGS=--pod-manifest-path=/etc/kubernetes/manifests --allow-privileged=true --fail-swap-on=false&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/sysconfig/kubelet
ExecStart=

ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS

</code></pre>

Santhosh reddy
<p>The issue has been resolved. After replacing certificate data in kubelet.conf as suggested in <a href="https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-certs/#check-certificate-expiration" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-certs/#check-certificate-expiration</a></p>
<pre><code>apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ==
    server: https://xx.x.x.x.:6443
  name: kubernetes
contexts:
- context:
    cluster: kubernetes
    user: system:node:cmaster
  name: system:node:cmaster@kubernetes
current-context: system:node:cmaster@kubernetes
kind: Config
preferences: {}
users:
- name: system:node:cmaster
  user:
    client-certificate: /var/lib/kubelet/pki/kubelet-client-current.pem
    client-key: /var/lib/kubelet/pki/kubelet-client-current.pem
</code></pre>
