WHAT IS KUBERNETES Flashcards

1
Q

What is Kubernetes?

A

Kubernetes is an open-source container orchestrator that manages container-based applications based on the requirements of the administrator or developer.

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

List the key functionalities Kubernetes offers for managed containerised apps

A

●Deployment:
●Scaling
●Workload Placement
●Infrastructure Abstraction
●Desired State Management

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

Kubernetes offers several key functionalities for managing containerized applications:

What does Kubernetes manage in terms of deployment?

A

Kubernetes manages the deployment of pods, determining how and where they are deployed within the cluster.

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

Kubernetes offers several key functionalities for managing containerized applications:

How does Kubernetes handle scaling?

A

Kubernetes can automatically scale applications by adding or removing pod replicas based on resource utilization or other metrics. This allows applications to handle varying workloads and maintain performance.

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

Kubernetes offers several key functionalities for managing containerized applications:

What is workload placement in Kubernetes?

A

Kubernetes determines which nodes pods should be deployed to based on factors like resource requirements and co-residency constraints.

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

Kubernetes offers several key functionalities for managing containerized applications:

What are infrastructure abstractions in Kubernetes?

A

Kubernetes provides abstractions for underlying infrastructure, simplifying the management of storage, networking, and workload placement

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

Kubernetes offers several key functionalities for managing containerized applications:

What is desired state management in Kubernetes?

A

Kubernetes ensures the system’s actual state matches the desired state defined in code. Controllers constantly monitor the system and take corrective actions to maintain the desired configuration.

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

List the benefits Kubernetes offers for managing containerised applications:

A

●Speed of Deployment
●Adaptability and Resilience:
●Load Balancing
●Infrastructure Complexity Hiding
●Horizontal Scaling
●High Availability

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

What benefit does Kubernetes provide for the deployment of containerized applications?

A

Speed of Deployment: Kubernetes enables rapid deployment of containerized applications.

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

What benefit does Kubernetes provide towards adaptability and resilience?

A

Kubernetes allows for quick absorption of changes and auto-healing by replacing failed pods, ensuring applications can recover quickly from failures

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

How is load balancing a benefit in Kubernetes?

A

Kubernetes provides load-balancing capabilities to distribute incoming traffic efficiently across application instances, enhancing performance and availability.

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

How is Infrastructure Complexity Hiding a benefit in Kubernetes?

A

Kubernetes simplifies the management of complex infrastructure by handling storage, network configuration, and workload placement.

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

How is horizontal scaling a benefit for Kubernetes?

A

Kubernetes supports both manual and automatic horizontal scaling, enabling applications to adapt to changing demands by adding or removing worker nodes.

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

How is Infrastructure Complexity Hiding a benefit in Kubernetes?

A

Kubernetes ensures high availability by replicating pods to multiple cluster nodes, eliminating downtime due to pod or node failures.

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

What does the Kubernetes API provide and what are API objects?

A

The Kubernetes API provides a collection of objects that can be used to build and define systems for deployment in code.

These objects, known as API objects, represent the system’s state and allow the configuration of this state both declaratively and imperatively

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

What is the difference between declarative and imperative configuration?

A

Declarative configuration means describing the desired deployment, while imperative configuration involves executing a sequence of commands to achieve the desired state

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

The Kubernetes API is implemented and available via the API Server

What is the role of the Kubernetes API Server?

A

The API Server is the central hub for information in a Kubernetes cluster.

It is the sole way users can interact with clusters, and it’s also how Kubernetes interacts with the cluster.

The API Server is a RESTful API over HTTP/S using JSON2. When the API server receives commands, that information is serialized and persisted into a cluster data store.

Administrators and developers interact with Kubernetes through the API Server to deploy and manage workloads. The API Server is also where Kubernetes cluster components interact to understand the system’s current state and make changes as needed to ensure the desired state.

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

List examples of the Kubernetes API objects.

A

●Pods
●Controllers
●Services
●Storage
●Namespaces
●ConfigMaps
●Secrets

19
Q

What are pods?

A

Pods are the most basic unit of work in Kubernetes, consisting of one or more application containers deployed on one or more cluster nodes. They can be configured with resource requirements.

Kubernetes directly manages pods, not containers.

20
Q

What does it mean that pods are ephemeral in Kubernetes?

A

Pods are ephemeral, meaning they are not designed to be redeployed. If a pod fails, the controller will delete it and deploy a new one.

21
Q

What does it mean that pods are atomic in Kubernetes?

A

Pods are atomic, meaning they either exist or don’t. If one container in a multi-container pod fails, the entire pod becomes unavailable.

22
Q

What unique network characteristic does each pod have?

A

Each pod receives a unique internal IP address, which is also ephemeral

23
Q

What happens to pods if the cluster goes down and then comes back up?

A

If a pod is running and the cluster goes down, the pod will be automatically restarted when the cluster comes back up.

