Deep Kundu
Deep Kundu

Reputation: 21

Pods starting but not working in Kubernetes

Created Kubernetes cluster deployment with 3 Pods, and all are running fine, but when trying to run them cannot do it, tried doing curl the Ip (Internal)of the Pods in describe section i could see this error "" MountVolume.SetUp failed for volume "default-token-twhht" : failed to sync secret cache:

errors below:

5m51s       Normal    RegisteredNode      node/ip-10-1-1-4                        Node ip-10-1-1-4 event: Registered Node ip-10-1-1-4 in Controller
57m         Normal    Scheduled           pod/nginx-deployment-585449566-9bqp7    Successfully assigned default/nginx-deployment-585449566-9bqp7 to ip-10-1-1-4
57m         Warning   FailedMount         pod/nginx-deployment-585449566-9bqp7    MountVolume.SetUp failed for volume "default-token-twhht" : failed to sync secret cache: timed out waiting for the condition
57m         Normal    Pulling             pod/nginx-deployment-585449566-9bqp7    Pulling image "nginx:latest"
56m         Normal    Pulled              pod/nginx-deployment-585449566-9bqp7    Successfully pulled image "nginx:latest" in 12.092210534s
56m         Normal    Created             pod/nginx-deployment-585449566-9bqp7    Created container nginx
56m         Normal    Started             pod/nginx-deployment-585449566-9bqp7    Started container nginx
57m         Normal    Scheduled           pod/nginx-deployment-585449566-9hlhz    Successfully assigned default/nginx-deployment-585449566-9hlhz to ip-10-1-1-4
57m         Warning   FailedMount         pod/nginx-deployment-585449566-9hlhz    MountVolume.SetUp failed for volume "default-token-twhht" : failed to sync secret cache: timed out waiting for the condition
57m         Normal    Pulling             pod/nginx-deployment-585449566-9hlhz    Pulling image "nginx:latest"
56m         Normal    Pulled              pod/nginx-deployment-585449566-9hlhz    Successfully pulled image "nginx:latest" in 15.127984291s
56m         Normal    Created             pod/nginx-deployment-585449566-9hlhz    Created container nginx
56m         Normal    Started             pod/nginx-deployment-585449566-9hlhz    Started container nginx
57m         Normal    Scheduled           pod/nginx-deployment-585449566-ffkwf    Successfully assigned default/nginx-deployment-585449566-ffkwf to ip-10-1-1-4
57m         Warning   FailedMount         pod/nginx-deployment-585449566-ffkwf    MountVolume.SetUp failed for volume "default-token-twhht" : failed to sync secret cache: timed out waiting for the condition
57m         Normal    Pulling             pod/nginx-deployment-585449566-ffkwf    Pulling image "nginx:latest"
56m         Normal    Pulled              pod/nginx-deployment-585449566-ffkwf    Successfully pulled image "nginx:latest" in 9.459864756s
56m         Normal    Created             pod/nginx-deployment-585449566-ffkwf    Created container nginx

Upvotes: 2

Views: 14811

Answers (2)

Toni
Toni

Reputation: 1344

You can add an additional RBAC role permission to your Pod's service account, reference 1 2 3.

Assure as well that you have the workload identity set up, reference 4.


This can also happen when apiserver is on high load, you could have more smaller nodes to spread your pods and increase your resource requests.

Upvotes: 1

Fritz Duchardt
Fritz Duchardt

Reputation: 11860

This error message is a bit misleading, since it suggests a K8s cluster internal connectivity problem. In reality it is an RBAC permission problem.

The default service account within the namespace you are deploying to is not authorized to mount the secret that you are trying to mount into your Pod.

To solve this, you have to add additional RBAC role permission to your Pod's service account.

Upvotes: 0

Related Questions