In this blog post, we are going to talk about doing continuous delivery with two really cool platforms, spinnaker and kubernetes. We will briefly go over both platforms and then dig into the reason to use both of them together for CD and lastly, some use cases.
Describing spinnaker and kubernetes
As a refresher, spinnaker enables teams to automate deployments across multiple cloud accounts and regions, and even across multiple cloud platforms, into pipelines that are run whenever a new version is released. Kubernetes is a container platform or microservice platform that orchestrates computing, networking, and storage infrastructure workloads developed by google. With these two platforms you can build a solid continuous delivery(CD) pipeline with best practice built into it.
Continuous Delivery with spinnaker
Code changes should naturally go through a spinnaker pipeline that looks like the following diagram
In the simplified pipeline above, we do not have any complicated logic in it so it can be achieved with tools like jenkins 2.0 which has its own CD extension since it was not originally built for CD. However, spinnaker was built to combine CI with CD in one platform and on top of that it has the added benefit of managing your deployed cloud applications. With spinnaker in the mix, you are guaranteed to have a safe deployment every time.
Spinnaker was built to be multi cloud so there is a strong case for using it to deploy to cloud services like AWS and GCP but the way kubernetes was built makes it a perfect fit for spinnaker. K8s was built with the following in mind
- Fast deployment
- Multi cloud
- Rollout is according to policy define
Robust CD Pipeline
By combining both of these platforms, we can build a fully automated CD pipeline that allows us to deploy applications with best practices built into it. By leveraging spinnaker and k8s, we get
- Seamless resource mapping especially with the v2 of the k8s.
- Advance deployment strategy like canary.
- Deployment Rollback.
- Spinnaker first class support for k8s unlike tools like jenkins.
- Spinnaker will version deployed manifest to k8s to use for rollbacks.
- Spinnaker will monitor the health of your application in k8s. It allows not only to deploy to but gives a good view of the health of the k8s application and cluster.
- Integration for CI tools like jenkins to pull artifacts.
There are a lot of uses cases. A simple use case could be detecting a container image push, performing some tests and deploying that image to k8s if test pass.The diagram below shows what the flow looks like.
Another use case is to use spinnaker to build an AMI in one of the stages with the help of packer, then deploying that AMI to production after test passes with the benefit of seeing the state of our deployed k8s application. One other way people use both together is to deploy spinnaker itself on k8s as a deployment, and using that deployed spinnaker cluster to deploy to the host k8s cluster.
We discussed how to integrate both and how some of their features complement each other. To give it a try, Installation of both spinnaker and kubernetes is very well documented and that includes integration.
These postings are my own and do not necessarily represent BMC's position, strategies, or opinion.
See an error or have a suggestion? Please let us know by emailing email@example.com.