1. LPU MCA Semester 1
  2. CAP470
  3. Unit 4

CAP470 · Unit 4: Containers

Docker, container orchestration, advantages and security

10 practice questions · in the MTE and ETE syllabus

Key points

  • Docker builds and runs containers
  • Kubernetes orchestrates containers across a cluster
  • A pod is the smallest Kubernetes unit
  • Scan images and use least privilege for security

Docker is a platform for building and running containers: a Dockerfile builds an image, images are stored in a registry, and the Docker engine runs containers from them.

Container orchestration automates deploying, scaling, networking and healing many containers across a cluster. Kubernetes is the leading orchestrator; Docker Swarm is another.

Kubernetes terms: a node is a worker machine, a pod is the smallest deployable unit holding one or more containers, a Deployment keeps the desired number of replicas, and a Service gives a stable address to a changing set of pods. Abilities include self-healing (replacing failed containers) and horizontal scaling (adding replicas as load grows).

Security: containers share the host kernel, so a kernel flaw can threaten all of them. Good practice: scan images for vulnerabilities, use trusted registries, run with least privilege (not as root), limit resources, keep logs and patch hosts.

Exam trap: Docker builds and runs containers, Kubernetes orchestrates them; they are not the same tool.

Try two questions

Question 1 · Tier 2, Understand

What does container orchestration automate?

  1. Designing user interface screens for the application
  2. Deploying and scaling containers
  3. Writing the source code of the application itself
  4. Printing documents on a shared office printer
Show the answer

B. Orchestrators schedule containers, restart failed ones and scale them with demand.

Why not A: Orchestration does not design interfaces.

Why not C: Orchestration does not write code.

Why not D: Orchestration does not control printing.

Question 2 · Tier 2, Understand

In Kubernetes, what is a pod?

  1. The smallest unit holding containers
  2. A physical server in the cluster
  3. A network cable between two nodes
  4. A text file that stores configuration only
Show the answer

A. A pod groups one or more containers that share network and storage.

Why not B: A physical server is a node.

Why not C: A cable is hardware, not a pod.

Why not D: A configuration file is not a pod.