Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Create a Kubernetes cluster
/ 20
Configure and Install Jenkins
/ 20
Create the production and canary deployments
/ 30
Build for the 'new-feature' branch
/ 10
Deploying a canary release
/ 10
Deploying to production
/ 10
Create a Kubernetes cluster
/ 20
Configure and Install Jenkins
/ 20
Create the production and canary deployments
/ 30
Build for the 'new-feature' branch
/ 10
Deploying a canary release
/ 10
Deploying to production
/ 10
In this lab, you learn how to set up a continuous delivery pipeline with Jenkins on Kubernetes Engine. Jenkins is the go-to automation server used by developers who frequently integrate their code in a shared repository. The solution you build in this lab is similar to the following diagram:
In the Cloud Architecture Center, see Jenkins on Kubernetes Engine to learn more about running Jenkins on Kubernetes.
In this lab, you learn how to perform the following tasks:
This is an advanced-level lab. Before taking it, you should be comfortable with at least the basics of shell programming, Kubernetes, and Jenkins. Here are some labs that can get you up to speed:
When you are prepared, continue to the next section to learn more about Kubernetes, Jenkins, and continuous delivery.
Kubernetes Engine is Google Cloud's hosted version of Kubernetes—a powerful cluster manager and orchestration system for containers. Kubernetes is an open source project that can run on many different environments—from laptops to high-availability multi-node clusters; from virtual machines to bare metal. As mentioned before, Kubernetes apps run in containers—these are lightweight applications bundled with all the necessary dependencies and libraries to run them. This underlying structure makes Kubernetes applications highly available, secure, and quick to deploy—an ideal framework for cloud developers.
Jenkins is an open-source automation server that lets you flexibly orchestrate your build, test, and deployment pipelines. Jenkins allows developers to iterate quickly on projects without worrying about overhead issues that can stem from continuous delivery.
When you need to set up a continuous delivery (CD) pipeline, deploying Jenkins on Kubernetes Engine provides important benefits over a standard VM-based deployment.
When your build process uses containers, one virtual host can run jobs on multiple operating systems. Kubernetes Engine provides ephemeral build executors—the cluster uses these executors only when builds are actively running, which leaves resources for other cluster tasks such as batch processing jobs. Another benefit of ephemeral build executors is speed—they launch in a matter of seconds.
Kubernetes Engine also comes pre-equipped with Google's global load balancer, which you can use to automate web traffic routing to your instances. The load balancer handles SSL termination and uses a global IP address that's configured with Google's backbone network—coupled with your web front, this load balancer always sets your users on the fastest possible path to an application instance.
Now that you've learned a little bit about Kubernetes, Jenkins, and how the two interact in a CD pipeline, it's time to go build one.
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.
This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
Click the Start Lab button. If you need to pay for the lab, a dialog opens for you to select your payment method. On the right is the Lab setup and access panel with the following:
Note that the lab timer is located near the top of the page, showing the remaining time.
Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).
The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Arrange the tabs in separate windows, side-by-side.
If necessary, copy the Username below and paste it into the Sign in dialog.
You can also find the Username in the Lab setup and access panel.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
You can also find the Password in the Lab setup and access panel.
Click Next.
Click through the subsequent pages:
After a few moments, the Google Cloud console opens in this tab.
Cloud Shell is a virtual machine that is loaded with development tools. It offers a persistent 5GB home directory and runs on the Google Cloud. Cloud Shell provides command-line access to your Google Cloud resources.
Click Activate Cloud Shell at the top of the Google Cloud console.
Click through the following windows:
When you are connected, you are already authenticated, and the project is set to your Project_ID,
gcloud is the command-line tool for Google Cloud. It comes pre-installed on Cloud Shell and supports tab-completion.
Output:
Output:
gcloud, in Google Cloud, refer to the gcloud CLI overview guide.
In this task, you download the source code for this lab, create a Kubernetes cluster, and enable Jenkins to access Google Cloud services and Google Artifact Registry.
This step can take several minutes to finish. The extra scopes enable Jenkins to access Google Cloud services and Google Artifact Registry.
Click Check my progress to verify the objective. If you have successfully created a Kubernetes cluster, you see an assessment score.
Helm is a package manager that helps you configure and deploy Kubernetes applications. In this task, you use Helm to install Jenkins from the Charts repository and sign in to the Jenkins interface.
When you install Jenkins, you can use a values file as a template to provide values that are necessary for setup.
You use a custom values file to automatically configure your Kubernetes Cloud and add the following necessary plugins:
This allows Jenkins to connect to your cluster and your Google Cloud project.
This command might take a few minutes to finish.
Click Check my progress to verify the objective. If you have successfully configured a Jenkins chart, you see an assessment score.
Running state and the container is in the READY state:Example output:
You should receive the following output:
Example output:
You use the Kubernetes Plugin so that Kubernetes automatically launches builder nodes as necessary when the Jenkins controller requests them. When builder nodes finish their work, they automatically turn down and Kubernetes returns their resources to the cluster's resource pool.
Notice that this service exposes ports 8080 and 50000 for any pods that match the selector. This exposes the Jenkins web UI and builder/agent registration ports within the Kubernetes cluster. Additionally, the jenkins-ui service uses a ClusterIP address so that it is not accessible from outside the cluster.
Retrieve the admin password and sign in to the Jenkins interface.
To open the Jenkins user interface, in the Cloud Shell toolbar, click Web Preview () > Preview on port 8080.
If Jenkins prompts you to sign in, then enter admin as the username and your auto-generated password.
You now have Jenkins set up in your Kubernetes cluster! Jenkins drives your automated CI/CD pipelines in the next sections.
In this task, you review the sample application, gceme, and deploy it into production and canary environments.
Developers wrote the gceme application in Go, and its source code is in the repository's sample-app directory. When you run the gceme binary on a Compute Engine instance, the app displays the instance's metadata in an info card.
The application mimics a microservice by supporting two operation modes:
gceme listens on port 8080 and returns Compute Engine instance metadata in JSON format.gceme queries the backend gceme service and renders the resulting JSON in the user interface.Deploy the application into two different environments:
kubectl apply commands:Click Check my progress to verify the objective. If you have successfully created deployments, you see an assessment score.
By default, the deployment runs only one replica of the frontend. Use the kubectl scale command to ensure that at least 4 replicas run at all times.
Example output:
Copy the EXTERNAL-IP value from the output and paste it into a browser tab to view the info card—you should see a similar page:
Open the frontend external IP address in your browser to confirm that both services are working.
Check the version output of the service by running the following command (it should return 1.0.0):
You have successfully deployed the sample application! Next, you set up a pipeline to deploy your changes continuously and reliably.
In this task, you set up a Git repository on your dedicated Git server and create the Jenkins pipeline:
sample-app directory as a Git repository:master branch:Configure your credentials to allow Jenkins to access the cluster and deploy resources.
In the Security section, click Credentials.
Under Stores scoped to Jenkins, click System.
Click Global credentials (unrestricted).
Click Add Credentials.
For Kind, select Google Service Account from metadata, and then click Next.
For ID, enter your Project ID (
Project ID in the lab's Connection Details panel.
Jenkins adds the global credentials.
In the Jenkins interface, configure a Multibranch Pipeline job:
In the Jenkins navigation menu, click Jenkins > New Item.
Enter the item name sample-app, select Multibranch Pipeline, and then click OK.
In the Branch Sources section, select Git from the Add source menu.
For Project Repository, enter the clone URL of your repository:
For Credentials, leave the setting as - none -.
In the Scan Multibranch Pipeline Triggers section, select the Periodically if not otherwise run checkbox, and set Interval to 1 minute.
Leave all other options at their defaults, and click Save.
After you complete these steps, a job named Branch indexing runs. This meta-job identifies the branches in your repository and verifies whether changes have occurred in existing branches. When you click sample-app in the breadcrumb navigation, the master job appears.
master job might fail until you make a few code changes in the next task.
You have created a Jenkins pipeline. Next, you create the development environment for continuous integration.
Development branches are a set of environments that your developers use to test their code changes before submitting them for integration into the live site. These environments are scaled-down versions of your application, and you must deploy them using the same mechanisms as the live environment.
To create a development environment from a feature branch, you push the branch to the Git server and let Jenkins deploy your environment.
The Jenkinsfile that defines the pipeline uses the Jenkins Pipeline Groovy syntax. Using a Jenkinsfile lets you express an entire build pipeline in a single file that lives alongside your source code. Pipelines support features such as parallelization and manual user approval.
For the pipeline to work as expected, you must create an Artifact Registry repository for your container images and modify the Jenkinsfile to set your project ID and Artifact Registry image path.
Jenkinsfile in your terminal editor, such as vi:Replace REPLACE_WITH_YOUR_PROJECT_ID with your PROJECT_ID. (You can find your Project ID in the lab's Connection Details panel, or by running gcloud config get-value project.)
Confirm that CLUSTER_ZONE is set to gcloud config get compute/zone), add REGION set to REPO set to my-repository, and update IMAGE_TAG to target Artifact Registry:
Jenkinsfile in vi, press ESC, type the following command, and press ENTER:To demonstrate changing the application, change the gceme cards from blue to orange.
html.go:<div class="card blue"> with the following HTML:html.go file, press ESC, type the following command, and press ENTER:main.go:Update it to the following value:
main.go file, press ESC, type the following command, and press ENTER:Deploy your development environment and verify the running version.
This command starts a build of your development environment.
In the Jenkins interface, navigate to the sample-app job:
new-feature branch does not appear immediately under the Branches tab, then click Scan Multibranch Pipeline Now in the navigation menu.Click new-feature.
In the Build History section, click the build number (for example, #1), and then click Console Output in the navigation menu to view the live build logs.
Monitor the build output for the kubectl --namespace=new-feature apply... messages. When the build finishes, Jenkins deploys your new-feature branch to your cluster.
localhost and letting kubectl proxy forward it to your service:The command responds with 2.0.0, which is the version that is now running.
If you receive an error similar to the following output:
curl command again. Proceed when you receive the following output:You have set up the development environment. Next, build on what you learned by deploying a canary release to test a new feature.
Click Check my progress to verify the objective.
new-feature branch
Now that you have verified that your app runs the latest code in the development environment, deploy that code to the canary environment.
canary branch and push it to the Git server:canary pipeline has started. After the build completes, check the service URL to verify that your new version serves some of the traffic. About 1 in 5 requests (in no particular order) returns version 2.0.0:1.0.0, run the preceding commands again. After you verify that 2.0.0 responses appear, press CTRL+C to stop the command.You have deployed a canary release. Next, you deploy the new version to production.
Click Check my progress to verify the objective.
Now that your canary release is successful and there are no customer complaints, deploy the release to the rest of your production fleet.
canary branch into master and push it to the Git server:In Jenkins, the master pipeline starts.
Click Check my progress to verify the objective.
2.0.0) serves all of the traffic:1.0.0, run the preceding commands again. To stop this command, press CTRL+C.Example output:
You can also view the site where the gceme application displays the info cards. The card color changed from blue to orange.
EXTERNAL-IP value into a new browser tab to view the info card:Example output:
Answer the following multiple-choice questions to reinforce your understanding of this lab's concepts.
You have deployed your application to production.
This concludes this hands-on lab deploying and working with Jenkins in Kubernetes Engine to enable a Continuous Delivery / Continuous Deployment pipeline. You've had the opportunity to deploy a significant DevOps tool in Kubernetes Engine and configure it for production use. You've worked with the kubectl command-line tool and deployment configurations in YAML files, and have learned how to set up Jenkins pipelines for a development and deployment process. With this practical hands-on experience, you can apply these tools in your own DevOps environment.
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual Last Updated on November 10, 2026
Lab Last Tested August 27, 2026
Copyright 2026 Google LLC. All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
This content is not currently available
We can notify you via email when it becomes available
Great!
We can contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one