~/talk

Moving the Unmovable: migrating from VMs to K8s

Talkat DevConf.CZ 2020 · 2020-01-24..01-26· [kubernetes, devops-and-delivery]
links:none on file
slides:none on file

Red Hat CoreOS builds move from VM-based Jenkins to OpenShift/Kubernetes over three iterations in about six months, trading persistent Jenkins state for ephemeral Jenkins pods and a declarative job spec model. The pipeline uses CoreOS assembler to produce OS disk images in under an hour, runs ~20 developer pipelines plus four production snapshots, externalizes state to S3 and secrets/configmaps, and solves KVM device needs by temporarily granting then dropping privileges for KVM access via privileged pod.

AI-written summary · about

  1. 0:00Intro
  2. 1:05Two Migrations: only one success Before coming to Red Hat, I participated in a failed Kubernetes Migration At $PREVIOUS_JOB, we were able to deploy, but we could never "rust" it. The workload never shifted. Only towards the end of the Pipeline did the lessons start to distill
  3. 5:13Do NOT feed after midnight: A six month journey • The biggest problem was our thinking "the pipeline" instead of 'n pipeline." We conflated the process with output Our requirement of moving juxtaposed to the K&S idea of "deploying
  4. 7:40The service's environment is the single largest obstacle to moving a service.
  5. 9:53If you think in terms of "moving," you are off to a bad start "Lift and Shift" almost never works. We moved the pipeline.
  6. 10:46Options are great: deployments are cheap • Resist the temptation to maintain feature parity, especially for organically grown services Declarative code means declarative behavior. Locate where the defaults come from.
  7. 14:22Use a Single Templating System OpenShift supports templating • We had four sets of defaults: o Makefiles The YAML templates The Jenkins Groovy o OpenShift build en Vars which set Jenkins parameters
  8. 17:03If you can describe the service in YAML/JSON, then you can describe the environment and config the same way. Embrace the YAML/JSON early.
  9. 17:34The Better Ways() • Option 1: config/secret map and "source" it • Option 2: teach your Gremlins to understand the YAML. We use both options. This gave us flexibility: YAML allows for us to describe N variants of pipeline Sourcing allows us to store config in the KS way, • ConfigMaps/Secrets are shareable within the namespace
  10. 18:54Environments: It must be loosely coupled Define the who, what and why of the environment • Place the environment setters outside the service itself. Git branches for Configuration and Code
  11. 20:53Jenkins: Not Cloud Native • We spent way more time in Jenkins land that we cared to • Custom Master and Slave Docker Images Scripted the Jenkins Setup Memory issues (Jenkins is greedy) • Had to implement CI for our Jenkins Pipeline. • Logs were painful Better than a beer after a long day: "oc delete pod/jenkins..."
  12. 26:32Namespaces, DNS, etc. For deployability, use variables when you can. If you rely on external resources, consider
  13. 27:24The second largest obstacle is how you develop, test and deploy services. {Dev Git}Ops anyone?
  14. 28:25Triggered by Jenkins and Jenkins being Triggered • A horrible mistake was trying to support the Jenkins UI and OpenShift build parameters. Truthiness. Pick on way for the service to be triggered
  15. 30:30Complexity Management At the number of pipelines exploded, so did the complexity. • When we realized that we could have all the knobs, we added them • The knobs were incredibly powerful Knobs are brittle • Clever code is dangerous code. • A lot of the knobs have been removed. • Carefully consider the cost of introducing complexity
  16. 33:19Six Months with Three Versions of OpenShift We started on UpShift, OpenShift 37 • Moved to a VM-based 3.11 Cluster Finally settled on a bare-metal 3.11 cluster with KVM access. One thing we did well was to plan for frequent deployment. From 3.7 to 3.11 took roughly two weeks • From 311 VM to 3.11 bare metal took 45 Minutes
  17. 34:30If we did it again • It would have been less work to start from scratch. • Challenge the assumptions and the dependencies Use OpenShift BuildConfigs natively. Break the monolith first. Composable pieces. Simplify. • Do not conflate the workload with the environment Determine what is really being moved. Better integration in the full OpenShift end-to-end tests
  18. 35:32Our thinking changed Service is now completely re-deployable We plan around Jenkins failing State is stored elsewhere (S3, Koji/Brew). • OpenShift is the environment, Jenkins is the execution runner Trained people to NOT look at Jenkins (that's for developers)
  19. 36:12Had we thought more about results and less about the "how" we would have made different decisions.
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.