24
Q

How does Kubernetes ensure the state and health of pods?

A

Kubernetes uses probes to constantly track the state and health of pods. Controllers respond to pod state and health, taking actions to maintain the desired state, such as deploying new pods if needed.

25
Q

What are Kubernetes Controllers?

A

Controllers are Kubernetes objects that ensure the actual state of the cluster matches the desired state defined in code. They constantly monitor the system and take actions to maintain the desired configuration.

26
Q

What do Controllers do with pods?

A

Controllers create and manage pods. If a pod fails, a controller will delete the failed pod and deploy a new one.

They use probes to check if pods are up and running and if the applications within those pods are healthy.

27
Q

What is the purpose of a ReplicaSet Controller in Kubernetes, and how is it typically used in deployments?

A

A ReplicaSet Controller ensures a specified number of replicas of a pod are running at all times. If a pod fails, the ReplicaSet deploys another pod to maintain the desired number of replicas. ReplicaSets are often defined within a deployment rather than being deployed directly.

28
Q

What is the purpose of StatefulSets in Kubernetes, and for what type of applications are they most useful?

A

StatefulSets are controllers for stateful applications that require persistent storage. They are most useful for back-end databases and applications where maintaining state, such as transaction history or shopping cart data, is important.

29
Q

What unique feature of StatefulSets ensures data persistence even if a pod fails?

A

Each pod in a StatefulSet is assigned a unique and reusable identity and gets its own persistent volume, which retains data even if the pod is restarted or rescheduled.

30
Q

How are pods in a StatefulSet deployed and terminated, and why is this order important?

A

Pods in a StatefulSet are deployed in sequential order and terminated in reverse order. This is crucial for applications where dependencies exist between pods.

31
Q

What mechanisms do StatefulSets provide to ensure continuous operation and data consistency during updates?

A

StatefulSets automatically replace failed pods and support rolling updates, allowing gradual updates without downtime. They ensure data consistency through synchronization between replicas or using centralized storage.

32
Q

How do StatefulSets ensure data integrity in stateful applications with multiple replicas?

A

Data integrity is maintained through synchronization between replicas or by using a centralized data store. For example, one pod may be designated as the primary replica for handling reads and writes, while others synchronize their data with it.

33
Q

What field in a StatefulSet’s YAML configuration is used to match and manage its pods?

A

The spec.selector field in the YAML configuration is used to match pod labels, allowing the StatefulSet to identify and manage its pods.

34
Q

What is the role of deployment controllers in Kubernetes?

A

Deployment controllers manage the state and rollout of ReplicaSets. They are a higher-level abstraction than ReplicaSets, offering additional features for managing deployments.

35
Q

How do deployment controllers simplify managing the desired state of an application?

A

Deployment controllers define both the pods and the ReplicaSets needed for a deployment, allowing everything to be managed in one place.

36
Q

What Kubernetes commands can you use to view deployments and ReplicaSets?

A

To view deployments: kubectl get deployment
To view ReplicaSets: kubectl get replicaset

37
Q

What are the two scaling options provided by deployment controllers in Kubernetes?

A

Manual scaling: Use the command kubectl scale <deployment> --replicas=<number> to set the desired number of replicas.</number></deployment>

Automatic scaling: Use a Horizontal Pod Autoscaler (HPA), defined with a command like kubectl autoscale deployment/nginx-deployment –min=10 –max=15 –cpu-percent=90%.

An HPA automatically scales the number of pod replicas up or down based on observed metrics, such as CPU utilization.

38
Q

What are the main differences between Deployments and Stateful sets?

A

Deployment:
- Pods use the same storage volumes
- Pods are assigned a random identity
- It is useful for front-end web apps (we don’t have to worry about retaining state)

StatefulSet:
- each pod uses its own persistent volume
- Pod gets a unique reusable identity
- it is useful for back-end databases

39
Q

What is the primary purpose of services in Kubernetes?

A

Services provide a persistent access point to applications running in pods, abstracting away the ephemeral nature of pods.

40
Q

How do Kubernetes services ensure persistency for applications?

A

Kubernetes persistently assigns an IP address and DNS name to services, allowing users to access the application without knowing specific pod details.

41
Q

What role do services play in networking within Kubernetes?

A

Services act as a networking abstraction, providing a stable entry point to pod applications.

42
Q

How do Kubernetes services enhance application scalability and availability?

A

Services distribute traffic across multiple pods, enabling load balancing and improving scalability and availability.

43
Q

How do services adapt to changes in the pod lifecycle?

A

Services are dynamically updated by Kubernetes to reflect changes in the pod lifecycle, such as adding or removing pods, ensuring the service remains functional.

44
Q

How can services in Kubernetes contribute to application scalability?

A

Services can be scaled by adding or removing pods, making it easy to adjust application capacity as needed.