
This video provides an overview of the entire course.
A software build, test, and delivery pipeline are complicated and require management of builds, environments, and configuration. Jenkins X can automate software build and delivery.
• Describe Jenkins X
• Use Jenkins X for continuous integration and delivery
• Demonstrate an automated software pipeline with Jenkins X
To control Jenkins X, we need the jx command line tool.
• Find the Jenkins X command line tool for download
• Download jx and place it on the path
• Test the jx download to make sure it has been installed correctly
Jenkins X runs on Kubernetes and we need a Kubernetes cluster to install it. Fortunately, we can create one automatically using the jx tool.
• Explore the Google Cloud Platform and Google Kubernetes Engine
• Use "jx create cluster" to create a Kubernetes cluster
• View our Kubernetes cluster in the dashboard
Jenkins X will interface with our Git repositories to detect changes and provide GitOps for its own configuration. We need a token to allow this automation.
• Understand the purpose of GitOps with Jenkins X
• Configure GitHub to provide a personal access token
• Save the token for use in configuring Jenkins X
Jenkins X has many different components. The "jx boot" command will use GitOps to automatically install and maintain those components.
• Discuss idempotence in the jx boot approach
• Configure our Jenkins X cluster
• Use "jx boot" to perform the install and configuration of Jenkins X on Kubernetes
Our new Jenkins X installation is ready to build and deploy the software, but we need to know how to add a repository to Jenkins X and get it building.
• See how the jx command knows how to communicate with our Jenkins X installation
• Create a sample application in Jenkins X using a quickstart
• See the deployed application and its repository
If we have existing code and we want to build it with Jenkins X, we need to know how to import it and get it building.
• Import an existing application into Jenkins X
• Observe the application running and look at its repository
• Explore the Docker and Helm configuration Jenkins X created automatically
To understand how Jenkins X adds applications, we need to look at how it uses GitOps to manage configuration.
• Explore how Jenkins X uses GitOps to control configuration changes
• Review the configuration repository for our Jenkins X installation
• Review the Git repository changes caused by adding applications to Jenkins X
Jenkins X builds applications using Prow, a Kubernetes native build server. We need to understand how to get to Prow to see build status.
• Understand how Kubernetes services and ingresses expose Jenkins X components outside the Kubernetes cluster
• Visit the Prow status page to see the recent builds
• Describe the difference between application builds and deployment builds
When something goes wrong building or assembling our application in Jenkins X, we need to know how to review the logs to find the error message so we can fix it.
• Look at the list of Jenkins X applications
• Look at recent activities Jenkins X has performed to build and deploy applications
• Review the logs for application and deployment builds so we can understand what Jenkins X is doing
Once Jenkins X has deployed our application, we need to know how to find it in Kubernetes so we can look at its logs.
• Understand the kubectl command
• View the Kubernetes namespaces where Jenkins X is deploying our applications
• Find an application pod and ask Kubernetes to display its logs
Jenkins X knows how to build and deploy many different types of applications because of the build packs that define the necessary build steps.
• Understand how Jenkins X uses build packs to define build steps
• See a Jenkins build pack in action
• Find the GitHub repository where the default build packs are stored
To use the correct build pack with our application, we can let Jenkins X autodetect it or specify it ourselves.
• Allow Jenkins X to detect a build pack for our application
• List the available Jenkins X build packs
• Specify which build pack to use when we import an application
Before we can customize build steps in Jenkins X, we need to understand how the build pack is organized using YAML.
• Learn about the YAML file format
• Understand the structure of a Jenkins X pipeline YAML file
• See how the pipeline YAML is used to define build steps within stages
Before we can customize build steps in Jenkins X, we need to understand how the build pack assembles build steps from multiple reusable files.
• Provide examples of how gextendsh is used to inherit build steps
• View the JavaScript Kubernetes pipeline file to see how it inherits behavior
• Track through multiple levels of inheritance to find all the build steps
To take complete control over our Jenkins X build steps, we need to know how to override the default build pack.
• Add a custom build step to the end of the build stage
• Replace the steps in the build stage with our own definition
• Review the activity list and build logs to see the effect of overriding build steps
We want to continuously deliver our application so we can test the latest version and deploy changes rapidly, but we also want control over how we deploy to production to ensure our application is stable.
• Understand how Jenkins X uses environments and promotion to control application delivery
• Import an application and see it automatically deploy to staging
• Promote the application to production using jx promote
We want Jenkins X to fit the typical development workflow of making changes in feature branches and using pull requests to control updates to the master branch.
• Create a feature branch and a pull request for an application change
• View the automatically created preview environment to test our change
• Approve the pull request and see the change automatically deploy to staging
As we develop our application, we need a way to make changes and rapidly see the results, even for applications deployed to Kubernetes.
• Understand the purpose of a Jenkins X DevPod
• Import an application and create a DevPod for it
• See how an application change inside a DevPod is immediately reflected
When developing inside DevPods, we need a way to continuously see the effect of changes with minimal work, to save our changes when complete.
• Import an application and create a DevPod that includes a web-based editor
• Start the application with a tool to watch for changes
• Observe the result when we make changes in the web-based editor
To understand and control how our application runs in Kubernetes, we need to know how it is assembled into a Docker image.
• View the Dockerfile that Jenkins X creates for us to assemble our application into a Docker image
• Show how Jenkins X uses Skaffold to build our Docker image and push it to a registry
• See an example Docker image in our container registry in Google Cloud
Jenkins X uses Kubernetes for its own components, to run builds, and to deploy applications. To understand how our applications run we need to understand Kubernetes.
• Understand what Kubernetes is and how it manages Docker containers
• View a typical application architecture on Kubernetes
• Deploy an application to Kubernetes and see it running
To manage our application on Kubernetes, we use a Deployment that creates one or more pods. Understanding deployments will help us configure our application correctly.
• Inspect a deployment configuration file and create the deployment
• Scale the deployment to cause it to create more pod instances
• Delete a pod and watch the deployment create a new one
Kubernetes pods come and go as we maintain our application. To access our application, we need a Kubernetes service to provide a well-known name.
• Inspect the service configuration file and create a service
• See how the service uses a selector to identify pods as destinations for traffic
• Delete a pod and see the service adjust to the replacement automatically
Until now, our Kubernetes resources were only visible inside the container. To expose applications to the Internet, we need a Kubernetes Ingress resource.
• Inspect an ingress and understand why we use it to expose services
• Create an ingress and see its configuration
• Understand how Jenkins X creates and configures our ingress automatically for our applications
With many different resource types and many configuration files, it becomes challenging to deploy and maintain applications in Kubernetes. Helm simplifies this.
• Understand how Helm provides templating for Kubernetes files and assembles a chart for application deployment
• Install an application using a Helm chart repository
• Inspect how Jenkins X uses a Helm chart to deploy our applications to Kubernetes
If our Kubernetes-based application does not start as expected, we need to know what tools to use to debug it and get it working.
• Create deployments with errors so we can see and fix typical error messages
• View logs from a Kubernetes pod using kubectl
• Open a shell inside a Kubernetes pod for debugging
Jenkins X can manage the installation of Helm charts via GitOps, if we install the Helm chart as a Jenkins X app.
• Understand the difference between our own applications and Jenkins X app
• Install MongoDB as a Jenkins X app
• Approve the Git repository change and observe MongoDB running
Jenkins X provides additional optional components known as addons that let us quickly add functionality to our Kubernetes cluster.
• Understand the difference between Jenkins X apps and Jenkins X addons
• Install Anchore as a Jenkins X addon
• Observe how Jenkins X configures the cluster, so the Anchore service is visible
Prometheus is a popular monitoring service that works well in Kubernetes clusters. Using Prometheus, we can get access to data on how our cluster is running.
• Install Prometheus as a Jenkins X addon
• Access Prometheus from a browser
• Use Prometheus to see cluster load data
Grafana is a visualization tool with support for many data sources, including Prometheus, and supporting many dashboards that are easy to install.
• Install Grafana as a Jenkins X addon
• Configure Prometheus as a data source in Grafana
• Add Grafana dashboards to view Prometheus and Kubernetes metrics
Jenkins X is an exciting and fast way to build applications on Kubernetes. Jenkins X handles the job of configuring Kubernetes to build, test, and deploy your applications, so you can focus on fast delivery and make your applications great!
Kubernetes is powerful but complicated; using it not only to run your application but also to build and test it requires a lot of configuration. Jenkins X provides automation for Kubernetes so you can use it to its full potential without spending all of your time configuring and debugging.
This course adopts a step-by-step approach to show you how to use Jenkins X, with plenty of hands-on examples that you can use for your own applications. You'll start with a simple example application deployed to Kubernetes using Jenkins X, then build up to awesome features such as preview environments, promotion, and monitoring. With this course, you can learn Jenkins X fast, and immediately apply what you've learned.
About the Author
Alan Hohn is a Lockheed Martin Fellow with experience teaching DevOps, cloud, and Agile. He loves to combine examples and explanation to make technology clear. He has written multiple guides to Kubernetes and has taught numerous classes on using Kubernetes for containerized microservice architectures. He is the author of several successful video courses with Packt Publishing.