Core Concepts Flashcards

1
Q

What makes a declaritive approach different from an imperitive? Can you relate to a comparison between a yaml-definitionfile and running a command?

A

Declaritive is the desired outcome, white imperitive is focused on steps resulting in micromanagement. The definition file is seen as a declaritive approach while running commands is more imperative.

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

Why should we use Kubernetes?

A

Kubernetes gives us a framework with standardised plugins for orchestrating containers. Without it we’d result to custom applications and scripts, widely different between organisations.

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

In ETCD, how are the –advertise-client-urls and —-internal-cluster used?

A

–advertise-client-urls is the IP that ETCD is listening on while –internal-cluster is used for grouping cluster members in a HA setup.

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

Is there something ETCD does not store?

A

No, all information about any objects in the Kubernetes clsuter is stored in the ETCD database.

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

Besides being the center of attention, how does the kube-apiserver differ compared to other components?

A

The kube-apiserver also manages authentication and is in contact with ETCD.

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

kube-controller-manager monitors and reacts to changes to comply with the monitoring. Describe the manger component for the nodes.

A

Nodes are monitored with a 5 sec heartbeat and have a grace period of 40 sec. Should there have been 5 min then the node is removed and any containers will be recreated on other nodes.

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

How does the kube-scheduler decide which containers get placed where by the kubelet?

A

First phace filters with for eg. hardware and second looks at a 0-10 score after the container is placed on the node. The higher score decided which node gets the container which means there were more resources available after.

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

Whats the difference when comparing the scheduler and kubelet components?

A

The scheduler instructs the kubelet where to load/unload containers.

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

Besides aiding in communication, what is the role of kube-proxy?

A

To search for services and on each node add rules with for eg. iptables on how to reach them.

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

How would you describe a POD?

A

A pod is the smallest object in Kubernetes and typically form a 1to1 relationship between pods and containers. When scaling the application, add more pods.

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

Can you describe the most basic top/root-level properties below?

apiVersion:
kind:
metadata:
spec:

A

apiVersion: depends on the kind kused

kind: type of object
metadata: data about object
spec: object type configuration

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

How do some kubernetes master/woker components differ when distributed with kubeadm and service?

A

kubeadm creates pods for the components with the configuration located under /etc/kubernetes/manifests/ where the service points to /etc/systemd/system/

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

Both ReplicationController and ReplicaSet are used to conform and scale pods, but what does RS bring to the table?

A

RS adds the key selector: under spec: which filters pods outside of the RS. This means the RS can include pods not created by the RS itself.

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

When creating a ReplicaSet the version needs to be what?

A

apps/v1

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

When using a ReplicaSet with selector: key, whats critical in the creation?

A

Matching must be equal to the labels under template: key.

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

Once a ReplicaSet has been updated, what must be done to any PODs within it?

A

Delete so that its recreated with the updated RS settings.

17
Q

By default you’re provided with the namespaces default, kube-system and kube-public? What’s the deal with namespaces in general?

A

They provide isolation of environments, for eg. production and development.

18
Q

Lets say you want to reach a service within your own local namespce, call it db-service. You’d simply use db-service. Now if its within another namespace like dev you’d resort to db-service.dev.svc.cluster.local. Can you elaborate on the different sections after the db-service?

A

db-service.dev.svc.cluster.local. dev is the environment, svc is for services and cluster.local is the cluster domain.

19
Q

Lets say you have three pods in the namespace dev and you accidently delete the namespace. Wha would be the outcome?

A

The namespace and all its objects would be deleted.

20
Q

Since a service object is spread across all nodes and forwards traffic to a group of pods. How does it know which pod or group of pods?

A

Just like the RS, services uses the selector: field to match labels.

21
Q

In a service NodePort; how are the NodePort, Port and TargetPorts used?

A

NodePort is what’s going to be listened to on the node itself. Port which is mandatory is what the service is actually listening to and TargetPort is what the pod is listening to.

22
Q

When would you want to use a service NodePort?

A

When you want to expose a service object within the cluster but outside of the cluster.

23
Q

Whats the deal with the service defintion using a ClusterIP?

A

ClusterIP is used to expose service objects within the cluster, representing a group of pods.