Thursday, September 21, 2023
HomeSoftware Engineering Error creating: pods “my-service-a-xxx” is forbidden: error trying up service account...

[Solved] Error creating: pods “my-service-a-xxx” is forbidden: error trying up service account my-apps/my-service-a: serviceaccount “my-service-a” not discovered


So that you’ve run a deployment and tried to test the pods and there’s nothing there!

kubectl get pods

Subsequent step is to see what’s occurring with the replicaset

kubectl get rs

Then take the replicaset title and do a describe on it:

kubectl describe rs my-service-a-5549cbc6c8

The error

Occasions:
  Sort     Purpose            Age           From         Message
  ----     ------            ----          ----         -------
  Warning  FailedCreate      2m10s..  replicaset-controller  Error creating: pods "my-service-a-5549cbc6c8-" is forbidden: error trying up service account my-apps/my-service-a: serviceaccount "my-service-a" not discovered

It’s right down to a lacking Service Account!

The repair

It’s worthwhile to create a service account:

kubectl create serviceaccount my-service-a

Keep in mind to create it in the identical namespace because the deployment.

So in case you have a deployment going to my-apps namespace, then it is best to do the next:

kubectl create serviceaccount my-service-a -n my-apps
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments