Loading...
No results found.

Apply your skills in Google Cloud console

04

Essential Google Cloud Infrastructure: Foundation

Get access to 700+ labs and courses

Infrastructure Preview

Lab 30 minutes universal_currency_alt 5 Credits show_chart Introductory
info This lab may incorporate AI tools to support your learning.
Get access to 700+ labs and courses

Overview

In this lab, you build a sophisticated deployment in minutes using Marketplace. This lab shows several of the Google Cloud infrastructure services in action and illustrates the power of the platform. It introduces technologies that are covered in detail later in the class.

Objectives

In this lab, you learn how to perform the following tasks:

  • Use Marketplace to build a Jenkins Continuous Integration environment.
  • Verify that you can manage the service from the Jenkins UI.
  • Administer the service from the Virtual Machine host through SSH.

Qwiklabs setup

For each lab, you get a new Google Cloud project and set of resources for a fixed time at no cost.

  1. Click the Start Lab button. If you need to pay for the lab, a pop-up opens for you to select your payment method. On the left is the Lab Details panel with the following:

    • The Open Google Cloud console button
    • Time remaining
    • The temporary credentials that you must use for this lab
    • Other information, if needed, to step through this lab
  2. 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.

    Note: If you see the Choose an account dialog, click Use Another Account.
  3. If necessary, copy the Username below and paste it into the Sign in dialog.

    {{{user_0.username | "Username"}}}

    You can also find the Username in the Lab Details panel.

  4. Click Next.

  5. Copy the Password below and paste it into the Welcome dialog.

    {{{user_0.password | "Password"}}}

    You can also find the Password in the Lab Details panel.

  6. Click Next.

    Important: You must use the credentials the lab provides you. Do not use your Google Cloud account credentials. Note: Using your own Google Cloud account for this lab may incur extra charges.
  7. Click through the subsequent pages:

    • Accept the terms and conditions.
    • Do not add recovery options or two-factor authentication (because this is a temporary account).
    • Do not sign up for free trials.

After a few moments, the Google Cloud console opens in this tab.

Note: To view a menu with a list of Google Cloud products and services, click the Navigation menu at the top-left, or type the service or product name in the Search field.

Task 1. Use Marketplace to build a deployment

In this task, you use Google Cloud Marketplace to deploy a pre-configured Jenkins instance. You explore the Marketplace interface, select the Bitnami Jenkins package, and launch the deployment using Deployment Manager. You configure basic deployment settings, including the service account, zone, and machine type.

Navigate to Marketplace

  1. In the Google Cloud console, in the Navigation menu (), click Marketplace.
  2. Locate the Jenkins deployment by searching for Bitnami package for Jenkins.
  3. Click on the deployment and read about the service provided by the software. Jenkins is an open-source continuous integration environment. You can define jobs in Jenkins that can perform tasks such as running a scheduled build of software and backing up data. Notice the software that is installed as part of Jenkins shown in the left side of the description.

The service you are using, Marketplace, is part of Google Cloud. The Jenkins template is developed and maintained by an ecosystem partner named Bitnami. Notice on the left side a field that says "Last updated." How recently was this template updated?

Launch Jenkins

  1. Click Get Started.
  2. Verify the deployment, accept the terms and services and click Agree.
  3. For the popup Successfully agreed to terms click Deploy.
  4. If prompted, click on Enable for the Compute Engine API and the Infrastructure Manager API.
  5. On the Deployment page, under Deployment Service Account, select Existing Account and choose the account Compute Engine default service account .
  6. Select zone as .
  7. For Machine Type, select E2 as the Series and e2-standard-2 (2 vCPU, 1 core, 8GB memory) as the Machine Type.
  8. Leave everything as default and click Deploy.

Note: Ignore the warning after the Jenkins is deployed.

Note: It will take a minute or two for Deployment Manager to set up the deployment. You can watch the status as tasks are being performed. Deployment Manager is acquiring a virtual machine instance and installing and configuring software for you. You will see jenkins-1 has been deployed when the process is complete.

