Add Google Cloud credentials
Before you can add your Google Cloud credentials to Portainer, you will need to configure your account for GKE, set up a service account, and retrieve the private key for that service account. Once this is complete, you can use the private key to set up access.
Creating your private key
Log into the Google Cloud console and go to the dashboard for your project. To confirm GKE is enabled for your project, click on Kubernetes Engine in the left hand menu. If the section loads and displays the ability to create a cluster, you're set up already. Otherwise you'll be asked to enable the Kubernetes Engine API, which you should do.
Once this is confirmed, we need to create a service account. From the navigation menu, hover over IAM & Admin and click Service Accounts, then click Create Service Account. Fill in the service account details with a name, ID and description that makes sense to you and click Create and Continue. In the Grant this service account access to project section, add theCompute Engine Service Agent
and Kubernetes Engine Service Agent
roles to the service account and click Continue, then click Done to create the account.
Finally, we need to retrieve the private key for the service account. Click on the service account you just created, then select the Keys tab and click Add Key then Create new key. Select JSON as the type and click Create. This will download a file containing the private key for the service account.
Adding your credentials
To add credentials for a Google Cloud account, from the Cloud settings page click Add credentials, then select the Google Cloud option. Give your credential set a name and upload the JSON private key for your service account.
![](https://docs.portainer.io/~gitbook/image?url=https%3A%2F%2F3146734376-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FwXVC6tYZrbL0dPoO2iBb%252Fuploads%252FAvQmyBFy6Ek0dw8iXMsI%252F2.15-settings-cloud-googlecloud-add.png%3Falt%3Dmedia%26token%3Dd22521f4-0645-4921-82fd-a7ca76bea2ff&width=768&dpr=4&quality=100&sign=9b79abf6&sv=1)
When you're ready, click Add credentials. Your credentials will now be available to you when provisioning a Kubernetes cluster on Google Cloud.
Last updated