Jenkins Administrator's Guide
eBook - ePub

Jenkins Administrator's Guide

  1. 436 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

About this book

Build and manage a production Jenkins instance, complete with CI/CD pipelines using GitHub and Docker Hub, Jenkins Configuration as Code, Shared Libraries, Script Security, and optimization guidesKey Features• Set up production-grade Jenkins and CI/CD pipelines with GitHub and Docker Hub integrations• Manage, protect, and upgrade a production Jenkins instance regardless of its size and the number of users• Scale a Jenkins instance using advanced optimization tips, tricks, and best practicesBook DescriptionJenkins is a renowned name among build and release CI/CD DevOps engineers because of its usefulness in automating builds, releases, and even operations. Despite its capabilities and popularity, it's not easy to scale Jenkins in a production environment. Jenkins Administrator's Guide will not only teach you how to set up a production-grade Jenkins instance from scratch, but also cover management and scaling strategies.This book will guide you through the steps for setting up a Jenkins instance on AWS and inside a corporate firewall, while discussing design choices and configuration options, such as TLS termination points and security policies. You'll create CI/CD pipelines that are triggered through GitHub pull request events, and also understand the various Jenkinsfile syntax types to help you develop a build and release process unique to your requirements. For readers who are new to Amazon Web Services, the book has a dedicated chapter on AWS with screenshots. You'll also get to grips with Jenkins Configuration as Code, disaster recovery, upgrading plans, removing bottlenecks, and more to help you manage and scale your Jenkins instance.By the end of this book, you'll not only have a production-grade Jenkins instance with CI/CD pipelines in place, but also knowledge of best practices by industry experts.What you will learn• Set up a production-grade Jenkins instance on AWS and on-premises• Create continuous integration and continuous delivery (CI/CD) pipelines triggered by GitHub pull request events• Use Jenkins Configuration as Code to codify a Jenkins setup• Backup and restore configurations and plan for disaster recovery• Plan, communicate, execute, and roll back upgrade scenarios• Identify and remove common bottlenecks in scaling Jenkins• Use Shared Libraries to develop helper functions and create new DSLsWho this book is forThis book is for both new Jenkins administrators and advanced users who want to optimize and scale Jenkins. Jenkins beginners can follow the step-by-step directions, while advanced readers can join in-depth discussions on Script Security, removing bottlenecks, and other interesting topics. Build and release CI/CD DevOps engineers of all levels will also find new and useful information to help them run a production-grade Jenkins instance following industry best practices.

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Jenkins Administrator's Guide by Calvin Sangbin Park,Lalit Adithya,Samuel Gleske,Tracy Miranda in PDF and/or ePUB format, as well as other popular books in Computer Science & Business Intelligence. We have over one million books available in our catalogue for you to explore.

Information

1

Jenkins Infrastructure with TLS/SSL and Reverse Proxy

In this chapter, we will learn about the foundational components of Jenkins: the controller, agents, cloud, domain name, TLS/SSL certificates, and reverse proxy. First, we will learn where each component fits into the architecture, and then prepare the VMs and TLS/SSL certificates. Finally, we will learn the importance of choosing the right storage medium for the Jenkins controller and discuss the pros and cons of some of the popular storage options. By the end of this chapter, we will understand the Jenkins architecture and have the necessary components ready so that we can put them together in the next chapter.
In this chapter, we're going to cover the following main topics:
  • Why Jenkins?
  • Searching for answers online with Jenkins keywords
  • Understanding the Jenkins architecture
  • AWS: FAQs, routing rules, EC2 instances, and EIPs
  • Installing Docker on our VMs
  • Acquiring domain names and TLS/SSL certificates
  • Storage concerns (very important!)

Technical requirements

You need a domain name (for example, jenkins.example.com) for your Jenkins instance and one or both of the following:
  • An AWS account with permission to create three EC2 instances, create an Application ELB, create certificates via AWS Certificate Manager, create AWS access keys via IAM, and modify domain records in Route 53.
  • Three VMs running Ubuntu 20.04, access to domain records for your domain, and optionally a company public key infrastructure (PKI).
The files for this chapter are available in this book’s GitHub repository at https://github.com/PacktPublishing/Practical-Jenkins-2.x/blob/main/ch1.

Why Jenkins?

A Continuous Integration (CI) build runs when a pull request (PR) is created or updated so that a developer can build and test the proposed change before merging the change. In the 2020s, a CI system is a normal fact of life for any software development, and it is difficult to imagine developing a software product without it.
But finding a good CI solution remains difficult, particularly when the validation process is more complex than a simple use case of building a Go binary and creating a Docker image with it. For example, if we need to build a phone firmware and need to flash a physical phone in one of the three test phones as a part of the validation, we would need a CI system that can handle physical connections to the hardware, as well as manage resource locks to make sure that the validation does not disrupt other validations that are already in progress.
The use cases are even more complex during the Continuous Delivery or Continuous Deployment (CD) process, where the end product of a build is either stored in an archive (such as Docker registry or Artifactory) or deployed to a production system. The CD builds' more frequent interactions with external systems require credential management and environment preparation for a deployment. For example, it's not uncommon for a production system to be in an isolated network inaccessible from the corporate network, and a jumpbox session must be prepared before an update can be deployed. It's also common that the deployments are handled in a different set of pipelines that are not tied to the code changes in the Git repository, which means that we would need a CD solution made up of free-standing pipelines that are detached from any PR activities.
Jenkins, known for its supreme flexibility, can handle such complex use cases easily. Managing a physical hardware connection, handling resource locks, managing credentials, and handling session data across multiple stages is all built into Jenkins or can be made available easily through one of 1,500+ plugins1.
In addition to the rich feature set, Jenkins supports real programming languages such as Java and Groovy to specify the build steps. This allows us to write real code to express our build logic using variables, conditionals, loops, exceptions, and sometimes even classes and methods, rather than being bound by a domain-specific language (DSL) that is often limiting.
For those of u...

Table of contents

  1. Install, manage, and scale a CI/CD build and release system to accelerate your product life cycle
  2. Foreword
  3. Contributors
  4. Preface
  5. 1 Jenkins Infrastructure with TLS/SSL and Reverse Proxy
  6. 2 Jenkins with Docker on HTTPS on AWS and inside a Corporate Firewall
  7. 3 GitOps-Driven CI Pipeline with GitHub
  8. 4 GitOps-Driven CD Pipeline with Docker Hub and More Jenkinsfile Features
  9. 5 Headfirst AWS for Jenkins
  10. 6 Jenkins Configuration as Code (JCasC)
  11. 7 Backup and Restore and Disaster Recovery
  12. 8 Upgrading the Jenkins Controller, Agents, and Plugins
  13. 9 Reducing Bottlenecks
  14. 10 Shared Libraries
  15. 11 Script Security
  16. Index
  17. Why subscribe?
  18. Other Books You May Enjoy