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:
  Kind     Cause            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 all the way down to a lacking Service Account!

The repair

You must create a service account:

kubectl create serviceaccount my-service-a

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

So when you’ve got a deployment going to my-apps namespace, then you must do the next:

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

Most Popular

Recent Comments