Te treści nie są jeszcze zoptymalizowane pod kątem urządzeń mobilnych.
Dla maksymalnej wygody odwiedź nas na komputerze, korzystając z linku przesłanego e-mailem.
Overview
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.
Objectives
In this lab, you learn how to perform the following tasks:
Create a Kubernetes cluster.
Configure and deploy SQL Server into the cluster.
Connect to the SQL Server database from a client machine.
Setup and requirements
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.
Task 1. Create a Kubernetes cluster
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:
cd ~/training-data-analyst/courses/db-migration/sql-server-on-gke
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.
Note: The environment variables start at line 21 and continue through 32. These variables accept the license agreement, set the password for the SA account using a Kubernetes secret, and specify the paths required by the database.
Starting at line 34, the volumes from the previous file are used.
Select the mssql-service.yaml file.
The service provides access to the database. In this case, the service is type LoadBalancer.
Note: A load balancer will create a public IP address, which makes the database available outside the cluster. If you removed the last line, the service would have only a private IP address, thus making the database available only from within the cluster.
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:
kubectl create secret generic mssql-secrets --from-literal=SA_PASSWORD="Passw0rd!"
Note: If the password isn't strong, the deployment will fail when you set the password for the sa account.
To deploy the database, enter the following commands:
Wait a minute for the deployment to succeed, and then type the following command to see whether the database is ready:
kubectl get pods
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:
kubectl get services
If the status of the external IP address of the load balancer is Pending, wait a few seconds and try again; otherwise, copy the external IP address to the clipboard and paste it in a text file. (You will need it later.)
Click Check my progress to verify the objective.
Configure and deploy SQL Server into the cluster
Task 3. Connect to the SQL Server database from a client machine
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:
Name: sql-server-client
Region:
Zone:
Click OS and storage.
Click Change to begin configuring your boot disk and select the values for:
Operating system: Container Optimized OS
Version: Accept the default version
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.
Connect to the SQL Server database from a client machine
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:
sudo docker run -it mcr.microsoft.com/mssql-tools
It will take a few seconds for the container to be downloaded and executed.
To connect to your SQL Server database running inside the GKE cluster, enter the following command at the prompt, changing the <IP-address> to your load balancer's IP address:
sqlcmd -S <IP-address> -U sa -P Passw0rd!
Test your connection:
EXEC sp_databases;
GO
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.
End your lab
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:
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 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.
Moduły tworzą projekt Google Cloud i zasoby na określony czas.
Moduły mają ograniczenie czasowe i nie mają funkcji wstrzymywania. Jeśli zakończysz moduł, musisz go zacząć od początku.
Aby rozpocząć, w lewym górnym rogu ekranu kliknij Rozpocznij moduł.
Użyj przeglądania prywatnego
Skopiuj podaną nazwę użytkownika i hasło do modułu.
Kliknij Otwórz konsolę w trybie prywatnym.
Zaloguj się w konsoli
Zaloguj się z użyciem danych logowania do modułu. Użycie innych danych logowania może spowodować błędy lub naliczanie opłat.
Zaakceptuj warunki i pomiń stronę zasobów przywracania.
Nie klikaj Zakończ moduł, chyba że właśnie został przez Ciebie zakończony lub chcesz go uruchomić ponownie, ponieważ spowoduje to usunięcie wyników i projektu.
Ta treść jest obecnie niedostępna
Kiedy dostępność się zmieni, wyślemy Ci e-maila z powiadomieniem
Świetnie
Kiedy dostępność się zmieni, skontaktujemy się z Tobą e-mailem
Jeden moduł, a potem drugi
Potwierdź, aby zakończyć wszystkie istniejące moduły i rozpocząć ten
Aby uruchomić moduł, użyj przeglądania prywatnego
Najlepszym sposobem na uruchomienie tego laboratorium jest użycie okna incognito lub przeglądania prywatnego. Dzięki temu unikniesz konfliktu między swoim kontem osobistym a kontem do nauki, co mogłoby spowodować naliczanie dodatkowych opłat na koncie osobistym.
In this lab, you will create a Kubernetes cluster in Google Kubernetes Engine (GKE). You will configure and deploy a Microsoft SQL Server database into the cluster and connect to it from a client machine. Then, you will simplify the deployment using Helm.
Czas trwania:
Konfiguracja: 0 min
·
Dostęp na 120 min
·
Ukończono w 45 min