Find the official installation docs for v2.23 at teamhephy.com.
Apr 21, 2016 UPDATE: Jan 2, 2023
When we finish, we’ll have:
Before we continue, you’ll need a few things set up.
Firstly, you need a running Kubernetes cluster that is accessible remotely so Wercker can deploy new versions of your Docker image.
Next, you’ll need Helm Classic installed. Helm Classic is the Kubernetes package manager developed by the Deis folks.
You can install Helm Classic by running:
curl -s https://get.helm.sh | bash
Then you’ll need to install Deis Workflow. Consult the Deis docs for that!
We’re also going to use Docker Hub for hosting our Docker repository. So you’ll need an account there.
And finally, head over to Wercker and set up an account.
As a quick refresher, a chart in Helm Classic lingo is a packaged unit of Kubernetes software. For the purposes of this demo, I wrote a chart that sets up Redis for you.
Point Helm Classic at the demo repository by running:
$ helmc up $ helmc repo add demo-charts https://github.com/deis/demo-charts $ helmc up
Now install the chart I wrote for this demo that sets up Redis:
$ helmc fetch demo-charts/redis-guestbook $ helmc install redis-guestbook
To work with Deis Workflow, we need to create a Deis app.
You can do that by running:
$ deis create guestbook --no-remote
We’re creating the app with
--no-remote because Deis only needs a Git remote when we’re using it for building Docker images. But we’re using Wercker for that.
Once that’s done, the only thing we need to do is specify some environment variables so that our app knows how to contact the Redis cluster.
Run this command:
$ deis config:set GET_HOSTS_FROM=env REDIS_MASTER_SERVICE_HOST=redis-master.default REDIS_SLAVE_SERVICE_HOST=redis-slave.default -a guestbook
Now that’s set up, we can can set up the code.
This bit’s easy.
Fork my demo repo to your GitHub account.
Then, clone your fork locally:
$ git clone https://github.com/USERNAME/example-guestbook-wercker.git
Now, we can set up continuous deployment with Wercker so changes made to your fork will result in automatic deployments to your Deis Workflow.
Log into your Docker Hub account and create a new repository. You can do that via the Create menu, then Create Repository, then call it something like
example-guestbook-wercker, or whatever you want.
Log in to your Wercker account and select Create, then Application. Connect Werker to your GitHub account and select your repository. When configuring access, select the default option: check out the code without using an SSH key.
Once the app is created, go to Settings, then Environment Variables, and create the following key-value pairs:
These environment variables will then be passed into the wercker.yml file before it is evaluated by Wercker.
Make some changes to your code. Then, push to GitHub.
Wercker will see this, and do the following:
There we have it.
Continuous deployment with Helm Classic, Deis Workflow, and Werker.
Stay tuned for more posts like this.