Skip to content

Latest commit

 

History

History
executable file
·
603 lines (364 loc) · 12.4 KB

slides.adoc

File metadata and controls

executable file
·
603 lines (364 loc) · 12.4 KB

Jenkins X

automated CI/CD solution for cloud native applications on Kubernetes

JBUG Korea

@tedwon

At Korean Developers Conference

Jenkins vs Jenkis X

Jenkins X - What we do

Code change ⇒ Pull Request ⇒ Review

⇒ Merge ⇒ Staging ⇒ Production

What are the new changes?

  • Move from on premise to cloud

  • Move from BareMetal/VMs to containers

  • Kubernetes has become the defacto standard

  • Move from monoliths to microservices

  • Become high performing teams via CI/CD

What are the new challenges?

  • How do I migrate my applications to the cloud?

  • How do dev teams work with Kubernetes?

  • What do I need to start developing, building and deploying?

  • How can I see my applications log?

Started by James Strachan

Started by James Strachan

canvas

Started by James Strachan

Features of Jenkins X

  • Automated CI and CD

  • Environment Promotion via GitOps

  • Pull Request Preview Environments

  • Feedback on Issues and Pull Requests

Note
  • Automated CI and CD

    • Rather than having to have deep knowledge of the internals of Jenkins Pipeline, Jenkins X will default awesome pipelines for your projects that implements fully CI and CD

  • Environment Promotion via GitOps

    • Each team gets a set of Environments. Jenkins X then automates the management of the Environments and the Promotion of new versions of Applications between Environments via GitOps

  • Pull Request Preview Environments

    • Jenkins X automatically spins up Preview Environments for your Pull Requests so you can get fast feedback before changes are merged to master

  • Feedback on Issues and Pull Requests

    • Jenkins X automatically comments on your Commits, Issues and Pull Requests with feedback as code is ready to be previewed, is promoted to environments or if Pull Requests are generated automatically to upgrade versions.

Supported Cloud Providers

  • Google Container Engine

  • Red Hat OpenShift

  • Amazon Elastic Container Service

  • Azure Container Service

  • IBM Cloud Kubernetes Service

  • Oracle Cloud Container Engine

  • minikube, minishift

Note

How does Jenkins X help?

  • Jenkins

    • CI/CD pipeline solution

  • Nexus

    • Artifact repository

  • https://helm.sh

    • Package manager for Kubernetes

How does Jenkins X help?

  • Chartmuseum

    • Helm Chart repository

  • Monocular

    • Web UI for helm charts

  • https://draft.sh

    • Build packs to bootstrap applications

  • Skaffold

    • Tool for building docker images on kubernetes

Note
  • Jenkins

    • CI/CD pipeline solution

  • Nexus

    • Artifact repository

  • https://helm.sh

    • Package manager for Kubernetes

  • Chartmuseum

    • Helm Chart repository

  • Monocular

    • Web UI for helm charts

  • https://draft.sh

  • Skaffold

    • Tool for building docker images on kubernetes clusters and then deploying/upgrading them via kubectl or helm

Helm Chart

  • Helm Chart is a packaging format.

  • A chart is a collection of files that describe a related set of Kubernetes resources.

~/demo/charts/demo(master) » tree .
.
├── Chart.yaml
├── Makefile
├── README.md
├── charts
├── templates
│   ├── NOTES.txt
│   ├── _helpers.tpl
│   ├── deployment.yaml
│   └── service.yaml
└── values.yaml

Kubernetes Console

canvas

Jenkins UI

canvas

Jenkins Blue Ocean UI

canvas

Jenkins Blue Ocean UI

canvas

Nexus UI

canvas

Monocular UI

canvas

How does Jenkins X help?

jx open


jenkins                   http://jenkins.jx.x.x.x.x.nip.io

jenkins-x-chartmuseum     http://chartmuseum.jx.x.x.x.x.nip.io

jenkins-x-docker-registry http://docker-registry.jx.x.x.x.x.nip.

jenkins-x-monocular-ui    http://monocular.jx.x.x.x.x.nip.io

nexus                     http://nexus.jx.x.x.x.x.nip.io

Import Maven Project

Import Maven Project

canvas

Dockerfile

canvas

Jenkinsfile

canvas

Draft Build Packs

canvas

Draft Build Packs

canvas

Environment Promotion via GitOps

jx env

? Pick environment:  [Use arrows to move, type to filter]
> dev
  production
  staging
  • Development Environment

  • Staging Environment

  • Production Environment

jx get environments

canvas

Demo & Environment Git Repository

demo env git repository

jx get applications

jx get apps

jx get applications

canvas

jx get previews

jx get previews

jx get previews

canvas

Environments in Kubernetes

canvas

jx Overview

canvas

Jenkins X Architecture

canvas

How do we setup Kubernetes + Jenkins X?

macOs:
brew tap jenkins-x/jx
brew install jx

linux:
curl -L https://github.com/jenkins-x/jx/releases/download/v1.3.467/jx-darwin-amd64.tar.gz | tar xzv
sudo mv jx /usr/local/bin

How do we setup Kubernetes + Jenkins X?

  • If using the public cloud use:

jx create cluster aws

jx create cluster gke

jx create cluster aks

How do we setup Kubernetes + Jenkins X?

  • If you have a cluster already - ensure RBAC enabled then:

jx install --provider=openshift

Create Cluster GKE

Google Container Engine $300 free credit

Create Cluster GKE

canvas

VSCode Jenkins X Extension

VSCode Jenkins X Extension

canvas

Demo

  • Creating GKE Kubernetes cluster with Jenkins X

  • Creating Spring Boot app

  • Creating code change

  • Promoting to Production

Demo - Deploy Spring Boot app

jx create cluster gke

Demo - Deploy Spring Boot app

Demo - Deploy Spring Boot app

jx create spring -d web -d actuator

Demo - Deploy Spring Boot app

  • Record: https://asciinema.org/a/210872

  • Automatically set up CI/CD pipelines for new + imported projects

  • Setups up git repository

  • Adds webhooks on git to trigger Jenkins pipelines on PR / master

  • Triggers the first pipeline

Demo - Jenkins X on Pull Request

jx create issue -t 'add a homepage'

git checkout -b wip

vi src/main/resources/static/index.html

git add src

git commit -a -m 'add a homepage fixes #1'

git push origin wip

jx create pullrequest -t "add a homepage fixes #1"

jx get preview

Demo - Jenkins X on Pull Request

  • Creates preview docker image + helm chart

  • Creates a Preview Environment and comments on the PR with the link

pr comment

Demo - Jenkins X promotion via GitOps

jx promote --version 0.0.2 --env production

Jenkins X Slack

#jenkins-x-user

Jenkins X Slack

canvas

Special Thanks to

Jungho Cha <jcha@redhat.com>