SlideShare a Scribd company logo
1 of 19
Download to read offline
Discover. Collaborate. Deploy.
Continuous Delivery
to Kubernetes with
Jenkins and Helm
David Currie | @dcurrie
Why run Jenkins on Kubernetes?
• Containerize components
• Isolated Jenkins masters
• Isolated agents and jobs
• Enforce memory and CPU limits
• Container orchestration
• Highly available Jenkins master
• Leverage pluggable persistent storage
• Dynamically scale number of agents across nodes
• Remove reliance on Jenkins plugins
/* Discover. Collaborate. Deploy. */ 2
Prereqs
• A Kubernetes cluster:
• IBM Cloud Containers
• IBM Cloud Private
• Docker for Mac/Windows
(Edge)
• minikube
• …
• kubectl
• Helm client
> brew cask install minikube
> minikube start
> minikube addons enable ingress
> minikube addons enable registry
> brew install kubectl
> brew install kubernetes-helm
/* Discover. Collaborate. Deploy. */ 3
Getting started with Helm
• ‘Package manager’ for Kubernetes
• Packages called charts stored in one or more repositories
• Charts contain templatized Kubernetes configuration
• Setup client configuration and install server-side tiller
> helm init
• Check tiller is available
> kubectl rollout status deployment -n kube-system tiller-deploy
/* Discover. Collaborate. Deploy. */ 4
https://helm.sh/
Deploying Jenkins with Helm
• Find the Jenkins Helm chart
• Search kubeapps.com or
> helm search jenkins
• Install the chart
> helm install --name cd stable/jenkins
• Creates deployment, services, secret, config maps and persistent
volume claim
• Follow the instructions to retrieve the Jenkins admin password
• Access the Jenkins UI
> minikube service cd-jenkins
/* Discover. Collaborate. Deploy. */ 5
Kubernetes plugin for Jenkins
• Developed by Carlos Sanchez @ CloudBees
• Spins up Jenkins slave as Kubernetes pod on demand
• Pod template defines containers that should exist in pod
• JNLP agent is always one of them
• Enables re-use of existing Docker images e.g. maven, golang or docker
• Template can define other configuration for the pod/containers
• Environment variables
• Mount from secret, config map or volume
/* Discover. Collaborate. Deploy. */ 6
Kubernetes plugin and Jenkins pipelines
• Pod templates can be defined in Jenkins configuration or
declaratively as part of a Jenkins pipeline either in the job
definition or in version control as a Jenkinsfile
podTemplate(label: 'mypod', inheritFrom: 'default',
containers: [
containerTemplate(name: 'maven', image: 'maven',
ttyEnabled: true, command: 'cat')
]) {
node('mypod') {
stage ('Extract') { checkout scm }
stage ('Build') { container ('maven') { mvn package } }
}
}
/* Discover. Collaborate. Deploy. */ 7
Creating your own Helm charts
>helm create test
test/
Chart.yaml
values.yaml
charts/
templates/
NOTES.txt
_helpers.tpl
deployment.yaml
ingress.yaml
service.yaml
/* Discover. Collaborate. Deploy. */ 8
Example variables and template usage
• values.yaml
image:
repository: nginx
tag: stable
pullPolicy: IfNotPresent
• deployment.yaml
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{.Values.image.pullPolicy }}
/* Discover. Collaborate. Deploy. */ 9
Overriding chart values
• Variables can be overridden at install time
• As command line parameters:
> helm install test --set image.tag=1.13
• And/or via a file:
> helm install test --values overrides.yaml
/* Discover. Collaborate. Deploy. */ 10
Installing charts in a pipeline
• Charts can be kept in a separate repository or stored alongside
the application source code
• Create a Docker image containing the Helm client
• Deploy tiller independently and use
> helm init --client-only
• Kubernetes configuration automatically available in pod
• To perform an install or upgrade, use:
> helm upgrade --install ...
• Use overrides to define image to deploy
• The --wait option can be used to wait for pods to start
/* Discover. Collaborate. Deploy. */ 11
More advanced Helm
• Ensure Helm chart is well formed:
> helm lint --strict ...
• Verify successful deployment
> helm test ...
• Executes and tests exit code for pods annotated with "helm.sh/hook":
test-success or test-failure
• Specify sub-charts in charts directory or requirements.yaml
• E.g. to satisfy a database dependency
• Hooks for lifecycle events e.g. pre/post install
/* Discover. Collaborate. Deploy. */ 12
Jenkins Helm chart customization
• Chart values allow customization of almost everything!
• Master.InstallPlugins – list of Jenkins plugins to install
• Master/Agent.image – Docker image for master/slave
• Master.InitScripts – list of Jenkins init scripts
• Master.Jobs – Jenkins XML job configs
• Agent.Cpu/Memory – resource constraints for agent
• Master.CustomConfigMap – allows a parent chart to override
the entire Jenkins config via override_config_map template
• …
/* Discover. Collaborate. Deploy. */ 13
Things to watch out for
• Poor Jenkins performance with network storage
• Jenkins slave pods may get re-used if long-lived
• Lack of access control for Helm
• Enable SSL and deploy tiller per namespace with RBAC
• Don’t use latest tag with images
• If the config doesn’t change, Kubernetes won’t see it as an update
• Use AlwaysPullImages admission controller
• helm --wait only requires minimum pod count to be satisfied
• For replicas=1 and maxUnavailable=1 that is zero!
/* Discover. Collaborate. Deploy. */ 14
Microservice Builder and Microclimate
• Microservice Builder provides a dev-ops pipeline based on the
community Jenkins chart and adding:
• Opinionated Jenkins library
• Docker images pre-built with plugins and adding Power support
• GitHub org and oauth plugins
• Microclimate provides a containerized development
environment capable of running locally or on Kubernetes
• Generates starter templates for Java (Spring or MicroProfile), Node.js
and Swift containing application source, Dockerfile, Helm chart, …
• Rapid iterative build/run/test in a containerized environment
• Option to use a web based or local IDE
/* Discover. Collaborate. Deploy. */ 15
https://microclimate-dev2ops.github.io
Other IBM Helm Charts
https://raw.githubusercontent.com/IBM/charts/master/repo/stable/
/* Discover. Collaborate. Deploy. */ 16
Notices and disclaimers
• © 2018 International Business Machines Corporation. No part of
this document may be reproduced or transmitted in any form without
written permission from IBM.
• U.S. Government Users Restricted Rights — use, duplication or
disclosure restricted by GSA ADP Schedule Contract with IBM.
• Information in these presentations (including information relating to
products that have not yet been announced by IBM) has been
reviewed for accuracy as of the date of initial publication and could
include unintentional technical or typographical errors. IBM shall
have no responsibility to update this information. This document is
distributed “as is” without any warranty, either express or
implied. In no event, shall IBM be liable for any damage arising
from the use of this information, including but not limited to, loss
of data, business interruption, loss of profit or loss of opportunity.
IBM products and services are warranted per the terms and
conditions of the agreements under which they are provided.
• IBM products are manufactured from new parts or new and used
parts.
In some cases, a product may not be new and may have been
previously installed. Regardless, our warranty terms apply.”
• Any statements regarding IBM's future direction, intent or product
plans are subject to change or withdrawal without notice.
• Performance data contained herein was generally obtained in a
controlled, isolated environments. Customer examples are presented
as illustrations of how those
• customers have used IBM products and the results they may have
achieved. Actual performance, cost, savings or other results in other
operating environments may vary.
• References in this document to IBM products, programs, or services
does not imply that IBM intends to make such products, programs or
services available in all countries in which IBM operates or does
business.
• Workshops, sessions and associated materials may have been
prepared by independent session speakers, and do not necessarily
reflect the views of IBM. All materials and discussions are provided
for informational purposes only, and are neither intended to, nor shall
constitute legal or other guidance or advice to any individual
participant or their specific situation.
• It is the customer’s responsibility to insure its own compliance
with legal requirements and to obtain advice of competent legal
counsel as to the identification and interpretation of any
relevant laws and regulatory requirements that may affect the
customer’s business and any actions the customer may need to take
to comply with such laws. IBM does not provide legal advice
or represent or warrant that its services or products will ensure that
the customer follows any law.
17/* Discover. Collaborate. Deploy. */
Notices and disclaimers continued
• Information concerning non-IBM products was obtained from
the suppliers of those products, their
published announcements or other publicly available
sources. IBM has not tested those products about this
publication and cannot confirm the accuracy of performance,
compatibility or any other claims related to non-IBM
products. Questions on the capabilities of non-IBM products
should be addressed to the suppliers of those products.
IBM does not warrant the quality of any third-party products,
or the ability of any such third-party products to
interoperate with IBM’s products. IBM expressly disclaims all
warranties, expressed or implied, including but not limited
to, the implied warranties of merchantability and fitness for
a purpose.
• The provision of the information contained herein is not
intended to, and does not, grant any right or license under any
IBM patents, copyrights, trademarks or other intellectual
property right.
• IBM, the IBM logo, ibm.com and [names of other referenced
IBM products and services used in the presentation] are
trademarks of International Business Machines Corporation,
registered in many jurisdictions worldwide. Other product and
service names might be trademarks of IBM or other
companies. A current list of IBM trademarks is available on
the Web at "Copyright and trademark information" at:
www.ibm.com/legal/copytrade.shtml.
18/* Discover. Collaborate. Deploy. */
Discover. Collaborate. Deploy.
Continuous Delivery to
Kubernetes with
Jenkins and Helm
David Currie | @dcurrie

