
Answer-first summary for fast verification
Answer: 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.
The correct answer is Option C. To deploy a Docker container on Kubernetes Engine, you should first create a Docker image from the Dockerfile and push it to Container Registry, which is a fully-managed Docker container registry that makes it easy for you to store, manage, and deploy Docker container images. Then, you can create a Deployment YAML file that specifies the image to use and other desired deployment options, and use the kubectl command-line tool to create the deployment based on the YAML file. Option A is incorrect because kubectl app deploy is not a valid command. Option B is incorrect because gcloud app deploy is used to deploy applications to App Engine, not Kubernetes Engine. Option D is incorrect because it involves storing the image in Cloud Storage rather than Container Registry.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
To deploy a containerized application defined by a Dockerfile onto a Google Kubernetes Engine (GKE) cluster, what are the necessary steps to achieve this deployment?
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.