Drone plugin to deploy containers to Google Container Engine
Branch: master
Clone or download
gadelkareem and tonglil Remove slashes from namespaces (#103)
* Remove '/' from namespace in case it is in the branch name

* Remove unneeded reassignment

* Use regex to replace invalid k8s resource names' chars

* replace invalid chars with a dash

* Update main.go

* Add test case
Latest commit e342a2e Jan 3, 2019



Drone plugin to deploy container images to Kubernetes on Google Container Engine. For the usage information and a listing of the available options please take a look at the docs.

This is a little simpler than deploying straight to Kubernetes, because the API endpoints and credentials can be derived using the Google credentials. In addition, this opens the yaml file to templatization and customization with each Drone build.

Drone compatibility

For usage in Drone 0.5 and newer, please use a release tag >= 0.7.

For usage in Drone 0.4, please use a 0.4 release tag.


Users should use the x.X releases for stable use cases (eg 0.8).

Breaking changes may occur between x.X releases (eg 0.7 and 0.8), and will be documented in the release notes.

  • Pushes to the develop branch will update the Docker Hub release tagged develop.
  • Pushes to the master branch will update the Docker Hub release tagged latest.
  • Tags to the master branch will create the Docker Hub release with the tag value (eg 0.7.1 and 0.7).

kubectl version

Use the release tag suffix with the desired kubectl version. The last three minor releases are supported (same as GKE).


The git workflow follows git-flow. New features should be based on the master branch.

glide is used to manage vendor dependencies.

go build


This could use your contribution!

go test


Build the Docker image with the following commands:

OWNER=your-docker-hub-user ./bin/dist


Using it in a .drone.yml pipeline: please take a look at the docs.

Executing locally from the working directory:

# Deploy the manifest templates in local-example/
$ cd local-example/

# Set to the path of your GCP service account JSON file

# Set to your cluster
$ export CLUSTER=yyy

# Set to your cluster's zone
$ export ZONE=zzz

# The variables required for the templates in JSON format
$ cat vars.json
   "app": "echo",
   "env": "dev",
   "image": "gcr.io/google_containers/echoserver:1.4"

# Execute the plugin
$ docker run --rm \
  -e PLUGIN_NAMESPACE=drone-gke \
  -e PLUGIN_VARS="$(cat vars.json)" \
  -e SECRET_BASE64_P12_CERT="cDEyCg==" \
  -v $(pwd):$(pwd) \
  -w $(pwd) \
  nytimes/drone-gke --dry-run --verbose

# Remove --dry-run to deploy