Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Provides access to gcloud, the command line cli of Google Cloud to manage cloud resources.


Add this library to the classpath:

buildscript {
	dependencies {
		classpath '<VERSION>'


A setup of Kubernetes with Google Cloud can looks as follows:

apply plugin: 'kubectl'
apply plugin: 'gcloud'

kubectl {
	url = ''
	namespace = 'default'
	insecureSkipTlsVerify = false

gcloud {
	keyFile = file("$projectDir/src/main/config/gcloud.key")
	zone = 'europe-west3-c'
	project = '...'
	gke {
		clusterName = 'sb4bdemo'
		imageName = 'google/cloud-sdk'
		version = '159.0.0'
  • gcloud.key stores the service account credentials of Google Cloud.
  • the gcloud plugin will reconfigure the kubectl plugin to share the same docker image in order to work together to perform authentication with glcoud.

To setup a service account use:

Make sure the service account also has the proper Kubernetes credentials, like:

./kubectl create clusterrolebinding your-user-cluster-admin-binding --clusterrole=cluster-admin

For an example app have a look at[crnk-example] how to deploy to Google Cloud with Kubernetes and Helm.


gcloud offers three Gradle tasks:

  • gcloudActivateServiceAccount to perform the login.
  • gcloudGetKubernetesCredentials to get the .kubeconfig to start working the kubectl plugin.
  • gcloudSetProject called implicitly as dependency to set the current project.


A wrapper cloud will be generated into the project root to allow easy access from the command line next to Gradle tasks.

You can’t perform that action at this time.