Unit 3: Deploying Microservices - Practice Quiz

INT363 — Cloud Microservices 50 Questions
0 Correct 0 Wrong 50 Left
0/50

1 What is the primary function of Docker in the context of microservices?

A. To manage physical hardware resources manually
B. To package applications and dependencies into a portable container
C. To replace the need for an operating system
D. To act as a web server for static files

2 Which of the following describes a key difference between Virtual Machines (VMs) and Containers?

A. VMs are more lightweight than containers
B. Containers have their own guest operating system, while VMs share the host OS
C. VMs spin up faster than containers
D. Containers share the host OS kernel, while VMs include a full guest OS

3 What is a Docker Image?

A. A database used by Docker
B. A running instance of a container
C. A writable layer on top of a file system
D. A read-only template used to create containers

4 Which file is used to define the instructions for building a Docker image?

A. docker-compose.yml
B. container.conf
C. package.json
D. Dockerfile

5 In a Dockerfile, which instruction initializes a new build stage and sets the base image?

A. IMPORT
B. START
C. BASE
D. FROM

6 What is the purpose of the 'EXPOSE' instruction in a Dockerfile?

A. It publishes the port to the host machine automatically
B. It downloads external dependencies
C. It documents that the container listens on the specified network ports at runtime
D. It creates a security vulnerability

7 Which Docker command is used to list all currently running containers?

A. docker ps
B. docker run
C. docker images
D. docker list

8 What is Container Orchestration?

A. The manual installation of Docker on servers
B. The creation of virtual machines
C. The process of writing code for microservices
D. The automated management of the lifecycle of containers

9 Which of the following is the most popular open-source platform for container orchestration?

A. Nagios
B. Ansible
C. Jenkins
D. Kubernetes

10 In Kubernetes architecture, what is a 'Pod'?

A. A network firewall rule
B. A storage volume
C. The master node controller
D. The smallest deployable unit used to encapsulate one or more containers

11 What is the role of the 'Control Plane' (formerly Master Node) in Kubernetes?

A. To run the actual application workloads
B. To act as a load balancer for external traffic only
C. To provide storage to containers
D. To manage the cluster, schedule pods, and maintain the desired state

12 Which component of the Kubernetes Control Plane is a key-value store used for all cluster data?

A. etcd
B. kube-scheduler
C. controller-manager
D. kube-proxy

13 What is the function of the 'kube-scheduler'?

A. It stores the cluster state
B. It executes the containers on the node
C. It exposes the Kubernetes API
D. It assigns newly created Pods to nodes based on resource availability and constraints

14 Which agent runs on every Kubernetes node and ensures that containers are running in a Pod?

A. etcd
B. kubelet
C. kube-apiserver
D. Cloud Controller Manager

15 What is a 'Service' in Kubernetes?

A. An abstraction that defines a logical set of Pods and a policy to access them
B. A tool for building Docker images
C. A background process in the Linux OS
D. A script that runs during startup

16 Which command line tool is used to communicate with the Kubernetes cluster?

A. kubectl
B. kube-admin
C. docker-cli
D. k8s-run

17 What is the purpose of 'Continuous Integration' (CI)?

A. To deploy applications to production once a year
B. To manage the physical servers in a data center
C. To manually compile code before release
D. To automate the merging of code changes into a shared repository and running tests

18 Which of the following is a benefit of Continuous Integration?

A. It detects integration errors early in the development cycle
B. It allows developers to work in isolation for months
C. It eliminates the need for version control
D. It slows down the development process

19 In the context of CI/CD, what is a 'Build Artifact'?

A. A compiled and packaged file (like a JAR or Docker Image) ready for deployment
B. A bug found during testing
C. The documentation of the project
D. The source code file

20 What is the difference between 'ADD' and 'COPY' in a Dockerfile?

A. COPY is deprecated; ADD is the new standard
B. COPY is for Linux, ADD is for Windows
C. There is no functional difference
D. ADD allows extracting tar files and downloading URLs, while COPY only copies local files

21 What is a 'Deployment' in Kubernetes?

A. A resource object that manages ReplicaSets and provides declarative updates to Pods
B. A method to install Kubernetes
C. A one-time job execution
D. A network policy

22 Which Kubernetes concept is used to isolate resources within the same cluster?

A. Nodes
B. Volumes
C. Namespaces
D. Ingress

23 What is 'Rolling Update' in the context of microservices deployment?

A. Shutting down all instances and starting new ones simultaneously
B. Gradually replacing instances of the old version with the new version
C. Reverting to a previous version manually
D. Deploying the new version to a separate environment for testing only

24 What is the purpose of a '.dockerignore' file?

A. To specify files and directories that should be excluded from the build context
B. To list ignored users
C. To ignore errors during the build process
D. To list the files that should be included in the image

25 In Kubernetes, what is a 'ReplicaSet' responsible for?

