Takeaways from DevOps World 2018 — part I

Continuous Deployment using Jenkins and Kubernetes

Mattias Sluis
KPN Developers Blog
3 min readOct 1, 2018

--

I was in San Francisco last week to attend DevOps World 2018 (also known as Jenkins World). This conference is all about DevOps related topics with a special focus on Jenkins and Kubernetes. At KPN we are in the process of moving all our Jenkins instances into Kubernetes (we deliver a managed Jenkins as a Service to development teams), so it is great to hear stories of other companies that are in the same process and share their ideas and solutions.

On Monday I followed the “Continuously Deploying Application to a Kubernetes Cluster” workshop by Viktor Farcic. We were guided through the process of bringing a simple application to production on Kubernetes. 99% of the session took place on the command line, following the principle that UIs are evil and the fact that everything done on the command line can easily be automated.

“When used by engineers, UIs are evil. They sidetrack us from repeatability and automation”

Each step of the process was executed and verified on the command line first and then put together in the pipeline. The great benefit of this approach is that we have a great understanding of each step in the process and saves us from a lot of trial-and-error within Jenkins.

A bunch of takeaways from this workshop:

  • It is preferred to use standard commands rather than magic from plugins. This makes the steps more clear and you have no differences between your pipeline and the way you would do it manually.
  • Although it is possible to build docker images on Kubernetes, it is not secure. It requires a container to have access to the docker socket on the host, which gives control over everything else that runs on that node. Instead, it is still preferred to use something like a (ephemeral) VM to execute your Docker commands.
    There is a project from Google called Kaniko that allows you to build Docker images without Docker which might be a good alternative as it matures.
  • Put reusable and complex groovy scripts that are in your pipeline in a shared library. I elaborate more on this in my follow up post.
  • Use multi-stage Docker builds to test, compile and package your application with a single Dockerfile.

I also learned a few new tricks:

  • You can modify ‘currentBuild.displayName’ to manipulate the way your build is displayed in the UI.
  • In “Manage Jenkins” -> “Configure Global Security”, select “Enable security”. Next to Markup Formatter, select “PegDown” from the dropdown list. The requires the “pegdown-formatter” plugin and will give you nicer markup when reading the Jenkins Pipeline Syntax pages.

You can find the presentation of Viktor on Github: http://vfarcic.github.io/devops24/workshop-4h.html

Originally published at medium.com on October 1, 2018.

--

--

Mattias Sluis
KPN Developers Blog

Developer productivity engineer at KPN with the mission to continuously improve the development process for all development teams at KPN.