
Answer-first summary for fast verification
Answer: Use docker to create a container image, push it to the Google Container Registry, deploy the uploaded image to Kubernetes with kubectl.
The correct approach involves using Docker to create a container image, pushing it to the Google Container Registry, and then deploying the image to Kubernetes using kubectl. This method ensures that your application is containerized and stored in a registry that Kubernetes can access for deployment. The `kubectl apply` command is used to apply configurations to resources but is not directly used to push Docker files to Kubernetes. Similarly, saving the Docker image to Cloud Storage or attempting to convert the Docker file into a deployment with `kubectl convert` are not standard practices for deploying applications to Kubernetes.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
Your team is developing a web application aimed at a local audience, with plans to deploy it on Kubernetes following review and approval. Currently, you have a functional Docker file for local use that needs to be deployed in the cloud. What is the correct method to deploy this application to Kubernetes?
A
Use kubectl apply to push the Docker file to Kubernetes.
B
Use docker to create a container image, push it to the Google Container Registry, deploy the uploaded image to Kubernetes with kubectl.
C
Use docker to create a container image, save the image to Cloud Storage, deploy the uploaded image to Kubernetes with kubectl.
D
Use kubectl convert -f FILENAME to push the converted Docker file into a deployment.