Google Cloud Associate Cloud Engineer — Question 35
You have a Dockerfile that you need to deploy on Kubernetes Engine. What should you do?
Answer options
- A. Use kubectl app deploy <dockerfilename>.
- B. Use gcloud app deploy <dockerfilename>.
- C. Create a docker image from the Dockerfile and upload it to Container Registry. Create a Deployment YAML file to point to that image. Use kubectl to create the deployment with that file.
- D. Create a docker image from the Dockerfile and upload it to Cloud Storage. Create a Deployment YAML file to point to that image. Use kubectl to create the deployment with that file.
Correct answer: C
Explanation
The correct answer is C because it outlines the proper steps to create a Docker image, upload it to Container Registry, and deploy it using Kubernetes with a YAML file. Option A and B incorrectly reference commands that are not valid for this context, while option D suggests using Cloud Storage, which is not the standard practice for Kubernetes deployments.