More Related Content

What's hot

What's hot (20)

MuleSoft Sizing Guidelines - VirtualMuleys
MuleSoft Sizing Guidelines - VirtualMuleysMuleSoft Sizing Guidelines - VirtualMuleys
MuleSoft Sizing Guidelines - VirtualMuleys
 
Manchester MuleSoft Meetup #6 - Runtime Fabric with Mulesoft
Manchester MuleSoft Meetup #6 - Runtime Fabric with Mulesoft Manchester MuleSoft Meetup #6 - Runtime Fabric with Mulesoft
Manchester MuleSoft Meetup #6 - Runtime Fabric with Mulesoft
 
AWS Landing Zone Deep Dive (ENT350-R2) - AWS re:Invent 2018
AWS Landing Zone Deep Dive (ENT350-R2) - AWS re:Invent 2018AWS Landing Zone Deep Dive (ENT350-R2) - AWS re:Invent 2018
AWS Landing Zone Deep Dive (ENT350-R2) - AWS re:Invent 2018
 
An introduction to AWS CloudFormation - Pop-up Loft Tel Aviv
An introduction to AWS CloudFormation - Pop-up Loft Tel AvivAn introduction to AWS CloudFormation - Pop-up Loft Tel Aviv
An introduction to AWS CloudFormation - Pop-up Loft Tel Aviv
 
