Continuous Delivery with Jenkins & Kubernetes @ Sky

24
Continuous Delivery with Jenkins & Kubernetes @ Sky Adriana Vasiu

Transcript of Continuous Delivery with Jenkins & Kubernetes @ Sky

Page 1: Continuous Delivery with Jenkins & Kubernetes @ Sky

Continuous Delivery with Jenkins & Kubernetes @ SkyAdriana Vasiu

Page 2: Continuous Delivery with Jenkins & Kubernetes @ Sky

Who am I ?

• Principal Software Engineer @ Sky

• Polyglot developer

• Speaker

Page 3: Continuous Delivery with Jenkins & Kubernetes @ Sky

Agenda

• Building smart deployment pipelines

• Decoupling from infrastructure

• Demo

• Next Steps

Page 4: Continuous Delivery with Jenkins & Kubernetes @ Sky

The Problem

Page 5: Continuous Delivery with Jenkins & Kubernetes @ Sky

Requirements & Constraints for the Platform

Requirements &

Constraints

Microservices

Java Apps

Dev Ops Unavailable

Changing infrastructure

Parallel Teams

Python Apps

Page 6: Continuous Delivery with Jenkins & Kubernetes @ Sky

Step A. Build a Smart Deployment Pipeline

Page 7: Continuous Delivery with Jenkins & Kubernetes @ Sky

Standardised pipelines

• Easy bootstrap for components

• Automatic creation of jobs and pipelines

• Independent of platform as a service

• Independent of component technology

Page 8: Continuous Delivery with Jenkins & Kubernetes @ Sky

Pipeline - Path to Production

Page 9: Continuous Delivery with Jenkins & Kubernetes @ Sky

Tools & Plugins

• Jenkins - version 1.651.2

• Job DSL Plugin - version 1.48

• Custom Groovy DSL jobs generator

• Docker for Jenkins master & slaves

• Kubernetes for deployment of Jenkins master & slaves

• Jenkins Kubernetes Plugin - version 0.7

Page 10: Continuous Delivery with Jenkins & Kubernetes @ Sky

Building Steps

App implements pipeline step

DSL generates the standard pipeline

App specifies pipeline type

Page 11: Continuous Delivery with Jenkins & Kubernetes @ Sky

App Config for the Pipeline

projects: service-demo: pipeline: prod monitor-namespaces: - canary - production service-demo-mocks: pipeline: mocks

Page 12: Continuous Delivery with Jenkins & Kubernetes @ Sky

Example of Groovy DSL for Jenkins

job(’01-Build-service-demo') { scm { git(gitUrl) } triggers { scm('*/15 * * * *') } steps { gradle { tasks(":ciBuild") useWrapper(true)

} }}

Page 13: Continuous Delivery with Jenkins & Kubernetes @ Sky

Step B. Decouple from your Target Infrastructure

Page 14: Continuous Delivery with Jenkins & Kubernetes @ Sky

Container Based Deployment

Page 15: Continuous Delivery with Jenkins & Kubernetes @ Sky

Kubernetes Architecture

Page 16: Continuous Delivery with Jenkins & Kubernetes @ Sky

Why Kubernetes?

• orchestrates containers

• self-healing: auto-placement, auto-restart, auto-replication, auto-scaling

• portable: public, private, hybrid, multi-cloud

Page 17: Continuous Delivery with Jenkins & Kubernetes @ Sky

Decoupled Deployments?

Custom Gradle Platform Plugin

Packaging DeploymentPromotionPublishing

Page 18: Continuous Delivery with Jenkins & Kubernetes @ Sky

Short Summary

Page 19: Continuous Delivery with Jenkins & Kubernetes @ Sky

Summary

• Pipeline generation • Quality gates - standardised• No more manual changes on CI server• Flexibility for each app to define steps• Works for different technologies (Gradle wrapper)• New apps are easy to bootstrap

• Platform abstraction• Decouples apps from infrastructure

Page 20: Continuous Delivery with Jenkins & Kubernetes @ Sky

Demo

Page 21: Continuous Delivery with Jenkins & Kubernetes @ Sky

Next Steps

Page 22: Continuous Delivery with Jenkins & Kubernetes @ Sky

Future Improvements

• Open Source Jenkins DSL Jobs Generator

• Look into Jenkins 2.+

• Automate Jenkins master re-deployment on a change to the image

Page 23: Continuous Delivery with Jenkins & Kubernetes @ Sky

Sources

• https://github.com/kubernetes/kubernetes• http://kubernetes.io• https://github.com/jenkinsci/job-dsl-plugin• https://github.com/jenkinsci/kubernetes-plugin

Page 24: Continuous Delivery with Jenkins & Kubernetes @ Sky

Thank you!@vasiu_adriana