A. Exposing services to the internet
B. Ensuring a specified number of pod replicas are running at any given time
C. Managing user permissions
D. Storing configuration data

26 Which instruction in a Dockerfile defines the command to run when the container starts?

A. RUN
B. BUILD
C. CMD
D. EXEC

27 What is 'Blue-Green Deployment'?

A. Deploying only to users with blue or green screens
B. Updating half the servers in the morning and half at night
C. A technique where two identical environments exist, one running production (Blue) and one with the new version (Green)
D. A deployment that fails 50% of the time

28 What is the 'Docker Daemon'?

A. The registry where images are stored
B. A container analysis tool
C. The command line interface for Docker
D. A background service that manages Docker objects like images, containers, and networks

29 Which Kubernetes component exposes the Kubernetes API?

A. kube-scheduler
B. etcd
C. kube-apiserver
D. kubelet

30 What is the primary purpose of 'Docker Hub'?

A. To run containers on the cloud
B. A cloud-based registry service for sharing and storing Docker images
C. A local storage for Docker logs
D. A tool to compile Java code

31 What is a 'Canary Deployment'?

A. Deploying to a bird-themed server
B. Releasing code only to internal developers
C. Releasing code to a small percentage of users before a full rollout
D. Deploying code without testing

32 Which Docker command creates an image from a Dockerfile?

A. docker create
B. docker image-maker
C. docker build
D. docker commit

33 What does the 'WORKDIR' instruction do in a Dockerfile?

A. It installs a worker process
B. It creates a new user
C. It defines the network mode
D. It sets the working directory for any RUN, CMD, ENTRYPOINT, COPY and ADD instructions that follow

34 In Kubernetes, what is an 'Ingress'?

A. An API object that manages external access to the services in a cluster, typically HTTP
B. A storage volume
C. A security credential
D. A type of container image

35 What is the role of 'kube-proxy'?

A. To schedule pods
B. To maintain network rules on nodes allowing network communication to your Pods
C. To store cluster data
D. To build container images

36 Why is immutability important in container images?

A. It makes the image size larger
B. It ensures that the container runs exactly the same way in every environment
C. It allows the image to be changed easily at runtime
D. It prevents the image from being deleted

37 Which CI tool is widely used for building and testing software projects continuously?

A. Zoom
B. Photoshop
C. Jenkins
D. Excel

38 What is a Multi-stage build in Docker?

A. A method to reduce image size by using multiple FROM instructions and copying artifacts between stages
B. Building an image on multiple computers at once
C. Running a build for more than 24 hours
D. Building multiple images for different OS versions

39 What is the relationship between a Pod and a Node in Kubernetes?

A. They are the same thing
B. A Node is a type of storage for a Pod
C. A Node runs inside a Pod
D. A Pod runs on a Node

40 Which Kubernetes object is used to store sensitive information like passwords or keys?

A. Volume
B. ConfigMap
C. Deployment
D. Secret

41 What does the 'ENV' instruction do in a Dockerfile?

A. Installs a new environment
B. Sets an environment variable
C. Validates the environment
D. Ends the build process

42 In the context of Docker, what is a 'Volume'?

A. The loudness of the container
B. A mechanism for persisting data generated by and used by Docker containers
C. A CPU limit
D. A networking protocol

43 What is the 'Self-healing' capability in Kubernetes?

A. The ability to automatically upgrade the operating system
B. The ability of the code to fix syntax errors
C. The ability of the hardware to repair itself
D. The ability of Kubernetes to restart failed containers, replace them, and kill containers that don't respond to health checks

44 Which of the following is a key principle of Continuous Integration?

A. Deploying to production manually once a month
B. Long-lived feature branches
C. Manual testing only
D. Committing to the main branch frequently (at least daily)

45 What is a 'ConfigMap' in Kubernetes?

A. A configuration file for the Docker daemon
B. A map of the physical network
C. An API object used to store non-confidential data in key-value pairs
D. A tool to map ports

46 What is the 'Sidecar' pattern in microservices deployment?

A. Running two different applications on the same server
B. Using a motorcycle for delivery
C. Backing up data to a side server
D. Deploying a helper container alongside the main application container in the same Pod

47 Which Docker command stops a running container?

A. docker pause
B. docker end
C. docker halt
D. docker stop

48 What is the difference between RUN and CMD in a Dockerfile?

A. They are identical
B. RUN executes during the build phase; CMD executes when the container starts
C. RUN is used for networking; CMD is for storage
D. CMD executes during the build phase; RUN executes when the container starts

49 In Kubernetes, what is a 'StatefulSet'?

A. A set of stateless web servers
B. A workload API object used to manage stateful applications
C. A configuration for stateless apps
D. A set of static IP addresses

50 What is the main advantage of using a 'Layered Architecture' in Docker images?

A. It encrypts the data automatically
B. It allows the image to run on Windows and Linux simultaneously
C. It allows caching and reuse of layers, speeding up builds and reducing storage
D. It looks better visually