Instructions et exigences de configuration de l'atelier
Protégez votre compte et votre progression. Utilisez toujours une fenêtre de navigation privée et les identifiants de l'atelier pour exécuter cet atelier.
Ce contenu n'est pas encore optimisé pour les appareils mobiles.
Pour une expérience optimale, veuillez accéder à notre site sur un ordinateur de bureau en utilisant un lien envoyé par e-mail.
Overview
In this lab, you create a Google Kubernetes Engine (GKE) cluster, and then deploy databases into it. You see two ways to deploy the databases: first using your own configuration code, and then using a Kubernetes package manager called Helm.
Objectives
In this lab, you learn how to perform the following tasks:
Create a GKE cluster.
Deploy MySQL on the cluster.
Use Helm to deploy MySQL on the cluster.
Setup
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 GKE cluster
Open a new web browser window and navigate to the Google Cloud Console (console.cloud.google.com). Use the project selector to choose
the first project with a leading name of 'qwiklabs-gcp.'
On the Navigation menu (), click Kubernetes Engine > Clusters.
Click Create.
You can see Standard: You manage your cluster inside Create a cluster pop-up.
Click Configure next to Standard: You manage your cluster.
For Location type, select Zonal.
Accept all defaults and click Create. It will take a couple minutes for the cluster to be ready.
When the cluster is ready, click Connect from the Actions menu.
The command for connecting to the cluster is specified.
To open Cloud Shell with the command entered, click Run in Cloud Shell, and if prompted click Continue.
Press ENTER to run the command. If prompted click Authorize.
You are connected to the cluster and ready to deploy a program.
Test the connection with the following kubectl command:
kubectl get nodes
This command returns a list of the three virtual machines that make up this cluster.
Click Check my progress to verify the objective.
Create a Kubernetes cluster
Review
You just created a Kubernetes cluster. Next, you configure and deploy MySQL to run in it.
Task 2. Deploy MySQL on the cluster
You need a root password for the database. You store the password as a Kubernetes secret. The secret is a key-value pair. In this case, the key is ROOT_PASSWORD and the value is password.
To create the secret, enter the following command:
Starting at line 26, an environment variable is created for the database root password using the secret you created earlier. There are also variables to create a test user with a simple password.
On the last line, the disk space you allocated in the previous file is used.
The database needs a service so it can be accessed.
Create a third file in the mysql-gke folder, name it service.yaml, and paste the following code into it:
apiVersion: v1
kind: Service
metadata:
name: mysql-service
spec:
selector:
app: mysql
ports:
- protocol: TCP
port: 3306
targetPort: 3306
Note: This creates a service that provides access to the database from within the cluster that forwards requests to the MySQL database.
In Cloud Shell, click Open Terminal to return to the command line. Make sure you are in the correct folder and type ls to verify that you have your three YAML files.
To deploy your database, enter the following kubectl commands:
Wait a minute for the resources to be created, and then enter the following command:
kubectl get pods
The pod that has your database installed should be running. If it is not running yet, wait a little while and try again.
Note: At this point, there are no client applications and the database is only accessible from inside the cluster. In the next step, you access the database from inside the pod where it is running.
Click Check my progress to verify the objective.
Deploy MySQL on the cluster
Copy the name of the pod obtained from the last command to the clipboard. It will begin with mysql-deployment- followed by a unique string.
Enter the following command but < replace the pod name > with your pod's name:
To update the Helm packages, enter the following command:
helm repo update
Install a MySQL named mydb using Helm:
helm install mydb bitnami/mysql
Click Check my progress to verify the objective.
Use Helm to deploy MySQL on the cluster
Read the output from the Helm install command and connect to your database using the instructions provided.
When you are connected to the database, exit to return to the Cloud Shell command prompt.
To see your Helm deployment, enter the following command:
helm ls
Notice that the deployment has the name mydb specified in the install command.
To delete the deployment, enter the following command:
helm delete mydb
Congratulations! You have created a Kubernetes cluster and then deployed MySQL databases into it, first using your own configuration code, and then using Helm.
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.
Les ateliers créent un projet Google Cloud et des ressources pour une durée déterminée.
Les ateliers doivent être effectués dans le délai imparti et ne peuvent pas être mis en pause. Si vous quittez l'atelier, vous devrez le recommencer depuis le début.
En haut à gauche de l'écran, cliquez sur Démarrer l'atelier pour commencer.
Utilisez la navigation privée
Copiez le nom d'utilisateur et le mot de passe fournis pour l'atelier
Cliquez sur Ouvrir la console en navigation privée
Connectez-vous à la console
Connectez-vous à l'aide des identifiants qui vous ont été attribués pour l'atelier. L'utilisation d'autres identifiants peut entraîner des erreurs ou des frais.
Acceptez les conditions d'utilisation et ignorez la page concernant les ressources de récupération des données.
Ne cliquez pas sur Terminer l'atelier, à moins que vous n'ayez terminé l'atelier ou que vous ne vouliez le recommencer, car cela effacera votre travail et supprimera le projet.
Ce contenu n'est pas disponible pour le moment
Nous vous préviendrons par e-mail lorsqu'il sera disponible
Parfait !
Nous vous contacterons par e-mail s'il devient disponible
Un atelier à la fois
Confirmez pour mettre fin à tous les ateliers existants et démarrer celui-ci
Utilisez la navigation privée pour effectuer l'atelier
Le meilleur moyen d'exécuter cet atelier consiste à utiliser une fenêtre de navigation privée. Vous éviterez ainsi les conflits entre votre compte personnel et le compte temporaire de participant, qui pourraient entraîner des frais supplémentaires facturés sur votre compte personnel.
In this lab, you will create a Kubernetes cluster and then deploy databases into it. You will see two ways to deploy the databases. First using your own configuration code and then using a Kubernetes package manager called Helm.
Durée :
0 min de configuration
·
Accessible pendant 120 min
·
Terminé après 60 min