Crossplane @ Mastering GitOps.pdf
Crossplane @ Mastering GitOps.pdfCrossplane @ Mastering GitOps.pdf
Crossplane @ Mastering GitOps.pdf
 
API strategy with IBM API connect
API strategy with IBM API connectAPI strategy with IBM API connect
API strategy with IBM API connect
 
Anypoint platform architecture and components
Anypoint platform architecture and componentsAnypoint platform architecture and components
Anypoint platform architecture and components
 
Introduction to Amazon EKS
Introduction to Amazon EKSIntroduction to Amazon EKS
Introduction to Amazon EKS
 
MuleSoft Runtime Fabric (RTF): Foundations : MuleSoft Virtual Muleys Meetups
MuleSoft Runtime Fabric (RTF): Foundations  : MuleSoft Virtual Muleys MeetupsMuleSoft Runtime Fabric (RTF): Foundations  : MuleSoft Virtual Muleys Meetups
MuleSoft Runtime Fabric (RTF): Foundations : MuleSoft Virtual Muleys Meetups
 
Running Kubernetes on AWS
Running Kubernetes on AWSRunning Kubernetes on AWS
Running Kubernetes on AWS
 
Building PaaS with Amazon EKS for the Large-Scale, Highly Regulated Enterpris...
Building PaaS with Amazon EKS for the Large-Scale, Highly Regulated Enterpris...Building PaaS with Amazon EKS for the Large-Scale, Highly Regulated Enterpris...
Building PaaS with Amazon EKS for the Large-Scale, Highly Regulated Enterpris...
 