Deployment Manager is a Google Cloud service that uses templates written in a combination of YAML, python, and Jinja2 to automate the allocation of Google Cloud resources and perform setup tasks. Behind the scenes a virtual machine has been created. A startup script was used to install and configure software, and network Firewall Rules were created to allow traffic to the service.

Click Check my progress to verify the objective.

Launch Jenkins

Task 2. Examine the deployment

In this task, you explore the deployed Jenkins instance. You retrieve admin credentials, log into the Jenkins web interface, and familiarize yourself with its features.

View installed software and login to Jenkins

  1. In the Details tab, note the Admin user and Admin password (Temporary) values and add them to a text editor.
  2. Click the link next to Site URL to view the site in another browser tab. If you encounter an error, you may need to reload the page a couple of times.
  3. If prompted, click on Continue to site.
  4. Log in with the Admin user and Admin password values.
Note: If you get an http 404 error, then remove the /jenkins part from the site address and press Enter. For example: http://35.238.162.236
  1. After logging in, if you are asked to Customize Jenkins. Click Install suggested plugins, and then click Restart after the installation is complete. The restart will take a couple of minutes.
Note: If you are getting an installation error, retry the installation and if it fails again, continue past the error and save and finish before restarting. The code of this solution is managed and supported by Bitnami.

Explore Jenkins

  1. In the Jenkins interface, in the left pane, click Manage Jenkins. Look at all of the actions available. You are now prepared to manage Jenkins. The focus of this lab is Google Cloud infrastructure, not Jenkins management, so seeing that this menu is available is the purpose of this step.
  2. Leave the browser window open to the Jenkins service. You will use it in the next task.
Note: Now you have seen that the software is installed and working properly. In the next task you will open an SSH terminal session to the VM where the service is hosted, and verify that you have administrative control over the service.

Task 3. Administer the service

In this task, you access the Jenkins VM via SSH and manage the Jenkins service. You stop and restart the services using command-line tools, demonstrating administrative control over the deployed application.

View the deployment and SSH to the VM

  1. From the Navigation menu navigate to Compute Engine > VM instance.
  2. Click jenkins-1-vm.
  3. Click SSH to connect to the Jenkins server.
Note: The console interface is performing several tasks for you transparently. For example, it has transferred keys to the virtual machine that is hosting the Jenkins software so that you can connect securely to the machine using SSH.

Shut down and restart the services

  1. In the SSH window, type the following command to shut down all the running services:
sudo /opt/bitnami/ctlscript.sh stop
  1. Refresh the browser window for the Jenkins UI. You will no longer see the Jenkins interface because the service was shut down.
  2. In the SSH window, type the following command to restart the services:
sudo /opt/bitnami/ctlscript.sh restart
  1. Return to the browser window for the Jenkins UI and refresh it. You may have to do it a couple of times before the service is reachable.
  2. In the SSH window, type exit to close the SSH terminal session.

Task 4. Review

In a few minutes you were able to launch a complete Continuous Integration solution. You demonstrated that you had user access through the Jenkins UI, and you demonstrated that you had administrative control over Jenkins by using SSH to connect to the VM where the service is hosted and by stopping and then restarting the services.

End your lab

When you have completed your lab, click End Lab. Google Cloud Skills Boost removes the resources you’ve used and cleans the account for you.

You will be given an opportunity to rate the lab experience. Select the applicable number of stars, type a comment, and then click Submit.

The number of stars indicates the following:

  • 1 star = Very dissatisfied
  • 2 stars = Dissatisfied
  • 3 stars = Neutral
  • 4 stars = Satisfied
  • 5 stars = Very satisfied

You can close the dialog box if you don't want to provide feedback.

For feedback, suggestions, or corrections, please use the Support tab.

Copyright 2022 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.

Previous Next

Before you begin

  1. Labs create a Google Cloud project and resources for a fixed time
  2. Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
  3. On the top left of your screen, click Start lab to begin

This content is not currently available

We will notify you via email when it becomes available

Great!

We will contact you via email if it becomes available

One lab at a time

Confirm to end all existing labs and start this one

Use private browsing to run the lab

Use an Incognito or private browser window to run this lab. This prevents any conflicts between your personal account and the Student account, which may cause extra charges incurred to your personal account.
Preview