Kubernetes Flashcards

1
Q

What is Kubernetes?

A

an open-source container orchestration platform. It was developed by Google and was donated to the Cloud Native Computing Foundation (CNCF) in 2015

It doesn’t create containers directly. It creates Pods that hold containers inside them. The containers in a pod share any configured resources, like Volume storage

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

How does Kubernetes relate to Docker?

A

Docker is a container runtime, which is a software that runs containerized applications. When Kubernetes schedules a pod to a node, the kubelet running on that node instructs Docker to launch the containers.

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

What is container orchestration?

A

Container orchestration is the automation of components and processes related to running containers. It includes things like configuring and scheduling containers, the availability of containers, allocation of resources between containers, and securing the interaction between containers, among other things.

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

What do you know about Kubernetes clusters?

A

A Kubernetes cluster is a set of nodes that containerized applications run on. These nodes can be physical machines or virtual machines.

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

What is kubectl?

A

Kubectl is the command-line configuration tool for Kubernetes that communicates with a Kubernetes API server. Using kubectl allows you to create, inspect, update, and delete Kubernetes objects

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

What is a pod?

A

A pod is the most basic Kubernetes object. A pod consists of a group of containers running in your cluster. Most commonly, a pod runs a single primary container.

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

Can you explain the different components of Kubernetes architecture?

A

Kubernetes is composed of two layers: a control plane and a data plane.

Control plane: the container orchestration layer that includes 1. Kubernetes objects that control the cluster, and 2. the data about the cluster’s state and configuration.

The data plane is the layer that processes the data requests and is managed by the control plane.

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

What is the difference between a daemonset, a deployment, and a replication controller?

A

A daemonset ensures that all nodes you select are running exactly one copy of a pod.

A deployment is a resource object in Kubernetes that provides declarative updates to applications. It manages the scheduling and lifecycle of pods. It provides several key features for managing pods, including pod health checks, rolling updates of pods, the ability to roll back, and the ability to easily scale pods horizontally.

The replication controller specifies how many exact copies of a pod should be running in a cluster. It differs from a deployment in that it does not offer pod health checks, and the rolling update process is not as robust.

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

Do all of the nodes have to be the same size in your cluster?

A

No, they don’t. The Kubernetes components, like kubelet, will take up resources on your nodes, and you’ll still need more capacity for the node to do any work. In a larger cluster, it often makes sense to create a mix of different instance sizes. That way, pods that require a lot of memory with intensive compute workloads can be scheduled by Kubernetes on large nodes, and smaller nodes can handle smaller pods.

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

What is a sidecar container, and what would you use it for?

A

A sidecar container is a utility container that is used to extend support for a main container in a Pod. Sidecar containers can be paired with one or more main containers, and they enhance the functionality of those main containers.

An example would be using a sidecar container specifically to process system logs or for monitoring.

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

How do logs work for pods?

A

With a traditional server setup, application logs are written to a file and then viewed either on each server or collected by a logging agent and sent to a centralized location. In Kubernetes, however, writing logs to disk from a pod is discouraged since you would then have to manage log files for pods. The better way is to have your application output logs to stdout and stderr. The kubelet on each node collects stdout and stderr on the running pods and then combines them into a log file managed by Kubernetes. Then you can use different kubectl commands to view the logs.

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

How can you separate resources?

A

You can separate resources by using namespaces. These can be created either using kubectl or applying a YAML file. After you have created the namespace you can then place resources, or create new resources, within that namespace. Some people think of namespaces in Kubernetes like a virtual cluster in your actual Kubernetes cluster.

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

What are the 6 layers of K8s concepts?

A
  1. Deployment(s create and manage replicasets)
  2. ReplicaSet (create and manage pods)
  3. Pod(s run on nodes)
  4. Node cluster
  5. Node processes (nodes have a container runtime, & container runtime runs the app code you put in your docker image)
  6. Docker container (contains your application code)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

2 types of components for Node Processes

A

Master components:

  • API server
  • etcd
  • Scheduler
  • kube-controller-manager
  • cloud-controller-manager

Worker node components:

  • kubelet
  • kube-proxy
  • Container Runtime
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

(Node processes)

Master Components

A

API server — “Hub”
exposes the k8s API. It’s the frontend for k8s control.

etcd — “Cluster info”
Distributed key-value store for Cluster state data.

Scheduler — “Matcher”
Selects the Nodes for new Pods.

kube-controller-manager — “Cluster controller”
Process that runs controllers to handle Cluster background tasks.

cloud-controller-manager — “cloud interface”
Runs controllers that interact with cloud providers.

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

(Node processes)

Worker Node Components

A

kubelet — ‘brain’
Responsible for everything on the Worker Node. It communicates with the Master’s API server.

kube-proxy — ‘traffic cop’
Routes connections to the correct Pods. Also performs load balancing across Pods for a Service.

Container Runtime — ‘Docker’
Downloads images and runs containers. Docker is an example of this.