- LPU MCA Semester 1
- CAP470
- 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
What does container orchestration automate?
- Designing user interface screens for the application
- Deploying and scaling containers
- Writing the source code of the application itself
- 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.
In Kubernetes, what is a pod?
- The smallest unit holding containers
- A physical server in the cluster
- A network cable between two nodes
- 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.