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.
For usage in Drone 0.5 and newer, please use a release greater than 0.7
.
For usage in Drone 0.4, please use the nytimes/drone-gke:0.4
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 changelog.
- Pushes to the
develop
branch will update the Docker Hub release taggeddevelop
. - Pushes to the
master
branch will update the Docker Hub release taggedlatest
andx.X
(eg 0.7). - Tags to the
master
branch will create the Docker Hub release with the tag value (eg 0.7.1).
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! Help us create a runnable test suite.
Build the Docker image with the following commands:
OWNER=your-docker-hub-user ./bin/dist
Executing locally from the working directory:
# Deploy the manifest templates in example/
$ cd example/
# Set to the path of your GCP service account JSON file
$ export GOOGLE_APPLICATION_CREDENTIALS=xxx
# 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_CLUSTER="$CLUSTER" \
-e PLUGIN_ZONE="$ZONE" \
-e PLUGIN_NAMESPACE=drone-gke \
-e PLUGIN_VARS="$(cat vars.json)" \
-e TOKEN="$(cat $GOOGLE_APPLICATION_CREDENTIALS)" \
-e SECRET_API_TOKEN=123 \
-e SECRET_BASE64_P12_CERT="cDEyCg==" \
-v $(pwd):$(pwd) \
-w $(pwd) \
nytimes/drone-gke --dry-run --verbose
# Remove --dry-run to deploy