Architecture Flashcards

1
Q

What is cluster store?

A

If the apiserver is the brain of the master, that’s the memory of it. The config and the state of the cluster is persistently stored here. It uses etcd as Cluster Store

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

What is etcd?

A

etcd is a distributed key value store that provides a reliable way to store data across a cluster of machines.. KV store is a noSQL database. It’s distributed, consistent and watchable.

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

What is kube-scheduler?

A

This watches api-server for new pods and assigns work to nodes. It has to think about a lot of things like affiity/anti-affinity, constraints, resources etc.

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

What are nodes?

A

A.k.a. Minions. They are K8s workers. There are basically 3 components that we care about; kubelet, container runtime and the kube proxy.

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

What is Kubelet?

A

It is the main Kubernetes agent on Node and referred as Node. Registeres node with cluster. Watches the apiserver on master for work assignments. Any time it sees one, it carries out the task and reports back to master. Instantiates pods????? If the pod fails for some reason, it reports back to master and it does not try to restart it or find another node to run it. It’s masters responsibility to make decision at that point. It exposes and endpoint at localhost on port 10255 (it lets you inspect the spec of the Kubelet). /spec end point gives some info, /healthz for health check and /pods for running pods and much more.

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

What does Container Engine do?

A

It does container management like pulling images, starting/stopping containers, etc. It’s usually docker but its pluggable and can be rkt if one wants.

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

What is kube-proxy?

A

It’s networking brain of the node. It makes sure that every pod gets it unique id and all containers in a pod shares a single IP. It also makes load balancing. Load balances across all pods in a service. A service is a way to hide multiple nodes behind a single network address.

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

What is the model that K8s operates on?

A

It’s a declarative model. We give it a YAML or JSON manifest file where we describe how the app should look like. We do not give the commands needed for that. We just tell how we want it to look like. It’s up to K8s how to get there.

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

What happens when desired state and actual state diverges?

A

It should bring desired state back. It runs a lot of reconciliation loops that constantly checks the actual state matches the desired state.

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

What is a pod?

A

The atomic units of scheduling in VMs is the VM, Container in docker world and Pod in K8s. Containers always run inside of pods. Pods can have multiple containers.

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

What does a pod do and have?

A

It is a ring-fenced environment that runs containers. It has a network stack and kernel namespaces. It is also the unit of scaling.

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

How is the env arranged if more than one container are run inside a pod?

A

All containers in pod share the same environment. e.g. they have the same IP. If they want to talk each other there is localhost interface in there.

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

When should one use more than one container inside one pod?

A

If there are tightly coupled applications (e.g. 2 apps sharing the same DB, or a logging application(sidecar container) for a web server(main container)) we can put them together. But for loosely coupled apps no need for that. Also for scaling we should add more pods not more containers inside a pod.

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

How is the lifecycle of a pod?

A

They have 3 phases: pending, running, succeeded/failed. Once they die they can not be restarted back.

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

How do we deploy pods?

A

They are usually part of a bigger system but we can also deploy them alone by giving apiserver a manifest file. apiserver reads the file and deploys it to a suitable Node. They are usually deployed via higher level objects like Replication Controller.

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

Can we rely on pod IPs?

A

No. Each time a pod dies and a new one is created, it gets a new IP.

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

What are services?

A

Service is a Kubernetest obect just as Pod and Node. We define it inside yml file. E.g. we can set up an IP server between FE and db nodes to fix IP address and DNS. It can load balance requests among different pods.

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

How are services and pods tied?

A

The way that a pod belongs to a service is via labels. These labels tie services and pods. So if we give same labels that we give to normal pods to an irrelevant one, it will be load balanced through service as well. Also you can upgrade to a new version or return back to an older version by just changing labels on service.

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

What are basic properties of services?

A
  • They only send requests to healthy pods
  • They can be configured for session affinity
  • They can point to things outside cluster
  • They make random load balancing
  • They use TCP by default
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What can be said about Services?

A

Deployments are all about declaretiveness. You do not say K8s how to do but rather tell what you want. They are self documenting, spec-once deploy-many, versioned, simple rolling updates and rollbacks. They are defined via YAML or JSON manifests and deployed via apiserver. As replication controllers add features around, these do the same.

21
Q

Can multiple versions be run with deployments?

A

We can run multiple concurrent versions at the same time either in blue-green deployments or in canary releases.

22
Q

What is Minikube?

A

It’s all about spanning your local environment on your laptop.

23
Q

What are some types of installations for Kubernetes?

A

Minikube, Google Container Engine(GKE), AWS Provider, Manual Install

24
Q

What are the 3 main components of Master Node?

A

Scheduler, Controller and api-server.

25
Q

What is the only way of communicating with K8 Master?

A

api-server

26
Q

Whats the role of controller-manager in master node?

A

It run non-terminating loops which regulate the state of the Kubernete cluster.

27
Q

what does etcd store?

A

State of the cluster.

28
Q

What is the scheduling unit in Kubernetes?

A

Pod

29
Q

What is a pod?

A

Logical unit of one or more containers which are scheduled together.

30
Q

Give 3 examples of container runtimes?

A

Containerd, rkt, lxd.

31
Q

what is a kubelet?

A

An agent which runs on worker node and talks to Master node.

32
Q

What are the two services implemented by Container Runtime Interface (CRI)?

A

ImageService and RuntimeService.

33
Q

What container runtimes are supported by Kubernetes

A

Any runtime with implements the Container Runtime Interface.

34
Q

What is Kube-proxy?

A

Network Proxy which runs on each worker node and listens to API server for Service endpoint creation/deletion. For each service endpoint, kube-proxy also setsup routes to reach it.

35
Q

In a cluster, a unique ip is assigned to….

A

each pod.

36
Q

What are the two specifications for container networking?

A

Container Network Model (CNM, by docker)

Container Network Interface (CNI, by CoreOS)

37
Q

What Container networking spec does K8S use?

A

Container Network Interface (CNI)

38
Q

Name 3 admin tools to install and configure Kubernetes

A

Kubespray, kops,kubeadm

39
Q

‘kubectl proxy’ - what does it do?

A

makes api’s available on 127.0.0.1:8001

40
Q

Give 4 examples of Kubernetes Objects

A

Pods, ReplicaSets, Deployments, Namespaces.

41
Q

In a deployment object, what do spec and spec.template.spec describe?

A

spec describes the desired state of the deployment (we need 3 pods running) and spec.template.spec describes the desired state of the pod.

42
Q

All containers in a pod mount the same external storage. True/False?

A

True

43
Q

What are labels?

A

They are key-value pairs that can be attached to any Kubernetes object.

44
Q

Replication Controller is a part of master nodes….

A

controller manager

45
Q

Pods can self-heal themselves

A

No. They are ephemeral. That is why we manage them with Replication Controllers etc.

46
Q

What is the difference between replication controller and replicaSet?

A

ReplicaSet is next generation ReplicationController. ReplicaSets support both equality- and set-based selectors, whereas ReplicationControllers only support equality-based Selectors. Currently, this is the only difference.

47
Q

What are Deployments?

A

Deployments provide declarative updates to Pods and ReplicaSets.

48
Q

When is a rollout triggered?

A

A rollout is only triggered when we update the Pods Template for a deployment. Operations like scaling the deployment do not trigger the deployment.

49
Q

What are namespaces?

A

We can partition kubernetes into sub-clusters using Namespaces.