Kubernetes Quiz 2 Answers

This is a quiz about containers, Docker, and Kubernetes — but mostly about Kubernetes. You can test yourself before a job interview. You may also want to see this list of Kubernetes books.


1. To set a maximum number of failures threshold, which of the following key words would you use (for a kubernetes application to try a pod)?

a. backofflimit
b. maxnumretries
c. retriesmax
d. numoffailures
e. numfailures

Answer: A. backofflimit

2. Do custom controllers run inside or outside of the control plane?

a. Inside
b. Outside
c. Potentially either A or B
d. None of the above or unknown.

Answer: D. It is not clear. For Operators, the custom controllers would normally be outside of the control plane.

This quote shows that custom controllers run outside the control plane:

Kubernetes comes with a set of built-in controllers that run inside the kube-controller-manager.
...

You can find controllers that run outside the control plane, to extend Kubernetes. Or, if you want, you can write a new controller yourself. You can run your own controller as a set of Pods, or externally to Kubernetes. What fits best will depend on what that particular controller does.

https://kubernetes.io/docs/concepts/architecture/controller/

This picture also shows that custom controllers run outside the control plane.

The Controller will normally run outside of the control plane…

https://kubernetes.io/docs/concepts/extend-kubernetes/operator/

Kubernetes' out-of-the-box controllers are located in the control plane. However, it’s not allowed to deploy one’s own custom controllers there.

https://blog.frankel.ch/your-own-kubernetes-controller/1/

3. How do you view the API resources you have access to?

a. Use online documentation.
b. Run this command: kubectl api-resources
c. Run this command: kubectl config view
d. Run this command: kubeadm list apis
e. None of the above.

Answer: B. Source: The results of this command explain more: kubectl api-resources -h
You can also view https://stackoverflow.com/a/55358685

4. Which of the following is true?

a. A properly configured headless service always has a selector.
b. A properly configured headless service never has a selector.
c. A properly configured headless service can have a selector but does not need to.
d. There is no such thing as a properly configured headless service in Kubernetes.

Answer: C. Source: https://kubernetes.io/docs/concepts/services-networking/service/#headless-services

5. What is the way of determining how to connect to a service called? Choose the best answer.

a. Service discovery
b. Path determination
c. Route determination
d. kube-proxy routing
e. Label selecting
f. Protocol selecting

Answer: A

Service discovery is the actual process of figuring out how to connect to a service.

https://platform9.com/blog/kubernetes-service-discovery-principles-in-practice/

6. In Kubernetes, what is a Headless service?
_______________________________________________

Answer:

Simply put, a Headless service is the same as default ClusterIP service, but lacks load balancing or proxying. Allowing you to connect to a Pod directly.

https://stackoverflow.com/questions/52707840/what-is-a-headless-service-what-does-it-do-accomplish-and-what-are-some-legiti

7. What container is essential to Heroku?

a. rkt
b. Podman
c. LXC
d. Dyno
e. None of the above

Answer: D.

Dynos: the heart of the Heroku platform

https://www.heroku.com/dynos

8. A StatefulSet YAML file is a Deployment YAML file with a PVC.

True
False

Answer: False.

Deployments and ReplicationControllers are meant for stateless usage and are rather lightweight. StatefulSets are used when state has to be persisted.

https://stackoverflow.com/a/41707491

9. You can limit the CPU and RAM of a "kind: Job" the same way you do with a "kind: Deployment" or a "kind: Pod"

True
False

Answer: True.

Here are some examples:
https://docs.prefect.io/orchestration/execution/k8s_job_environment.html#examples

https://toil.readthedocs.io/en/latest/running/cloud/kubernetes.html#option-1-running-the-leader-inside-kubernetes

https://stackoverflow.com/questions/57697294/does-a-completed-kubernetes-pod-still-reserves-the-required-resources/57697957

10. What is an Alpine image?

a. The most commonly used image in Docker or Kubernetes.
b. An image for Kubernetes pods to listen and perform networking functions.
c. A stripped-down Docker image based on Ubuntu Linux
d. A stripped-down Docker image based on Alpine Linux
e. A stripped-down Docker image based on Red Hat Linux
f. None of the above.

Answer: E. The source says it is "[a] minimal Docker image based on Alpine Linux…" (taken from https://hub.docker.com/_/alpine).

11. Roles in Kubernetes are

a. A type of resource
b. Capable of governing what actions can be taken on Kubernetes resources
c. A and B
d. None of the above

Answer: C. Source: Page 358 of Kubernetes in Action.

12. What should be plural in Kubernetes YAML files? Choose the best answer.

a. endpoints even when there is only one
b. resources even when there is only one
c. kind even when there is only one
d. All of the above
e. A and B
f. None of the above.

Answer: E.
The source of A is Kubernetes.io. The source of B is page 358 of Kubernetes in Action.

13. What is a job in Kubernetes? Choose the best answer.

a. An action that the scheduler assigns.
b. A resource for a discrete task.
c. A component of a Kubernetes operator.
d. The activity that utilizes a pod's computational resources (such as consuming CPU or RAM).
e. None of the above.

Answer: B. Source is page 112 of Kubernetes in Action.

14. In Kubernetes a service does what? Choose the best answer.

a. Exposes a Pod as a TCP socket.
b. The Control Plane component that allocates pods.
c. A component of the controller manager.
d. Utilizes a pod to perform non-completable tasks such as listening -- no networking is involved.
e. None of the above.

Answer: A. Source: Inside cover of Kubernetes in Action.

See also the following:
A Kubernetes service can be described as "[a]n abstract way to expose an application running on a set of Pods as a network service." (This was taken from https://kubernetes.io/docs/concepts/services-networking/service/.) In computing, to abstract can mean to hide an implementation behind a facade (per page 21 of Designing Data-Intensive Applications by Kleppman).

A Kubernetes service can be described as "…a logical abstraction for a deployed group of pods in a cluster." (This was taken from VMware's website.)

Kubernetes services include ClusterIP, NodePort, LoadBalancer, ExtneralName (taken from VMware's website).

Leave a comment

Your email address will not be published. Required fields are marked *