New kubernetes install has remnants of old cluster

7/18/2019

I did a complete tear down of a v1.13.1 cluster and am now running v1.15.0 with calico cni v3.8.0. All pods are running:

[gms@thalia0 ~]$ kubectl get po --namespace=kube-system
NAME                                          READY   STATUS    RESTARTS   AGE
calico-kube-controllers-59f54d6bbc-2mjxt      1/1     Running   0          7m23s
calico-node-57lwg                             1/1     Running   0          7m23s
coredns-5c98db65d4-qjzpq                      1/1     Running   0          8m46s
coredns-5c98db65d4-xx2sh                      1/1     Running   0          8m46s
etcd-thalia0.ahc.umn.edu                      1/1     Running   0          8m5s
kube-apiserver-thalia0.ahc.umn.edu            1/1     Running   0          7m46s
kube-controller-manager-thalia0.ahc.umn.edu   1/1     Running   0          8m2s
kube-proxy-lg4cn                              1/1     Running   0          8m46s
kube-scheduler-thalia0.ahc.umn.edu            1/1     Running   0          7m40s

But, when I look at the endpoint, I get the following:

[gms@thalia0 ~]$ kubectl get ep --namespace=kube-system
NAME                      ENDPOINTS                                                           AGE
kube-controller-manager   <none>                                                              9m46s
kube-dns                  192.168.16.194:53,192.168.16.195:53,192.168.16.194:53 + 3 more...   9m30s
kube-scheduler            <none>                                                              9m46s

If I look at the log for the apiserver, I get a ton of TLS handshake errors, along the lines of:

I0718 19:35:17.148852       1 log.go:172] http: TLS handshake error from 10.x.x.160:45042: remote error: tls: bad certificate
I0718 19:35:17.158375       1 log.go:172] http: TLS handshake error from 10.x.x.159:53506: remote error: tls: bad certificate

These IP addresses were from nodes in a previous cluster. I had deleted them and done a kubeadm reset on all nodes, including master, so I have no idea why these are showing up. I would assume this is why the endpoints for the controller-manager and the scheduler are showing up as <none>.

-- horcle_buzz
kube-apiserver
kubeadm
kubernetes

1 Answer

7/23/2019

In order to completely wipe your cluster you should do next:

1) Reset cluster

$sudo kubeadm reset (or use appropriate to your cluster command)

2) Wipe your local directory with configs

$rm -rf .kube/

3) Remove /etc/kubernetes/

$sudo rm -rf /etc/kubernetes/

4)And one of the main point is to get rid of your previous etc state configuration.

$sudo rm -rf /var/lib/etcd/
-- VKR
Source: StackOverflow