OPENSHIFT CONTAINER PLATFORM CI/CD Build & Deploy
OPENSHIFT CONTAINER PLATFORM CI/CD Build & DeployOPENSHIFT CONTAINER PLATFORM CI/CD Build & Deploy
OPENSHIFT CONTAINER PLATFORM CI/CD Build & Deploy
 
Highlights of WSO2 API Manager 4.0.0
Highlights of WSO2 API Manager 4.0.0Highlights of WSO2 API Manager 4.0.0
Highlights of WSO2 API Manager 4.0.0
 
Introducing AWS Device Farm
Introducing AWS Device FarmIntroducing AWS Device Farm
Introducing AWS Device Farm
 
AWSome Day Online Conference 2019 - Module 1 AWS Cloud Concepts.pdf
AWSome Day Online Conference 2019 - Module 1 AWS Cloud Concepts.pdfAWSome Day Online Conference 2019 - Module 1 AWS Cloud Concepts.pdf
AWSome Day Online Conference 2019 - Module 1 AWS Cloud Concepts.pdf
 
Kubernetes Helm: Why It Matters
Kubernetes Helm: Why It MattersKubernetes Helm: Why It Matters
Kubernetes Helm: Why It Matters
 
Virtual meetup - Exploring the Runtime Fabric deployment model
Virtual meetup - Exploring the Runtime Fabric deployment modelVirtual meetup - Exploring the Runtime Fabric deployment model
Virtual meetup - Exploring the Runtime Fabric deployment model
 
AWS VPN Solutions (NET304) - AWS re:Invent 2018
AWS VPN Solutions (NET304) - AWS re:Invent 2018AWS VPN Solutions (NET304) - AWS re:Invent 2018
AWS VPN Solutions (NET304) - AWS re:Invent 2018
 
NGINX Ingress Controller for Kubernetes
NGINX Ingress Controller for KubernetesNGINX Ingress Controller for Kubernetes
NGINX Ingress Controller for Kubernetes
 
EKS vs GKE vs AKS - Evaluating Kubernetes in the Cloud
EKS vs GKE vs AKS - Evaluating Kubernetes in the CloudEKS vs GKE vs AKS - Evaluating Kubernetes in the Cloud
EKS vs GKE vs AKS - Evaluating Kubernetes in the Cloud
 

Similar to Continuous Delivery to Kubernetes with Jenkins and Helm

Sa106 – practical solutions for connections administrators
Sa106 – practical solutions for connections administratorsSa106 – practical solutions for connections administrators
Sa106 – practical solutions for connections administrators
Sharon James
 

Similar to Continuous Delivery to Kubernetes with Jenkins and Helm (20)

How to Containerize WebSphere Application Server Traditional, and Why You Mig...
How to Containerize WebSphere Application Server Traditional, and Why You Mig...How to Containerize WebSphere Application Server Traditional, and Why You Mig...
How to Containerize WebSphere Application Server Traditional, and Why You Mig...
 
12-factor applications using WAS Liberty, IBM Bluemix, and Docker
12-factor applications using WAS Liberty, IBM Bluemix, and Docker12-factor applications using WAS Liberty, IBM Bluemix, and Docker
12-factor applications using WAS Liberty, IBM Bluemix, and Docker
 
Java Development on Bluemix
Java Development on BluemixJava Development on Bluemix
Java Development on Bluemix
 
Tips for Developing and Testing IBM HATS Applications
Tips for Developing and Testing IBM HATS ApplicationsTips for Developing and Testing IBM HATS Applications
Tips for Developing and Testing IBM HATS Applications
 
WebSphere Liberty and IBM Containers: The Perfect Combination for Java Micros...
WebSphere Liberty and IBM Containers: The Perfect Combination for Java Micros...WebSphere Liberty and IBM Containers: The Perfect Combination for Java Micros...
WebSphere Liberty and IBM Containers: The Perfect Combination for Java Micros...
 
Externalized Distributed Configuration Management with Spring Cloud Config-Se...
Externalized Distributed Configuration Management with Spring Cloud Config-Se...Externalized Distributed Configuration Management with Spring Cloud Config-Se...
Externalized Distributed Configuration Management with Spring Cloud Config-Se...
 
