Core Concepts & Build Flashcards

(28 cards)

1
Q

What is the smallest deployable unit in Kubernetes?

A

A Pod.

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

Name the 3 multi-container pod patterns.

A

Sidecar / Adapter / Ambassador.

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

What is an Init Container?

A

A container that runs to completion before the main application container starts.

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

What is a Job in K8s?

A

A resource that creates one or more Pods and ensures a specified number of them successfully terminate.

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

What is a CronJob?

A

A Job that runs on a recurring schedule (like a Linux crontab).

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

How do you create a pod named ‘nginx’ using kubectl imperatively?

A

kubectl run nginx –image=nginx

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

How do you generate a YAML file for a pod without creating it?

A

Add the flags ‘–dry-run=client -o yaml’ to the command.

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

How do you override the ‘ENTRYPOINT’ of a Docker image in a K8s Pod spec?

A

Use the ‘command’ field in the container spec.

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

How do you override the ‘CMD’ of a Docker image in a K8s Pod spec?

A

Use the ‘args’ field in the container spec.

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

If an Init Container fails to start and the restartPolicy is ‘Always’; what happens?

A

The Pod restarts repeatedly until the Init Container succeeds.

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

How can two containers in the same Pod communicate via localhost?

A

By sharing the same network namespace (standard Pod behavior).

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

What is the effect of setting ‘terminationGracePeriodSeconds’ to 0?

A

The Pod is killed immediately (SIGKILL) without waiting for a graceful shutdown (SIGTERM).

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

How do you share a specific directory between a sidecar and a main container?

A

Create an ‘emptyDir’ volume and mount it in both containers at the desired paths.

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

How do you identify if a running pod is a ‘Static Pod’ just by looking at its name?

A

It will usually have the node name appended to the end (e.g., kube-apiserver-control-plane).

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

If you delete a Static Pod using kubectl, what happens?

A

The Kubelet will automatically restart it because its manifest still exists in the static pod directory.

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

Which component is responsible for watching the static pod directory and managing those pods?

17
Q

What is the ‘Mirror Pod’?

A

A dummy pod created by the Kubelet on the API server so that static pods are visible via kubectl.

18
Q

What is a Static Pod in Kubernetes?

A

A pod managed directly by the kubelet on a specific node via local files, bypassing the API server.

19
Q

What is a Dynamic Pod in Kubernetes?

A

A pod managed by the control plane (API server) and scheduled across the cluster by controllers like Deployments.

20
Q

What is the kube-apiserver?

A

The central management hub and front end for the Kubernetes control plane that exposes the Kubernetes API.

21
Q

What is the etcd?

A

A consistent and highly-available key-value store used as Kubernetes’ backing store for all cluster data.

22
Q

What is the kube-scheduler?

A

The control plane component that assigns Pods to Nodes based on resource requirements and policy constraints.

23
Q

What is the kube-controller-manager?

A

A daemon that embeds the core control loops (like Node or Job controllers) to regulate the state of the cluster.

24
Q

What is the kubelet?

A

The node agent that ensures containers are running in a Pod by following instructions (PodSpecs) from the control plane.

25
What is the kube-proxy?
A network proxy running on each node that maintains network rules, allowing communication to Pods from inside or outside the cluster.
26
What is the Container Runtime?
The software (like containerd or CRI-O) responsible for actually running the containers.
27
What is a Node?
A worker machine (VM or physical) that contains the services necessary to run Pods and is managed by the control plane.
28
Why use Static Pods?
Static Pods are primarily used for bootstrapping a cluster. If you used kubeadm to set up your cluster, your core components—like the kube-apiserver, kube-controller-manager, and etcd—are actually running as Static Pods.