Deploy Your Applications to Kubernetes using GitLab CI and k8s-deploy-helper 1.0.0

Will Platnick
Open Digerati
Published in
3 min readFeb 7, 2018

--

We are excited to announce the launch of k8s-deploy-helper 1.0.0, a tool we use to help build and deploy containerized applications into Kubernetes using GitLab CI.

Major Features:

  • Automated Kubernetes Secret Management using GitLab’s UI
  • Templated manifest deployments to Kubernetes living in the same repo as the code, giving developers more control.
  • Easy, standardized image creation with build arguments and multiple Dockerfile support
  • Standardized container tag conventions to allow for easy rollbacks through GitLab UI and better caching
  • New Relic deployment notification

Getting Started

Check out the k8s-deploy-helper repository on GitHub for basic feature documentation.

After that, check out our example repository that contains everything you need to build a full pipeline, using a Go app as an example. This repo also has documentation that does a deep dive into what operations are happening in the background for those who are interested.

If you find this tool useful, please consider starring the repos on GitHub, and we are always open to PR’s!

Need some help getting started? Feel free to join us on Slack in #k8s and we’ll be more than happy to assist.

Why?

GitLab’s Auto DevOps initiative is amazing for getting simple apps running quickly, but for slightly more complex and production workloads, you need more control in the process. For instance, what if you have a pod with sidecar containers because you want to run inside a service mesh? What if you want a deployment of worker pods using something like celery for async work? You’ll need to interact with Kubernetes at a deeper level to do stuff like this, and that’s where our project comes in.

At Life.Church, we wanted to create a standardized tool along with corresponding conventions that our developers could use with GitLab CI to allow us to get up and running with manifest-based deployments as quickly and easily as possible. So, we took the work that GitLab started, and used it as the base of a new project that would meet our needs.

This tool was created akin to an airplane that was built while we were flying it. Our process is constantly maturing as we learn more about how to deploy into k8s. Our goal isn’t to say ‘this is the best way of deploying’, but simply to share how we’re doing it now knowing that it will at least be a helpful starting place for others who are embarking on their Kubernetes journey.

Future

As far as improvements we’d like to make, even though secret management through GitLab is WAY better than committing things in plain text, we would like to make a secret workflow that uses Vault. Additionally, we’d like to enable the creation of Helm packages.

Managing Kubernetes manifests has turned out to be much harder for our devs than we anticipated because knowing where to put each section of manifest is sometimes way harder than it should be. Is it part of spec or a subsection of something else? Which spec? For now, we overcome this hardship by having example repos with best practices.

We’re not exactly sure what the future holds as far as people interacting with Kubernetes through manifest files, because lots of people have discovered this same hardship. We’re looking at tools that keep getting better like ksonnet and metaparticle to help with the process of managing or abstracting away Kubernetes manifest files in the future.

Wait, you’re a church that uses Kubernetes and open sources software? What’s up with that?

We sure are! We’re a church that truly believes it is more blessed to give than to receive. One of our ministries is the world’s most popular free Bible app, YouVersion. We also have a team whose primary job is to build free applications and services for other churches to use such as Church Online Platform, Church Metrics and Develop.me.

This tool is being open-sourced as part of our Open Digerati initiative. If you are passionate about using technolgy for a higher purpose, please check out our jobs listings.

--

--