Enabling a hardware accelerated deep learning data science experience for Apa...
Enabling a hardware accelerated deep learning data science experience for Apa...Enabling a hardware accelerated deep learning data science experience for Apa...
Enabling a hardware accelerated deep learning data science experience for Apa...
 
Become an IBM Cloud Architect in 40 Minutes
Become an IBM Cloud Architect in 40 MinutesBecome an IBM Cloud Architect in 40 Minutes
Become an IBM Cloud Architect in 40 Minutes
 
Edge 2016 Session 1886 Building your own docker container cloud on ibm power...
Edge 2016 Session 1886  Building your own docker container cloud on ibm power...Edge 2016 Session 1886  Building your own docker container cloud on ibm power...
Edge 2016 Session 1886 Building your own docker container cloud on ibm power...
 
IBM Connect 2016: Speaker Session with Teresa Deane, Senior Developer, BCC
IBM Connect 2016: Speaker Session with Teresa Deane, Senior Developer, BCCIBM Connect 2016: Speaker Session with Teresa Deane, Senior Developer, BCC
IBM Connect 2016: Speaker Session with Teresa Deane, Senior Developer, BCC
 
Gateway deepdive
Gateway deepdiveGateway deepdive
Gateway deepdive
 
DEV-1268: IBM Connections Adminblast – IBM Connect 2017
DEV-1268: IBM Connections Adminblast – IBM Connect 2017DEV-1268: IBM Connections Adminblast – IBM Connect 2017
DEV-1268: IBM Connections Adminblast – IBM Connect 2017
 
AD208 - End to End Quality Processes for Top Notch XPages Apps
AD208 - End to End Quality Processes for Top Notch XPages AppsAD208 - End to End Quality Processes for Top Notch XPages Apps
AD208 - End to End Quality Processes for Top Notch XPages Apps
 
Tip from ConnectED 2015: IBM Sametime - Design and Implementation of a Full H...
Tip from ConnectED 2015: IBM Sametime - Design and Implementation of a Full H...Tip from ConnectED 2015: IBM Sametime - Design and Implementation of a Full H...
Tip from ConnectED 2015: IBM Sametime - Design and Implementation of a Full H...
 
IBM Message Hub: Cloud-Native Messaging
IBM Message Hub: Cloud-Native MessagingIBM Message Hub: Cloud-Native Messaging
IBM Message Hub: Cloud-Native Messaging
 
IBM Connections Adminblast - Connect17 (DEV 1268)
IBM Connections Adminblast - Connect17 (DEV 1268)IBM Connections Adminblast - Connect17 (DEV 1268)
IBM Connections Adminblast - Connect17 (DEV 1268)
 
Creating Production-Ready, Secure and Scalable Applications in IBM Cloud Priv...
Creating Production-Ready, Secure and Scalable Applications in IBM Cloud Priv...Creating Production-Ready, Secure and Scalable Applications in IBM Cloud Priv...
Creating Production-Ready, Secure and Scalable Applications in IBM Cloud Priv...
 
DRUPAL CI/CD FROM DEV TO PROD WITH GITLAB, KUBERNETES AND HELM
DRUPAL CI/CD FROM DEV TO PROD WITH GITLAB, KUBERNETES AND HELMDRUPAL CI/CD FROM DEV TO PROD WITH GITLAB, KUBERNETES AND HELM
DRUPAL CI/CD FROM DEV TO PROD WITH GITLAB, KUBERNETES AND HELM
 
Service Testing & Virtualization in an Enterprise Environments
Service Testing & Virtualization in an Enterprise EnvironmentsService Testing & Virtualization in an Enterprise Environments
Service Testing & Virtualization in an Enterprise Environments
 
Sa106 – practical solutions for connections administrators
Sa106 – practical solutions for connections administratorsSa106 – practical solutions for connections administrators
Sa106 – practical solutions for connections administrators
 

More from David Currie

More from David Currie (15)

Microservice Builder: A Microservice DevOps Pipeline for Rapid Delivery and P...
Microservice Builder: A Microservice DevOps Pipeline for Rapid Delivery and P...Microservice Builder: A Microservice DevOps Pipeline for Rapid Delivery and P...
Microservice Builder: A Microservice DevOps Pipeline for Rapid Delivery and P...
 
