If I stop the Apiserver and delete a pod data in etcd, then I restart the Apiserver.
What will happen in kubelet and if the kubelet will delete the real pod?
Quick answer.
You cannot stop Apiserver.
If you remove the pod it will be rescheduled, so you would need to remove the kube-apiserver.yaml
from /etc/kubernetes/manifests
first.
If you do that you won't be able to edit etcd.
Etcd is an open-source distributed key-value store that serves as the backbone of distributed systems by providing a canonical hub for cluster coordination and state management – the systems source of truth.
You can edit values manually by going into etcd pod and changing the data, but this is a bit problematic.
Or you can use etcdctl
tool.
etcdctl
is a command line client for etcd. It can be used in scripts or for administrators to explore an etcd cluster.
ETCDCTL_API=3 etcdctl --endpoints=https://[127.0.0.1]:2379 --cacert=/etc/kubernetes/pki
/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/healthcheck-client.crt --key=/etc/kubernetes/pki/etcd/healthcheck-client.key