Cloud and Container Basics

Learn with multiple-choice questions about the namespaces and cgroups behind containers, images, layers and copy-on-write, Dockerfile instructions (RUN, CMD, ENTRYPOINT, COPY), the build cache and instruction order, publishing ports, volumes and bind mounts, tags and digests, multi-stage builds, Kubernetes Pods, Deployments, Services, Ingress and Secrets, reconciliation and rolling updates, readiness and liveness probes, autoscaling calculations, requests and limits, the shared responsibility model, availability zones, serverless computing, storage types, the break-even point between pay-as-you-go and reservations, data transfer charges, IaC, immutable infrastructure, blue-green and canary releases, and observability.

Practice 10 questionsRandom questions from this topic · about 5 minutes Practice this topicAll questions in this topic, in random order Weak questionsRetry only the questions you last got wrong

Cloud and Container Basics: key points

Many web services and corporate systems now run in the cloud as applications packaged in containers. A container isolates processes while sharing the host OS kernel; images are built with Docker, and platforms such as Kubernetes place containers on many machines, keep their number and update them.

This topic starts with namespaces and cgroups, image layers and copy-on-write, Dockerfile instructions and the build cache, publishing ports, volumes and bind mounts, tags and digests, and multi-stage builds, and then deals with Kubernetes Pods, Deployments, Services, Ingress and Secrets, declaring a desired state and reconciliation, rolling update calculations, readiness and liveness probes, HorizontalPodAutoscaler calculations, and requests, limits and Pod placement. It goes on to check the shared responsibility model of the cloud, regions and availability zones, serverless computing and cold starts, block, file and object storage, pay-as-you-go charges and the break-even point of reservations, data transfer charges, IaC and immutable infrastructure, blue-green deployment and canary releases, building artifacts only once, configuration through environment variables, and observability. The values in the calculation questions, including those of the wrong choices, have been checked by computing them in Python. All prices are made-up values. The differences between hypervisors, containers and virtual machines are covered in "OS & Hardware"; IaaS, PaaS and SaaS, scale-out, redundancy, live migration and CDNs in "System Architecture and Reliability"; load balancers and sessions in "Web Technology Basics"; CI/CD in "Software Development and Project Management"; SLAs in "IT Service Management and Systems Audit"; and the shell and environment variables in "Linux and Command-Line Basics".