IBM WebSphere Liberty and Docker Deep Dive
IBM WebSphere Liberty and Docker Deep DiveIBM WebSphere Liberty and Docker Deep Dive
IBM WebSphere Liberty and Docker Deep Dive
 
WebSphere and Docker
WebSphere and DockerWebSphere and Docker
WebSphere and Docker
 
IBM WebSphere Application Server traditional and Docker
IBM WebSphere Application Server traditional and DockerIBM WebSphere Application Server traditional and Docker
IBM WebSphere Application Server traditional and Docker
 
IBM WebSphere Liberty and Docker Deep Dive
IBM WebSphere Liberty and Docker Deep DiveIBM WebSphere Liberty and Docker Deep Dive
IBM WebSphere Liberty and Docker Deep Dive
 
WebSphere Application Server Liberty Profile and Docker
WebSphere Application Server Liberty Profile and DockerWebSphere Application Server Liberty Profile and Docker
WebSphere Application Server Liberty Profile and Docker
 
Scalable, Available and Reliable Cloud Applications with PaaS and Microservices
Scalable, Available and Reliable Cloud Applications with PaaS and MicroservicesScalable, Available and Reliable Cloud Applications with PaaS and Microservices
Scalable, Available and Reliable Cloud Applications with PaaS and Microservices
 
Platform as a Service - Cloud Foundry and IBM Bluemix
Platform as a Service - Cloud Foundry and IBM BluemixPlatform as a Service - Cloud Foundry and IBM Bluemix
Platform as a Service - Cloud Foundry and IBM Bluemix
 
Building out a Microservices Architecture with WebSphere Liberty Profile and ...
Building out a Microservices Architecture with WebSphere Liberty Profile and ...Building out a Microservices Architecture with WebSphere Liberty Profile and ...
Building out a Microservices Architecture with WebSphere Liberty Profile and ...
 
Developing Enterprise Applications for the Cloud, from Monolith to Microservices
Developing Enterprise Applications for the Cloud,from Monolith to MicroservicesDeveloping Enterprise Applications for the Cloud,from Monolith to Microservices
Developing Enterprise Applications for the Cloud, from Monolith to Microservices
 
Migrating Java EE applications to IBM Bluemix Platform-as-a-Service
Migrating Java EE applications to IBM Bluemix Platform-as-a-ServiceMigrating Java EE applications to IBM Bluemix Platform-as-a-Service
Migrating Java EE applications to IBM Bluemix Platform-as-a-Service
 
Introduction to Microservices and Cloud Native Application Architecture
Introduction to Microservices and Cloud Native Application ArchitectureIntroduction to Microservices and Cloud Native Application Architecture
Introduction to Microservices and Cloud Native Application Architecture
 
WebSphere Application Server Liberty Profile and Docker
WebSphere Application Server Liberty Profile and DockerWebSphere Application Server Liberty Profile and Docker
WebSphere Application Server Liberty Profile and Docker
 
Scalable, Available and Reliable Cloud Applications with PaaS and Microservices
Scalable, Available and Reliable Cloud Applications with PaaS and MicroservicesScalable, Available and Reliable Cloud Applications with PaaS and Microservices
Scalable, Available and Reliable Cloud Applications with PaaS and Microservices
 
Taking the Application Server to Web Scale with Netflix Open Source Software
Taking the Application Server to Web Scale with Netflix Open Source SoftwareTaking the Application Server to Web Scale with Netflix Open Source Software
Taking the Application Server to Web Scale with Netflix Open Source Software
 

Recently uploaded

Recently uploaded (20)

The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overview
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdf
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 

