MountVolume.SetUp failed for volume secret not found Issue
Today I found that some pods in kubernetes cluster are failed, the status is Waiting: ContainerCreating. The pod events:
I remember that about one week ago I delete some secretes in this cluster. Therefore, the problem becomes how to recover the deleted secret “xxxxx”?
Refer the following documents: # To create additional API tokens
According to # Service Account Admission Controller :
| |
Since the missing secret format is “default-token-xxxxx”, the ServiceAccount must be default.
Then we create a service.json file:
There are two fields in metadata need to be modified:
- name: change to your missing secret name which is included in the warning message
- kubernetes.io/service-account.name:
default
Execute the following command:
| |
Check if the secret is there:
| |
Done. Waiting for the pod to start!
If you deleted the default kubernetes secret by mistake, hope this artible helps. :-)