All Cloud and Container Basics questions (40)

  1. Among the Linux kernel features that make containers possible, which of the following correctly pairs namespaces and cgroups (control groups) with their roles?
  2. On a Linux host, Docker is used to start a container from an image based on a different distribution from the host, and uname -r (which shows the kernel release) and cat /etc/os-release (which shows information about the distribution) are run inside it. Which of the following correctly describes the results?
  3. Which of the following correctly describes the relationship between a container image and a container?
  4. Inside a container started from an image, the configuration file /etc/app.conf, which is part of the image, is modified. Which of the following correctly describes what happens with Docker's usual storage mechanism (such as overlay2)?
  5. To unpack a 500 MB archive, data.tar.gz, an image was built with the Dockerfile above. Although the archive was deleted in the same RUN after unpacking, the image remained larger by the size of the archive. Which of the following is the most appropriate pair of reason and remedy?
  6. There are five images, each of which stacks its own 30 MB layer on the same base image (120 MB). Layer compression and the size of metadata are ignored. Which of the following is the disk space used by the images when all five are pulled to one server?
  7. For the Dockerfile above, which of the following correctly pairs the command executed when the image is built with docker build and the command executed when a container is started with docker run?
  8. An image named pinger, built from the Dockerfile above, is started with docker run pinger example.com. Which of the following is the command executed in the container?
  9. A container is started with the command above from the image nginx, a web server that listens on port 80. The host's IP address is 192.0.2.10, and there are no restrictions such as a firewall. Which of the following is the URL to use to reach this web server from a browser on another PC on the same network?
  10. Dockerfile (B) above was made from Dockerfile (A), which had RUN npm ci after COPY . ., by changing the order so that only the dependency files are copied first. npm ci takes 120 seconds, npm run build 30 seconds and COPY . . 2 seconds, and the time of the other instructions is negligible. The image is rebuilt 20 times a day after changing only the source code under src (package.json and package-lock.json are unchanged). When the cache from the previous build can be used, which of the following is how much shorter B is than A in total build time per day?
  11. In Docker, which of the following correctly describes named volumes and bind mounts, used to keep data written by a container?
  12. An image is pulled by specifying registry.example.com/team/web:1.4. Which of the following correctly gives the meaning of each part of this reference?
  13. scratch is an empty image that contains no files. Which of the following correctly describes what the final image built with the multi-stage Dockerfile above contains?
  14. In Kubernetes, which of the following is the smallest unit that is deployed and managed, grouping one or more containers that share the same IP address and volumes?
  15. In Kubernetes, a Deployment with replicas: 3 is running three Pods. Which of the following correctly describes what happens when one of these Pods is deleted with kubectl delete pod?
  16. In a Kubernetes Deployment, the container image in the Pod template is changed to a new version. Which of the following correctly describes what happens with the default update strategy (RollingUpdate)?
  17. A Deployment with replicas: 10 has the rolling update settings maxSurge: 25% and maxUnavailable: 25%. Which of the following correctly gives the upper limit of the total number of Pods and the lower limit of the number of available Pods during an update?
  18. In Kubernetes, a Pod gets a different IP address every time it is recreated. Which of the following resources lets other applications connect, through a name and address that do not change, to several Pods selected by labels, with the load spread across them?
  19. In a Kubernetes cluster, HTTPS requests arriving for one host name should be routed to the api Service if the path begins with /api, and to the web Service otherwise. Which of the following resources is suitable for defining this routing rule?
  20. A database password is stored in a Kubernetes Secret. Which of the following correctly describes a Secret?
  21. A web application cannot handle requests for about 60 seconds after starting, while it loads its cache, and returns 503 from /ready during that time. Which of the following correctly describes the effect of adding the settings above to the Pod's container?
  22. In a web application on Kubernetes, the check performed by the liveness probe was made to include whether the application can connect to the database it depends on. Which of the following is the most likely problem with this setting?
  23. A Kubernetes HorizontalPodAutoscaler has a target CPU utilization of 70% and a range of 1 to 10 Pods. Currently the average CPU utilization of 5 Pods is 30%. When the required number of Pods is computed as ⌈current number × current utilization ÷ target utilization⌉ (⌈ ⌉ means rounding up), which of the following is the required number of Pods?
  24. In a Deployment whose Pod containers have the settings above, four Pods are running, each using 400m (0.4 cores) of CPU. The HorizontalPodAutoscaler's target CPU utilization is 60%, and the required number of Pods is computed as ⌈current number × current utilization ÷ target utilization⌉. Which of the following is the required number of Pods?
  25. In Kubernetes, which of the following correctly describes the resource requests and limits set for a container?
  26. A node has allocatable resources of 4 CPU cores and 8 GiB of memory. Each Pod's container has requests of 500m CPU and 1.5 GiB memory and limits of 1 CPU core and 2 GiB memory. There are no other Pods and no system reservations. Which of the following is the maximum number of Pods that can be placed on this node?
  27. A managed database service in the cloud (one in which the provider operates the database software) is used. Under the shared responsibility model, which of the following generally remains the user's responsibility?
  28. In the cloud, which of the following is the main purpose of placing web servers and database replicas across several availability zones within the same region?
  29. With serverless functions (FaaS), only the first call to a function that has not been called for a while sometimes responds hundreds of milliseconds to several seconds slower. Which of the following correctly explains this phenomenon?
  30. Cloud storage is used for three purposes: (1) attaching it to a virtual machine as a disk, creating a file system and storing database data files; (2) mounting it from several servers at the same time and using it as a shared directory; (3) reading and writing a large number of images by key (name) through an HTTP API and growing the capacity without deciding it in advance. Which of the following is the appropriate combination of storage types for (1) to (3)?
  31. Virtual machines that are charged only for the time used, at ¥40 per hour (a made-up price), are used. Normally 2 machines run throughout the month (30 days), and on 20 weekdays 4 more are added for 6 hours a day to match the load. Which of the following is the charge for the month?
  32. A virtual machine costs ¥50 per hour on demand, paying only for the hours used, or ¥262,800 per year with a reservation that commits to a year of use in advance, regardless of the hours used (both made-up prices). With a year taken as 8,760 hours, the reservation becomes cheaper once the hours used in a year exceed a certain number. Which of the following is that number of hours?
  33. Which of the following generally applies to how many public clouds charge for data transfer?
  34. An environment was created by applying, with a declarative IaC (Infrastructure as Code) tool, a file that defines a network and two virtual machines. Immediately afterwards, the same file is applied again without any changes. Which of the following is what happens?
  35. Which of the following is an appropriate way to update the software on production servers in line with the idea of immutable infrastructure?
  36. Two environments with the same configuration as production are prepared; the current version keeps running in one while the new version is installed and checked in the other, and then the load balancer is switched over to it all at once. If there is a problem, switching back quickly returns to the old version. Which of the following is this release method?
  37. A service that receives 12,000 requests per hour performs a canary release of a new version, sending only 5% of the requests to it. The new version has a bug that makes 3% of the requests it receives fail; it is noticed after one hour, and all requests are returned to the old version. Which of the following is the number of requests that failed because of the bug during that hour?
  38. A container image built by a CI/CD pipeline was tested in the staging environment and passed. Which of the following is the most appropriate way to release this image to production?
  39. As shown above, the database connection target is not written into the image but passed as an environment variable when the container starts. Which of the following is the most appropriate main advantage of this design?
  40. In a system in which several services work together, you want to find out which services a single user request passed through, in what order, and how much time it spent in each. Among the data used for observability, which of the following is the most suitable?

Books on Cloud and Container Basics Ad

As an Amazon Associate I earn from qualifying purchases.

Other topics in Computer systems