Upgrade to Pro — share decks privately, control downloads, hide ads and more …

COSCUP - Dynamic Jenkins Agent on Kubernetes

Rico Chen
August 01, 2020
53

COSCUP - Dynamic Jenkins Agent on Kubernetes

Jenkins CICD more Cloud Native way.

Rico Chen

August 01, 2020
Tweet

Transcript

  1. Apology I shouldn't use a word like "slave" on the

    COSCUP agenda description. All lives matters. Don’t KILLALL -9 me.
  2. Who am I • I work for Bincentive • Volunteer

    with DevOps Taiwan • Frozen lover
  3. Agenda • What is Cloud Native • Why do we

    keep using Jenkins? • Introduce plugins • Case study • Live demo • Reference
  4. Cloud Native definition • Cloud Native technologies build and run

    scalable applications in modern, dynamic environments • Loosely coupled systems that are resilient, manageable, and observable
  5. Jenkins advantage • Open source with rich community support •

    More than 1000 plugins • Jenkins just like Transformers. Plugin can make Jenkins more Cloud Native way
  6. AWS ECS is base on Auto Scaling Group. 2018 was

    lacking storage management. What can I do??? Main
  7. Kubernetes plugin • Run dynamic agents in a Kubernetes •

    The agent is essentially a pod • Can config PV, resources limit, namespaces … and more
  8. How to config agent pod? • Start with UI •

    Jenkins configuration as code plugin • Declarative or Scripted pipeline (use source control)
  9. Issues • Too many microservices project • Prefer less plugins

    to reduce Jenkins main’s complex • Compiler job could impact develop environment. We need isolate Jenkins agent pod. • Compiler resources usage
  10. Pod Template docker dind jenkins- agent golang aws-cli docker dind

    jenkins- agent node.js aws-cli Pod Template nodeSelector tolerations serviceAccount envVars nodeSelector tolerations serviceAccount envVars
  11. Pod Template Pod Template golang docker dind jenkins- agent aws-cli

    node.js nodeSelector tolerations serviceAccount envVars Jenkins shared library
  12. agent pod jenkins main app pod app pod app pod

    Normal worker nodes group jenkins agent worker nodes group
  13. • Jenkins Kubernetes plugin • Jenkins Helm Charts • Jenkins

    and Kubernetes - Secret Agents in the Clouds • Dynamic Jenkins Agent from Kubernetes • Docker image for inbound Jenkins agents • CNTUG #28 - Kubernetes Resource and Eviction Management and more (speak slide) • cAdvisor - Analyzes containers resources usage
  14. • Jenkins Configuration as Code plugin • Jenkins Configuration as

    Code Job DSL example • Jenins Job DSL GitHub • Jenkins Job DSL API Document • Jenkins Job DSL playground
  15. • CNCF Cloud Native Definition v1.0 • Access-cluster-services • FluxCD,

    ArgoCD or Jenkins X GitOps • “docker stop” and “docker kill”?