kubernetes on gcp: removed role, account gone how to restore permissions?

10/18/2017

whilst 'hardening' the accounts - namely removing or toning down accounts with editor permissions on the projects I removed editor from what appears to be the kubernetes account that container engine uses on the back end of gcloud commands.

Once you remove the last role from an account it vanishes - hard lesson to learn! Removed editor serviceAccount:386242358897@cloudservices.gserviceaccount.com

when I try to create through UI I get this

Permission denied (HTTP 403): Google Compute Engine: Required 'compute.zones.get' permission for 'projects/xxxx/zones/us-central1-a'

Have done a number on it! My problem is that I don't see a way of giving permissions back to whatever account it is trying to use (as I cannot see that account if it exists) nor can I see how to attach a new service account with permissions that are needed to whatever is doing the work under the hood.

UPDATE:

So ...

I recreated the account at the organisation level. Gave it service account role there because you cannot modify the domain of the accounts at project level.

I have then modified that at the project level to have editor permissions.

This means i can deploy a cluster but ... still cannot create load balancer - insufficient permissions

Error creating load balancer (will retry): Error getting LB for service default/bot: googleapi: Error 403: Required
 'compute.forwardingRules.get' permission for 'projects/xxxx/regions/europe-west2/forwardingRules/xxxx', forbidden

the user having the problem this time is: service-xxx@container-engine-robot.iam.gserviceaccount.com

-- John Nicholas
gcp
kubernetes
permissions

1 Answer

10/18/2017

So ...

I played with recreating accounts etc. Eventually got Kubernetes working again. A week later tried to use datastore and discovered that AppEngine was dead beyond dead.

The only recourse was to start a new project from scratch.

The answer to this question is (some may laugh at its self evidence, but we are all in a rush at some point).

DO NOT CREATE USER ACCOUNTS OR GIVE THEM PERMISSIONS BEYOND WHAT THEY NEED BECAUSE DELETING THEM LATER IS REALLY NOT WORTH THE RISK.

Thankyou for listening :D

-- John Nicholas
Source: StackOverflow