Continuous Delivery to Kubernetes with Jenkins and Helm

  • 1. Discover. Collaborate. Deploy. Continuous Delivery to Kubernetes with Jenkins and Helm David Currie | @dcurrie
  • 2. Why run Jenkins on Kubernetes? • Containerize components • Isolated Jenkins masters • Isolated agents and jobs • Enforce memory and CPU limits • Container orchestration • Highly available Jenkins master • Leverage pluggable persistent storage • Dynamically scale number of agents across nodes • Remove reliance on Jenkins plugins /* Discover. Collaborate. Deploy. */ 2
  • 3. Prereqs • A Kubernetes cluster: • IBM Cloud Containers • IBM Cloud Private • Docker for Mac/Windows (Edge) • minikube • … • kubectl • Helm client > brew cask install minikube > minikube start > minikube addons enable ingress > minikube addons enable registry > brew install kubectl > brew install kubernetes-helm /* Discover. Collaborate. Deploy. */ 3
  • 4. Getting started with Helm • ‘Package manager’ for Kubernetes • Packages called charts stored in one or more repositories • Charts contain templatized Kubernetes configuration • Setup client configuration and install server-side tiller > helm init • Check tiller is available > kubectl rollout status deployment -n kube-system tiller-deploy /* Discover. Collaborate. Deploy. */ 4 https://helm.sh/
  • 5. Deploying Jenkins with Helm • Find the Jenkins Helm chart • Search kubeapps.com or > helm search jenkins • Install the chart > helm install --name cd stable/jenkins • Creates deployment, services, secret, config maps and persistent volume claim • Follow the instructions to retrieve the Jenkins admin password • Access the Jenkins UI > minikube service cd-jenkins /* Discover. Collaborate. Deploy. */ 5
  • 6. Kubernetes plugin for Jenkins • Developed by Carlos Sanchez @ CloudBees • Spins up Jenkins slave as Kubernetes pod on demand • Pod template defines containers that should exist in pod • JNLP agent is always one of them • Enables re-use of existing Docker images e.g. maven, golang or docker • Template can define other configuration for the pod/containers • Environment variables • Mount from secret, config map or volume /* Discover. Collaborate. Deploy. */ 6
  • 7. Kubernetes plugin and Jenkins pipelines • Pod templates can be defined in Jenkins configuration or declaratively as part of a Jenkins pipeline either in the job definition or in version control as a Jenkinsfile podTemplate(label: 'mypod', inheritFrom: 'default', containers: [ containerTemplate(name: 'maven', image: 'maven', ttyEnabled: true, command: 'cat') ]) { node('mypod') { stage ('Extract') { checkout scm } stage ('Build') { container ('maven') { mvn package } } } } /* Discover. Collaborate. Deploy. */ 7
  • 8. Creating your own Helm charts >helm create test test/ Chart.yaml values.yaml charts/ templates/ NOTES.txt _helpers.tpl deployment.yaml ingress.yaml service.yaml /* Discover. Collaborate. Deploy. */ 8
  • 9. Example variables and template usage • values.yaml image: repository: nginx tag: stable pullPolicy: IfNotPresent • deployment.yaml spec: containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{.Values.image.pullPolicy }} /* Discover. Collaborate. Deploy. */ 9
  • 10. Overriding chart values • Variables can be overridden at install time • As command line parameters: > helm install test --set image.tag=1.13 • And/or via a file: > helm install test --values overrides.yaml /* Discover. Collaborate. Deploy. */ 10
  • 11. Installing charts in a pipeline • Charts can be kept in a separate repository or stored alongside the application source code • Create a Docker image containing the Helm client • Deploy tiller independently and use > helm init --client-only • Kubernetes configuration automatically available in pod • To perform an install or upgrade, use: > helm upgrade --install ... • Use overrides to define image to deploy • The --wait option can be used to wait for pods to start /* Discover. Collaborate. Deploy. */ 11
  • 12. More advanced Helm • Ensure Helm chart is well formed: > helm lint --strict ... • Verify successful deployment > helm test ... • Executes and tests exit code for pods annotated with "helm.sh/hook": test-success or test-failure • Specify sub-charts in charts directory or requirements.yaml • E.g. to satisfy a database dependency • Hooks for lifecycle events e.g. pre/post install /* Discover. Collaborate. Deploy. */ 12
  • 13. Jenkins Helm chart customization • Chart values allow customization of almost everything! • Master.InstallPlugins – list of Jenkins plugins to install • Master/Agent.image – Docker image for master/slave • Master.InitScripts – list of Jenkins init scripts • Master.Jobs – Jenkins XML job configs • Agent.Cpu/Memory – resource constraints for agent • Master.CustomConfigMap – allows a parent chart to override the entire Jenkins config via override_config_map template • … /* Discover. Collaborate. Deploy. */ 13
  • 14. Things to watch out for • Poor Jenkins performance with network storage • Jenkins slave pods may get re-used if long-lived • Lack of access control for Helm • Enable SSL and deploy tiller per namespace with RBAC • Don’t use latest tag with images • If the config doesn’t change, Kubernetes won’t see it as an update • Use AlwaysPullImages admission controller • helm --wait only requires minimum pod count to be satisfied • For replicas=1 and maxUnavailable=1 that is zero! /* Discover. Collaborate. Deploy. */ 14
  • 15. Microservice Builder and Microclimate • Microservice Builder provides a dev-ops pipeline based on the community Jenkins chart and adding: • Opinionated Jenkins library • Docker images pre-built with plugins and adding Power support • GitHub org and oauth plugins • Microclimate provides a containerized development environment capable of running locally or on Kubernetes • Generates starter templates for Java (Spring or MicroProfile), Node.js and Swift containing application source, Dockerfile, Helm chart, … • Rapid iterative build/run/test in a containerized environment • Option to use a web based or local IDE /* Discover. Collaborate. Deploy. */ 15 https://microclimate-dev2ops.github.io
  • 16. Other IBM Helm Charts https://raw.githubusercontent.com/IBM/charts/master/repo/stable/ /* Discover. Collaborate. Deploy. */ 16
  • 17. Notices and disclaimers • © 2018 International Business Machines Corporation. No part of this document may be reproduced or transmitted in any form without written permission from IBM. • U.S. Government Users Restricted Rights — use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM. • Information in these presentations (including information relating to products that have not yet been announced by IBM) has been reviewed for accuracy as of the date of initial publication and could include unintentional technical or typographical errors. IBM shall have no responsibility to update this information. This document is distributed “as is” without any warranty, either express or implied. In no event, shall IBM be liable for any damage arising from the use of this information, including but not limited to, loss of data, business interruption, loss of profit or loss of opportunity. IBM products and services are warranted per the terms and conditions of the agreements under which they are provided. • IBM products are manufactured from new parts or new and used parts. In some cases, a product may not be new and may have been previously installed. Regardless, our warranty terms apply.” • Any statements regarding IBM's future direction, intent or product plans are subject to change or withdrawal without notice. • Performance data contained herein was generally obtained in a controlled, isolated environments. Customer examples are presented as illustrations of how those • customers have used IBM products and the results they may have achieved. Actual performance, cost, savings or other results in other operating environments may vary. • References in this document to IBM products, programs, or services does not imply that IBM intends to make such products, programs or services available in all countries in which IBM operates or does business. • Workshops, sessions and associated materials may have been prepared by independent session speakers, and do not necessarily reflect the views of IBM. All materials and discussions are provided for informational purposes only, and are neither intended to, nor shall constitute legal or other guidance or advice to any individual participant or their specific situation. • It is the customer’s responsibility to insure its own compliance with legal requirements and to obtain advice of competent legal counsel as to the identification and interpretation of any relevant laws and regulatory requirements that may affect the customer’s business and any actions the customer may need to take to comply with such laws. IBM does not provide legal advice or represent or warrant that its services or products will ensure that the customer follows any law. 17/* Discover. Collaborate. Deploy. */
  • 18. Notices and disclaimers continued • Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products about this publication and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products. IBM does not warrant the quality of any third-party products, or the ability of any such third-party products to interoperate with IBM’s products. IBM expressly disclaims all warranties, expressed or implied, including but not limited to, the implied warranties of merchantability and fitness for a purpose. • The provision of the information contained herein is not intended to, and does not, grant any right or license under any IBM patents, copyrights, trademarks or other intellectual property right. • IBM, the IBM logo, ibm.com and [names of other referenced IBM products and services used in the presentation] are trademarks of International Business Machines Corporation, registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at: www.ibm.com/legal/copytrade.shtml. 18/* Discover. Collaborate. Deploy. */
  • 19. Discover. Collaborate. Deploy. Continuous Delivery to Kubernetes with Jenkins and Helm David Currie | @dcurrie