ETCD - Backup -ERROR

I am restoring ETCD from a snapshot but i have a issue

  • “Error from server (Forbidden): pods is forbidden: User “kubernetes-admin” cannot list resource “pods” in API group “” in the namespace “default””

what is the reason for this? please let me know if i am missing something.

Thanks in advance.

I’ve seen this problem before, but I’m not sure what the cause is. I’d suggest trying the restore again, to make sure that etcd’s configuration was correctly updated once you restored the data directory. Know also that it can take a few minutes before etcd “verifies” the new data directory, and during this time, kube-apiserver may not have access to the newly restored data.

It happened to me when I changed both:

  - hostPath:
      path: /var/lib/etcd-backup
      type: DirectoryOrCreate
    name: etcd-data

and the --data-dir flag to the same value.

image

Change ONLY the volume path, don’t change the --data-dir flag for the etcd command