What’s better way to introduce into a system than deploying something?
In this short tutorial we will demonstrate how to run your service with Github, Google Kubernetes Engine and Keel. We will deploy a simple application that can be then updated automatically by tagging a new release in Github.
Standard workflow with Keel looks like this:
- Basic knowledge of Kubernetes, containers.
- Google Cloud account, register for a free tier here.
- Provisioned Kubernetes cluster.
You can also use Docker for Mac with Kubernetes support or Minikube for local testing. Feel free to use your own image/application as the only thing that matters is applied label with the update policy.
We would really encourage to use SemVer for versioning your images. Git is a single source of truth for your software, so when you tag a new release that should be it — no bug fixes/features can go into that version. If you add something then tag minor or patch release.
For an example, you can have a look at these tags https://hub.docker.com/r/keelhq/keel/tags/. Then, if you look at Github releases https://github.com/keel-hq/keel/releases we can see that tags match (except older tags are removed). Easiest way to setup automated builds is with https://cloud.docker.com or Google Cloud builder. Docker cloud configuration looks like this:
Our example application will be Keel itself because if a continuous delivery tool cannot upgrade itself then it can’t call itself an automation tool.
Keel installation is as simple as one deployment file. For our use case, default deployment will be enough:
kubectl create -f deployment-rbac.yaml
You can learn more on installation types here.
We will be adding two configuration labels for Keel:
keel.sh/policy=major # <- update major, minor and patch versions
Make sure you set one of the old tags:
and create it:
kubectl create -f deployment.yml
Now, sit back and relax, in a minute Keel will update application to the newest version available. Why minute? It’s default polling schedule, you can change it but keep in mind rate limits.
In this article we saw how easy it is to get a mini PaaS where on Github release tag using tools like Cloudbuild on docker cloud builder you can get an image with the same version.
We also saw how easy it is to install Keel and mark deployments for automated updates, just specifying few labels.