This guide will take you through the steps necessary to continuously deliver your software to end users by leveraging Google Container Engine and Jenkins to orchestrate the software delivery pipeline. If you are not familiar with basic Kubernetes concepts, have a look at Kubernetes 101.
You'll use a very simple sample application - gceme
- as the basis for your CD pipeline. gceme
is written in Go and is located in the sample-app
directory in this repo. When you run the gceme
binary on a GCE instance, it displays the instance's metadata in a pretty card:
The binary supports two modes of operation, designed to mimic a microservice. In backend mode, gceme
will listen on a port (8080 by default) and return GCE instance metadata as JSON, with content-type=application/json. In frontend mode, gceme
will query a backend gceme
service and render that JSON in the UI you saw above. It looks roughly like this:
----------- ------------ ~~~~~~~~~~~~ -----------
| | | | | | | |
| user | ---> | gceme | ---> | lb/proxy | -----> | gceme |
|(browser)| |(frontend)| |(optional)| | |(backend)|
| | | | | | | | |
----------- ------------ ~~~~~~~~~~~~ | -----------
| -----------
| | |
|--> | gceme |
|(backend)|
| |
-----------
Both the frontend and backend modes of the application support two additional URLs:
/version
prints the version of the binary (declared as a const inmain.go
)/healthz
reports the health of the application. In frontend mode, health will be OK if the backend is reachable.
- Workshop Setup
- Kubernetes Overview
- Create Kubernetes Objects
- Connect to Jenkins
- Deploy Sample App to K8s
- Create a Pipeline
- Deploy to Development Branch
- Wrap Up
For a more in-depth best practices guide, go to the solution posted here.