Google Professional Cloud Developer Question 199
Select 3Google Cloud PlatformYou are developing a cloud-native application on Google Cloud and need to set up your local development environment. Which of the following steps should you take to ensure your environment is properly configured?
- A
Install the Google Cloud CLI (gcloud) for managing Google Cloud resources.
- B
Configure application-specific environment variables using a .env file.
- C
Set up a local Kubernetes cluster using minikube or a similar tool for testing.
- D
Use a local MySQL installation instead of connecting to Cloud SQL for database integration.
- E
Enable the Cloud Build API on your local machine for building container images.
Show answer and explanation
Correct answers: A, B, C
Explanation
To set up your local development environment for Google Cloud, you should install the gcloud CLI for resource management, configure environment variables for application-specific settings, and use local emulation tools like minikube for Kubernetes testing. These steps ensure your local setup closely mirrors the cloud environment and enables seamless development and testing workflows.
- A. Correct.
Installing the Google Cloud CLI (gcloud) is essential for managing Google Cloud resources from your local environment, including authentication, project configuration, and resource management.
- B. Correct.
Configuring environment variables using a .env file is a best practice for managing sensitive or environment-specific configuration data in cloud-native application development.
- C. Correct.
Setting up a local Kubernetes cluster, such as with minikube, is useful for testing your Kubernetes configurations and deployments locally before deploying to Google Kubernetes Engine (GKE).
- D. Incorrect.
Using a local MySQL installation may not replicate the production environment accurately and is not recommended for cloud-native application development. Instead, you should connect to Cloud SQL or emulate it locally using tools like the Cloud SQL Auth proxy.
- E. Incorrect.
The Cloud Build API runs in Google Cloud, not locally, so enabling it on your local machine is not applicable. You can use Docker locally for building images and push them to Container Registry or Artifact Registry.