Kubernetes Components Flashcards

1
Q

Why Kubernetes?

A

Helps manage containerised applications in various different environments

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

What problems do kubernetes solve?

A

Rise of micro-services, cost and usage. Containers offer the perfect host for small independent applications, like micro-services.

The rise of micro-services has resulted in thousands of containers that use to be managed across different environments and were scripted and self made tools is really complex.

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

What do orchestration tools offer?

A

High Availability - no downtime
Scalability - users have high response rate from application
Disaster Recovery - if data is lost or server explodes mechanism in place to not affect customers. And restore any data lost.

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

Worker Node?

A

simple server, physical or vm

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

pod?

A

basic component or smallest unit in k8
it is a abstraction over container
pod only runs one application inside of it

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

how do pods communicate with each other?

A

each pod has its own virtual ip address

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

Disadvantages of Pods?

A

They are ephemeral.
If the application crashes inside of the pod it will die.
If this happens it will get assigned a new pod with new IP address.
So this is annoying if you have ip addresses communicating with a database as you have to adjust the pod every time a pod restarts

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

What is the service component? (2 answers)

A

This is a permanent IP address. The lifecycles of the pod and services are not connected.
It is also a load balancer, it can catch a request and forward to required endpoint.

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

What are external services

A

Allows you to make application publicly accessible through a browser.

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

What are internal services

A

make your application privately accessible (like a database for example)

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

What is ingress?

A

allows you to have secure protocols and domain names for your pods.

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

How to change a database url in a pod?

A

You would use config map and you can then connect this to the pod.

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

Where would you put db credentials?

A

the secret component which stores sensitive data in base64 format.

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

How do you persist data in a db long term in k8?

A

Volumes.
This works by attaching a physical storage on a hard drive to your pod.
You could store this on a local machine that the pod is running or remotely (on prem or cloud storage)

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

How would you apply disaster recovery in k8?

A

You would define a blueprint for any many replica pods you would like to run. This service is the called blueprint.

You would have your node which contains two pods (application and database) these communicate through the service component using permanent ips. This also acts as a loadbalancer. You could then have direct replica of both of these pods

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

What is deployment component?

A

This is an abstraction on top of pods.

17
Q

Can we use deployment component for databases?

A

No a database has a state(which is its data) so if you have clones of a database pod they would all need to have access to the shared database storage. So there needs to be a mechanism to identify which pods are writing to the storage and which are reading, so there is no data inconsistencies. You would use statefulset.

18
Q

Is statefulsets easy?

A

No extremely difficult, most people generally have stateless applications in Kubernetes and have stateful applications running outside of Kubernetes.