we are currently playing around with kubernetes+docker. At the moment I'm wondering how to integrate bamboo in our deployment process during development and for release.
Our current CI process is like this:
This is the current workflow at the moment. Now I would like to use bamboos deployment functionality to deploy the docker image to our kubernetes clusters.
From a technical point it should be pretty easy:
My question is how do I get the name of the docker image that is created during the build within my deployment task. I already thought that I might create a properties file with the variables which I store as an artifact in the build process. I could read-out this property file within my deployment process...
Somehow this feels more like a workaround..another idea would be to do the deployment directly within the build task and don't use the deployment functionality at all...
Is there another option? Has anyone another option/better idea? Thoughts/Help would be very nice :)
I've faced a similar issue with a very similar build/deploy pipeline and I did end up having to output a properties file from the build step and make it a build artifact, that then gets read in by the deploy project.
There seem only to be a limited set of properties that you can access from a deployment project: https://confluence.atlassian.com/bamboo/variables-for-deployment-environments-342754180.html
Having said that, it is pretty easy to do the export:
In the build project export the properties you want into a file e.g project.properties and mark that as a build artifact.
Then in the deploy project, use the Inject Bamboo variables task, and the values will be available to the deployment project as
${bamboo.inject.<property name>}
I'm not familiar with Bamboo, but Kubernetes 1.2 will support the Deployment API, which will perform the rolling update on your behalf once you update the Deployment spec to the new image tag.
Alternatively, you could try Openshift 3, which is built on Kubernetes. It supports deployments triggered by image pushes: https://github.com/openshift/origin/blob/master/docs/deployments.md#triggers