You have a Dockerfile that you need to deploy on Kubernetes Engine. What should you do?
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.
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.
https://cloud.google.com/kubernetes-engine/docs/how-to/deploying-a-container
The file image should be created from the Dockerfile and pushed to the Registry and from there it should be deployed once it's YAML structure is in place.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Agents89
Highly Voted 5 years, 1 month agoBuruguduystunstugudunstuy
Highly Voted 2 years, 5 months agoast3citos
2 years, 3 months agokewgard
Most Recent 2 weeks, 2 days agoCloudmoh
4 months, 1 week agomadzzzz
8 months, 2 weeks agosubha.elumalai
1 year agoBAofBK
1 year, 7 months agoEvan7557
1 year, 8 months agodookiecloud
1 year, 9 months agoCaptain1212
1 year, 9 months agosajitv
2 years, 3 months agoChristN
2 years, 6 months agoleogor
2 years, 7 months agohiromi
2 years, 8 months agoRanjithK
2 years, 11 months agoAzureDP900
2 years, 12 months agoBiksthrow
2 years, 12 months ago