准备工作
- 实验会创建一个 Google Cloud 项目和一些资源,供您使用限定的一段时间
- 实验有时间限制,并且没有暂停功能。如果您中途结束实验,则必须重新开始。
- 在屏幕左上角,点击开始实验即可开始
Create a Kubernetes cluster
/ 30
Configure and deploy SQL Server into the cluster
/ 40
Connect to the SQL Server database from a client machine
/ 30
In this lab, you create a Kubernetes cluster in Google Kubernetes Engine (GKE). You configure and deploy a Microsoft SQL Server database into the cluster and connect to it from a client machine.
In this lab, you learn how to perform the following tasks:
In this task, you perform initialization steps for your lab.
For each lab, you get a new Google Cloud project and set of resources for a fixed time at no cost.
Sign in to Google Skills using an incognito window.
Note the lab's access time (for example, 1:15:00), and make sure you can finish within that time.
There is no pause feature. You can restart if needed, but you have to start at the beginning.
When ready, click Start lab.
Note your lab credentials (Username and Password). You will use them to sign in to the Google Cloud Console.
Click Open Google Console.
Click Use another account and copy/paste credentials for this lab into the prompts. If you use other credentials, you'll receive errors or incur charges.
Accept the terms and skip the recovery resource page.
Open a new web browser window and navigate to the Google Cloud Console.
Use the project selector to choose the first project with a leading name of 'qwiklabs-gcp.'
Click Activate Cloud Shell () in the upper right of the Console.
The Cloud Shell terminal will open in a pane at the bottom of the window.
To create a Kubernetes cluster, enter the following command:
It will take a few minutes for the cluster to be ready.
Machines (nodes) that make up the cluster are listed.
Click Check my progress to verify the objective.
Click Open Editor, and then select the training-data-analyst/courses/db-migration/sql-server-on-gke folder.
Select the volume-claims.yaml file.
This file configures three volumes: one for the SQL Server software, one for the data, and one for the transaction logs.
Select the mssql-deployment.yaml file.
This file configures the SQL Server deployment. On line 18, the Microsoft SQL Server image is specified.
LoadBalancer.To return to the command line, click Open Terminal.
To create the Kubernetes secret that is used to set the password, enter the following command:
If the status is Running, continue; otherwise, wait a few seconds and run the previous command again.
To get the IP address of the load balancer, enter the following command:
Click Check my progress to verify the objective.
You now create a virtual machine and connect to the SQL Server database running in the GKE cluster.
In the Cloud console, on the Navigation menu (☰), click Compute Engine > VM Instances.
To create a new instance, click Create instance.
On the Machine configuration page, enter the following values:
sql-server-client
Click OS and storage.
Click Change to begin configuring your boot disk and select the values for:
Click on Select.
Once all sections are configured, scroll down and click Create to launch your virtual machine instance.
Click Check my progress to verify the objective.
When the machine is ready, click SSH to connect to it.
You now run a Docker container provided by Microsoft that has the SQL client tools already installed.
To start the container in interactive mode, enter the following command:
It will take a few seconds for the container to be downloaded and executed.
<IP-address> to your load balancer's IP address:Exit from the client, close the SSH window, and return to Cloud Shell.
To delete the SQL Server deployment, enter the following commands:
Congratulations! You have created a Kubernetes cluster in Google Kubernetes Engine. You configured and deployed a Microsoft SQL Server database into the cluster and connected to it from a client machine.
When you have completed your lab, click End Lab. Google Skills 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:
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 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.
此内容目前不可用
一旦可用,我们会通过电子邮件告知您
太好了!
一旦可用,我们会通过电子邮件告知您
一次一个实验
确认结束所有现有实验并开始此实验