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 replace the need for an operating system
C. To act as a web server for static files
D. To package applications and dependencies into a portable container

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

A. VMs spin up faster than containers
B. Containers have their own guest operating system, while VMs share the host OS
C. VMs are more lightweight 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 writable layer on top of a file system
C. A read-only template used to create containers
D. A running instance of a container

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

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

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 documents that the container listens on the specified network ports at runtime
C. It creates a security vulnerability
D. It downloads external dependencies

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

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

8 What is Container Orchestration?

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

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

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

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

A. A storage volume
B. The master node controller
C. A network firewall rule
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 act as a load balancer for external traffic only
B. To provide storage to containers
C. To manage the cluster, schedule pods, and maintain the desired state
D. To run the actual application workloads

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

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

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

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

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

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

15 What is a 'Service' in Kubernetes?

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

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

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

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

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

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

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

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

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

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

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

21 What is a 'Deployment' in Kubernetes?

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

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

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

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

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

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

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

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

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

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

A. CMD
B. BUILD
C. RUN
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 deployment that fails 50% of the time
D. A technique where two identical environments exist, one running production (Blue) and one with the new version (Green)

28 What is the 'Docker Daemon'?

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

29 Which Kubernetes component exposes the Kubernetes API?

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

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

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

31 What is a 'Canary Deployment'?

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

32 Which Docker command creates an image from a Dockerfile?

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

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

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

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 build container images
C. To maintain network rules on nodes allowing network communication to your Pods
D. To store cluster data

36 Why is immutability important in container images?

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

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

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

38 What is a Multi-stage build in Docker?

A. Building an image on multiple computers at once
B. A method to reduce image size by using multiple FROM instructions and copying artifacts between stages
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. A Node runs inside a Pod
B. A Pod runs on a Node
C. They are the same thing
D. A Node is a type of storage for a Pod

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

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

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

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

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

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. Committing to the main branch frequently (at least daily)
D. Manual testing only

45 What is a 'ConfigMap' in Kubernetes?

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

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

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

47 Which Docker command stops a running container?

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

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 workload API object used to manage stateful applications
B. A configuration for stateless apps
C. A set of stateless web servers
D. A set of static IP addresses

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

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