boxes. ◦ Using labels to select different features (platform, machine size, etc) ◦ Manually provisioned. • Still useful: ◦ Executors with special requirements (licenses, constrained resources, ...) • As our CI / CD requirements grow, we need more elasticity. Jenkins Master Agent 1 Agent 2 Agent 3 Agent n
agents on demand. • Jenkins provide “clouds”: ◦ Configure some “template agents”. ◦ Assign labels. ◦ Agents created and returned on demand. • Some examples: ◦ Amazon EC2 Plugin ◦ Azure VM Agents Plugin • Could be used for VMs and containers, though for the latter could be a bit different: one-shot executors. Jenkins Master Provisioned Agent Agent no longer needed Configured Cloud Request new agent when needed. Provision new agent Destroy agent
created by Carlos Sánchez • Dynamic Jenkins Agents, running as Pods. • Multi-container support: ◦ One container in the pod runs the Jenkins Agent, the others are custom. ◦ Pipeline support for both agent pod definition and execution. Jenkins Master Kubernetes cluster Agent Pod JNLP Cont. Other Cont.
not only provided on demand, but can also be defined on demand. ◦ And as part of the build code, providing great flexibility and decoupling from administrators and developers ◦ Capability to configure really complex build scenarios. • Access to Kubernetes capabilities and ecosystem. Agent Pod JNLP Agent Build & Test Chrome Selenium Hub Build & Test Firefox Chrome Browser Image Firefox Browser Image
Jenkins Instance • The “PowerPoint mode”: ◦ Everything on disk ◦ Main parts in memory • Pro: very simple deployment. ◦ Helped with Jenkins adoption. • Con: not suitable for advanced deployments ◦ High availability ◦ Horizontal scalability
• Plugin model: ◦ Enabler for Jenkins success. • Original focus was making configuration through UI simple • Pros: ◦ Very extensible UI. ◦ Great plugin ecosystem • Cons: ◦ Very difficult to evolve the UI. ◦ Does not fulfill today’s expectations on service configuration. Plugin 1 Plugin 2 Plugin 3 Plugin 4 Plugin n
not a Cloud-Native architecture. • Still can get advantages from running in Kubernetes: ◦ Manageability. ◦ Use k8s primitives instead of roll-your-own solutions for things like high-availability. Persistent Volume Claim Deployment (StatefulSet is another option) Master Pod (only 1 replica!) Service Ingress
for declarative, “gitops” workflow. ◦ Heavily inspired by an existing proprietary tool. ◦ JSON, YAML, jsonnet input. ◦ Whole config in one invocation, not separate fragments. ◦ Optimised for automated pipelines, rather than interactive use. ◦ Simple client-side tool: ▪ Obeys RBAC. No need for an “admin” uber-job in-cluster. ▪ Can be used on multiple clusters. • Helm Charts ◦ The “apt-get” of Kubernetes ◦ Bitnami Chart for Jenkins
• An opinionated way to develop cloud-native applications: ◦ Microservice-based. ◦ Deployed in k8s, as charts • Based on Jenkins, but Jenkins is barely visible: ◦ The system creates the pipelines. • Focus on GitOps
Preview 3 Preview 2 Preview n Staging PRs to App PR Merged Environment Promotion • The “unit of work” is the Application. • Each Application has multiple “environments”: ◦ A place where the app is deployed. ◦ There’s a git repo for each, containing the Helm charts, configuration,... ◦ Each environment maps to a k8s namespace.
done via “GitOps”. • Every change turns into a PR in an environment repo. ◦ Changes chart content, configuration, etc. • When the change is merged the (automatically generated) pipeline deploys the (version of the) app in the cluster. • “Promotions” are PR to other environments