
Answer-first summary for fast verification
Answer: Build a container image with Docker, upload it to Google Container Registry, and deploy it to Kubernetes using kubectl.
The correct approach involves several key steps: 1. **Create a container image**: Use Docker to build an image from your Dockerfile, encapsulating all necessary components and dependencies for your web application. 2. **Push the image to Google Container Registry**: This step makes your container image accessible to Kubernetes by storing it in a registry. 3. **Deploy to Kubernetes with kubectl**: Utilize kubectl to deploy the image as a Kubernetes deployment. This requires a deployment manifest specifying the image, replicas, and other configurations. This method is widely recommended for deploying containerized applications to Kubernetes, offering advantages such as portability, scalability, and isolation.
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 post-review and approval. Currently, you have a functional Docker file for local use that needs cloud deployment. What is the correct method to deploy this application to Kubernetes? (Select One)
A
Utilize kubectl apply to directly push the Docker file to Kubernetes.
B
Convert the Docker file into a deployment using kubectl convert -f FILENAME and then push it.
C
Build a container image with Docker, upload it to Google Container Registry, and deploy it to Kubernetes using kubectl.
D
Create a container image using Docker, save it to Cloud Storage, and then deploy it to Kubernetes with kubectl.