Final Exam: Introduction to Kubernetes Flashcards

1
Q

____ within a pod share an IP address and port space, and can find each other via localhost.

A

Containers

Explanation
Containers within a pod share an IP address and port space, and can find each other via the localhost. They can also communicate with each other using standard inter-process communications like SystemV semaphores or POSIX shared memory. Containers in different pods have distinct IP addresses and cannot communicate by IPC.

https://kubernetes.io/docs/user-guide/pods/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

To update a service without an outage, kubectl supports what is called ____.

A

rolling update

Explanation
To update a service without an outage, kubectl supports what is called ‘rolling update’, which updates one pod at a time, rather than taking down the entire service at the same time. Note that kubectl rolling-update only supports Replication Controllers.
https://kubernetes.io/docs/tasks/run-application/rolling-update-replication-controller/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which are the two primary modes of finding a Service with Kubernetes?

A

Environment variables and DNS

Explanation
Kubernetes supports two primary modes of finding a Service: environment variables and DNS. The Kubernetes DNS server is the only way to access services of type ExternalName.

https://kubernetes.io/docs/user-guide/services/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

A Kubernetes ____ is an abstraction that defines a logical set of Pods and a policy by which to access them.

A

Service

Explanation
A Kubernetes Service is an abstraction that defines a logical set of Pods and a policy by which to access them - sometimes called a micro-service. The set of Pods targeted by a Service is (usually) determined by a Label Selector (see below for why you might want a Service without a selector).

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Service accounts are tied to a set of credentials stored as ____, which are mounted into pods allowing in cluster processes to talk to the Kubernetes API.

A

Secrets

Explanation
Service accounts are users managed by the Kubernetes API and are bound to specific namespaces. The accounts are created automatically by the API server or manually through API calls, and tied to a set of credentials stored as Secrets. These Secrets are then mounted into pods allowing in cluster processes to talk to the Kubernetes API.

https://kubernetes.io/docs/admin/authentication/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

A ____ is a higher-level controller that automates rolling updates of applications declaratively.

A

Deployment

Explanation
If you deploy applications with Replication Controllers, you should consider switching them to Deployments. A Deployment is a higher-level controller that automates rolling updates of applications declaratively, and therefore is recommended.

https://kubernetes.io/docs/tasks/run-application/rolling-update-replication-controller/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

In Kubernetes, a(n) ____ is a group of one or more containers (such as Docker containers), the shared storage for those containers, and options about how to run the containers.

A

pod

Explanation
A pod (as in a pod of whales or pea pod) is a group of one or more containers (such as Docker containers), the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context. A pod models an application-specific “logical host” - it contains one or more application containers which are relatively tightly coupled — in a pre-container world, they would have executed on the same physical or virtual machine.
https://kubernetes.io/docs/user-guide/pods/
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which Kubernetes feature would you use to guard against split brain scenarios with your distributed applications

A

StatefulSet

Explanation
StatefulSets guarantee at most one Pod for a given ordinal index can be running anywhere in a cluster, to guard against split brain scenarios with distributed applications.

https://kubernetes.io/docs/tasks/run-application/upgrade-pet-set-to-stateful-set/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Every namespace has a default service account resource called ____.

A

default

Explanation
Every namespace has a default service account resource called default. You can list this and any other serviceAccount resources in the namespace with this command:

$ kubectl get serviceAccounts
NAME SECRETS
default 1
https://kubernetes.io/docs/user-guide/service-accounts/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

In Kubernetes, a(n) ____ is a key/value pair, intended to be used to specify identifying attributes of objects that are meaningful and relevant to users, but which do not directly imply semantics to the core system.

A

label

Explanation
Labels are key/value pairs that are attached to objects, such as pods. Labels are intended to be used to specify identifying attributes of objects that are meaningful and relevant to users, but which do not directly imply semantics to the core system. Labels can be used to organize and to select subsets of objects. Labels can be attached to objects at creation time and subsequently added and modified at any time. Each object can have a set of key/value labels defined. Each Key must be unique for a given object.
https://kubernetes.io/docs/user-guide/labels/
https://cloudacademy.com/course/administering-kubernetes-clusters/administering-kubernetes-scheduling/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Kops uses ____ for discovery, both inside the cluster and so that you can reach the Kubernetes API server from clients.

A

DNS

Explanation
Kops uses DNS for discovery, both inside the cluster and so that you can reach the Kubernetes API server from clients. Kops has a strong opinion on the cluster name: it should be a valid DNS name. By doing so you will no longer get your clusters confused, you can share clusters with your colleagues unambiguously, and you can reach them without relying on remembering an IP address.

https://kubernetes.io/docs/getting-started-guides/kops/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

____ provide load balancing across a set of pods.

A

Services

Explanation
Services provide load balancing across a set of pods. For every Service object, the apiserver makes an endpoints resource available. You can view this resource with:
$ kubectl get endpoints ${SERVICE_NAME}

https: //kubernetes.io/docs/tasks/debug-application-cluster/debug-application/
https: //cloudacademy.com/course/introduction-to-kubernetes/multi-container-pods/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How can you speed up local experiments run with minikube?

A

Reuse minikube’s built-in Docker daemon

Explanation
When using a single VM of Kubernetes, it’s really handy to reuse the minikube’s built-in Docker daemon; as this means you don’t have to build a docker registry on your host machine and push the image into it - you can just build inside the same docker daemon as minikube which speeds up local experiments.

https://kubernetes.io/docs/getting-started-guides/minikube/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a probe within Kubernetes?

A

A diagnostic performed periodically by the kubelet on a container

Explanation
A Probe is a diagnostic performed periodically by the kubelet on a container. Specifically the diagnostic is one of three Handlers:
ExecAction: executes a specified command inside the container expecting on success that the command exits with status code 0.
TCPSocketAction: performs a tcp check against the container’s IP address on a specified port expecting on success that the port is open.
HTTPGetAction: performs an HTTP Get against the container’s IP address on a specified port and path expecting on success that the response has a status code greater than or equal to 200 and less than 400.
https://kubernetes.io/docs/user-guide/pod-states/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is one scenario in which the use of pods would be recommended?

A. To host vertically integrated stateful applications
B. To support co-located, co-managed helper programs
C. To run multiple instances of the same application
D. To provide independent storage volumes across platforms

A

To support co-located, co-managed helper programs

Explanation
Pods can be used to host vertically integrated application stacks (e.g., LAMP), but their primary motivation is to support co-located, co-managed helper programs, such as:

content management systems, file and data loaders, local cache managers, etc.
log and checkpoint backup, compression, rotation, snapshotting, etc.
data change watchers, log tailers, logging and monitoring adapters, event publishers, etc.
proxies, bridges, and adapters
controllers, managers, configurators, and updaters
Individual pods are not intended to run multiple instances of the same application, in general.

https://kubernetes.io/docs/user-guide/pods/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly