Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Jenkins X - automated CI/CD solution for cloud native applications on Kubernetes

392 views

Published on

Let's have a look at CI/CD best practices to help developers on the cloud platform Kubernetes, which is becoming an industry standard, as we move to the era of cloud native application development, which is about to come.

Published in: Technology

Jenkins X - automated CI/CD solution for cloud native applications on Kubernetes

  1. 1. JENKINS XJENKINS X automated CI/CD solution for cloud native applications on Kubernetes JBUG Korea @tedwon https://jenkins-x.io/ 1
  2. 2. AT KOREA DEVELPER SEMINARAT KOREA DEVELPER SEMINAR Saturday, 17th November, 2018 개발자를위한공감세미나: 17번째이야기 2
  3. 3. JENKINS VS JENKIS XJENKINS VS JENKIS X 3
  4. 4. JENKINSJENKINS https://jenkins.io/ 4
  5. 5. JENKINS XJENKINS X https://jenkins-x.io/ 5
  6. 6. JENKINS X - WHAT WE DOJENKINS X - WHAT WE DO Code change ⇒Pull Request ⇒Review ⇒Merge ⇒Staging ⇒Production 6
  7. 7. WHAT ARE THE NEW CHANGES?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 7
  8. 8. WHAT ARE THE NEW CHALLENGES?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? 8
  9. 9. STARTED BY JAMES STRACHANSTARTED BY JAMES STRACHAN 9
  10. 10. 10
  11. 11. STARTED BY JAMES STRACHANSTARTED BY JAMES STRACHAN Released at March of this year, 2018 Founder of Groovy, Apache ActiveMQ/Camel https://twitter.com/jstrachan/status/9757967221474 https://goo.gl/ceLcmq https://github.com/jenkins-x/jx/graphs/contributors https://www.linkedin.com/in/jstrachan/ https://medium.com/@jstrachan 11
  12. 12. STARTED BY JAMES STRACHANSTARTED BY JAMES STRACHAN Developed similar project in Red Hat until last year, 2017 gofabric8 https://goo.gl/4re3G7 https://github.com/fabric8io/gofabric8 http://fabric8.io/ 12
  13. 13. FEATURES OF JENKINS XFEATURES OF JENKINS X Automated CI and CD Environment Promotion via GitOps Pull Request Preview Environments Feedback on Issues and Pull Requests 13
  14. 14. SUPPORTED CLOUD PROVIDERSSUPPORTED 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 https://jenkins-x.io/commands/jx_create_cluster/ 14
  15. 15. HOW DOES JENKINS X HELP?HOW DOES JENKINS X HELP? Jenkins CI/CD pipeline solution Nexus Artifact repository Package manager for Kubernetes https://helm.sh 15
  16. 16. HOW DOES JENKINS X HELP?HOW DOES JENKINS X HELP? Chartmuseum Helm Chart repository Monocular Web UI for helm charts Build packs to bootstrap applications Skaffold Tool for building docker images on kubernetes https://draft.sh 16
  17. 17. HELM CHARTHELM CHART Helm Chart is a packaging format. A chart is a collection of les 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 17
  18. 18. 18
  19. 19. 19
  20. 20. 20
  21. 21. 21
  22. 22. 22
  23. 23. 23
  24. 24. HOW DOES JENKINS X HELP?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 24
  25. 25. IMPORT MAVEN PROJECTIMPORT MAVEN PROJECT 25
  26. 26. 26
  27. 27. 27
  28. 28. 28
  29. 29. 29
  30. 30. 30
  31. 31. ENVIRONMENT PROMOTION VIA GITOPSENVIRONMENT PROMOTION VIA GITOPS Development Environment Staging Environment Production Environment jx env ? Pick environment: [Use arrows to move, type to filter] > dev production staging 31
  32. 32. 32
  33. 33. DEMO & ENVIRONMENT GIT REPOSITORYDEMO & ENVIRONMENT GIT REPOSITORY 33
  34. 34. JX GET APPLICATIONSJX GET APPLICATIONS 34 . 1
  35. 35. 34 . 2
  36. 36. JX GET PREVIEWSJX GET PREVIEWS 35 . 1
  37. 37. 35 . 2
  38. 38. 36
  39. 39. 37 . 1
  40. 40. 37 . 2
  41. 41. HOW DO WE SETUP KUBERNETES +HOW DO WE SETUP KUBERNETES + JENKINS X?JENKINS X? Install the jx command line tool http://jenkins-x.io/getting-started/install/ macOs: brew tap jenkins-x/jx brew install jx linux: curl -L https://github.com/jenkins-x/jx/releases/download/v1.3.46 sudo mv jx /usr/local/bin 38
  42. 42. HOW DO WE SETUP KUBERNETES +HOW DO WE SETUP KUBERNETES + JENKINS X?JENKINS X? If using the public cloud use: jx create cluster aws jx create cluster gke jx create cluster aks 39
  43. 43. HOW DO WE SETUP KUBERNETES +HOW DO WE SETUP KUBERNETES + JENKINS X?JENKINS X? If you have a cluster already - ensure RBAC enabled then: jx install --provider=openshift 40
  44. 44. CREATE CLUSTER GKECREATE CLUSTER GKE Google Container Engine $300 free credit https://console.cloud.google.com/freetrial 41
  45. 45. 42
  46. 46. VSCODE JENKINS X EXTENSIONVSCODE JENKINS X EXTENSION 43
  47. 47. 44
  48. 48. DEMODEMO Creating GKE Kubernetes cluster with Jenkins X Creating Spring Boot app Creating code change Promoting to Production 45
  49. 49. DEMO - DEPLOY SPRING BOOT APPDEMO - DEPLOY SPRING BOOT APP jx create cluster gke 46
  50. 50. DEMO - DEPLOY SPRING BOOT APPDEMO - DEPLOY SPRING BOOT APP Create Cluster GKE Record: https://asciinema.org/a/210859 47
  51. 51. DEMO - DEPLOY SPRING BOOT APPDEMO - DEPLOY SPRING BOOT APP jx create spring -d web -d actuator 48
  52. 52. DEMO - DEPLOY SPRING BOOT APPDEMO - DEPLOY SPRING BOOT APP Record: 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 rst pipeline https://asciinema.org/a/210872 49
  53. 53. DEMO - JENKINS X ON PULL REQUESTDEMO - 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 50
  54. 54. DEMO - JENKINS X ON PULL REQUESTDEMO - JENKINS X ON PULL REQUEST Creates preview docker image + helm chart Creates a Preview Environment and comments on the PR with the link https://github.com/tedwon/demo1030/pull/2 51
  55. 55. DEMO - JENKINS X PROMOTION VIA GITOPSDEMO - JENKINS X PROMOTION VIA GITOPS jx promote --version 0.0.2 --env production 52
  56. 56. JENKINS X SLACKJENKINS X SLACK #jenkins-x-user kubernetes.slack.com 53
  57. 57. 54
  58. 58. JENKINS X ROADMAPJENKINS X ROADMAP https://jenkins-x.io/contribute/roadmap/ 55
  59. 59. TRY IT OUT!TRY IT OUT! JBUG Jenkins X Hands-on https://jenkins-x.io/getting-started/ https://goo.gl/oBbHxA https://github.com/tedwon/jenkins-x-slides-tedwon 56
  60. 60. SPECIAL THANKS TOSPECIAL THANKS TO Jungho Cha < >jcha@redhat.com 57
  61. 61. THANK YOUTHANK YOU facebook.com/groups/jbossusergroup/ 58
  62. 62. SOURCES & REFERENCESSOURCES & REFERENCES https://docs.google.com/presentation/d/1hwt2lFh3cCeF https://developer.okta.com/blog/2018/07/11/ci-cd-sprin https://jenkins.io/blog/2018/03/19/introducing-jenkins https://www.youtube.com/watch?v=uHe7R_iZSLU https://jenkins.io/blog/2018/07/19/jenkins-x-accelerate 59
  63. 63. SOURCES & REFERENCESSOURCES & REFERENCES https://dzone.com/articles/jenkins-x-the-good-bad- and-ugly https://blog.octo.com/en/jenkinsx-new-kubernetes- dream-part-1/ https://www.dropbox.com/s/2l3yudybl8dx4j7/2.pdf? dl=0 http://www.itworld.co.kr/news/107527 https://www.redhat.com/en/blog/integrating- ansible-jenkins-cicd-process 60
  64. 64. SOURCES & REFERENCESSOURCES & REFERENCES JBUG Jenkins X Hands-on http://woowabros.github.io/experience/2018/06/26/bro cicd.html https://dzone.com/articles/what-is-gitops-really https://jenkins-x.io/developing/git/#using-a-different-gi provider-for-environments https://goo.gl/oBbHxA https://github.com/tedwon/jenkins-x-slides-tedwon 61

×