Stateful Sets Flashcards

1
Q

What is the role of a Stateful Set in Kubernetes?

A

The role of a Stateful Set is to manage stateful applications in Kubernetes, providing each pod with a unique and persistent identity.

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

How does a Stateful Set assign unique identifiers to its pods?

A

Each pod in a Stateful Set is assigned a unique identifier in the form of a sequence number appended to the Stateful Set name.

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

What is the key feature of Stateful Sets regarding pod creation and deletion?

A

Stateful Sets ensure that pods are created and deleted in a specific order, maintaining the order of pod creation and deletion.

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

What is the significance of setting the cluster IP to “None” in a Headless Service associated with a Stateful Set?

A

Setting the cluster IP to “None” creates a Headless Service, allowing each pod to have its own DNS entry and enabling direct communication with individual pods.

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

How do you delete Persistent Volume Claims (PVCs) associated with a Stateful Set when deleting the Stateful Set itself?

A

Deleting a Stateful Set will not automatically delete the associated PVCs. You must manually delete the PVCs if needed.

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

What is Kubernetes Helm?

A

Helm is a package manager for Kubernetes that simplifies the deployment and management of Kubernetes applications using charts, which are pre-configured templates.

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

What is a Kubernetes ConfigMap?

A

A ConfigMap is a Kubernetes resource that stores configuration data separately from application code, allowing you to configure applications without changing their code.

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

What is a Kubernetes Secret?

A

A Secret is a Kubernetes resource for storing sensitive information like passwords, API keys, and tokens. It’s encoded and can be used by Pods securely.

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

What is Kubernetes RBAC?

A

RBAC (Role-Based Access Control) is a Kubernetes feature that defines and enforces access control policies, allowing fine-grained control over who can perform actions within the cluster.

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

What is a Kubernetes Persistent Volume (PV)?

A

A Persistent Volume (PV) in Kubernetes is a piece of networked storage that can be dynamically provisioned and bound to a Persistent Volume Claim (PVC) by Pods.

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

What is Kubernetes StatefulSet?

A

A StatefulSet is a Kubernetes resource used for deploying stateful applications, ensuring that Pods have stable network identities and storage.

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

What is Kubernetes Horizontal Pod Autoscaling (HPA)?

A

Horizontal Pod Autoscaling is a Kubernetes feature that automatically adjusts the number of replica Pods in a Deployment or StatefulSet based on resource usage or custom metrics.

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

What is Kubernetes Kubeconfig?

A

Kubeconfig is a file used to configure access to a Kubernetes cluster. It contains cluster information, user credentials, and context settings.

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

What is a Kubernetes Helm Chart?

A

A Helm Chart is a package of pre-configured Kubernetes resources used for deploying applications. It simplifies application deployment and management.

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

What is Kubernetes etcd?

A

etcd is a distributed key-value store used by Kubernetes to store configuration data and manage cluster state.

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

What is Kubernetes CNI (Container Network Interface)?

A

CNI is a standard for network plugins in Kubernetes, allowing different networking solutions to be used within a cluster for container networking.

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

What is the purpose of a Stateful Set in Kubernetes?

A

A Stateful Set is used to manage stateful applications and provides stable network identities for individual pods.

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

How does a Stateful Set differ from a Deployment in Kubernetes?

A

Unlike Deployments, Stateful Sets maintain a stable and unique identity for each pod, and they are suitable for stateful applications like databases.

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

What does the service section in a Stateful Set’s YAML file specify?

A

The service section defines a Headless Service, typically with clusterIP: None, which provides network identity to Stateful Set pods.

20
Q

How are Stateful Set pods created and deleted within the Stateful Set?

A

Stateful Set pods are created in a predictable sequence and deleted in reverse order.

21
Q

What is the purpose of Persistent Volume Claims (PVCs) in a Stateful Set?

A

PVCs define storage requirements for Stateful Set pods, allowing them to persist data across pod restarts.

22
Q

Can you scale a Stateful Set horizontally by increasing the number of replicas?

A

Yes, you can scale a Stateful Set horizontally by increasing the number of replicas to accommodate more instances of stateful pods.

23
Q

How does the naming convention for Stateful Set pods work?

A

Stateful Set pods are named with a unique ordinal index, such as pod-0, pod-1, etc., ensuring predictable and stable naming.

24
Q

What kind of applications or services are suitable for Stateful Sets?

A

Stateful Sets are suitable for applications that require stable network identities and persistent storage, like databases and messaging systems.

25
Q

What happens when a Stateful Set pod is deleted or crashes?

A

Stateful Sets ensure that a new pod with the same ordinal index and network identity is created to replace the deleted or crashed pod.

26
Q

How do you create a Stateful Set in Kubernetes?

A

You can create a Stateful Set by defining its specifications in a YAML file and applying it using kubectl apply -f filename.yaml.

27
Q

How does Stateful Set ensure ordered pod creation and deletion?

A

Stateful Sets maintain ordered creation and deletion by assigning each pod a unique and predictable ordinal index.

28
Q

Can Stateful Set pods be rescheduled to different nodes?

A

Yes, Stateful Set pods can be rescheduled to different nodes if necessary, while still maintaining their stable network identity.

29
Q

What does it mean when a Stateful Set pod is in the “Running” state?

A

When a Stateful Set pod is in the “Running” state, it indicates that the pod is successfully deployed and operational.

30
Q

How does a Stateful Set’s service discovery work for its pods?

A

Stateful Set pods can discover each other and the service using DNS naming based on their stable network identities.

31
Q

What is the key benefit of using Stateful Sets for stateful applications?

A

The key benefit is that Stateful Sets provide predictable and stable network identities and ensure ordered pod management for stateful applications.

32
Q

Can Stateful Set pods have different resource requirements, such as CPU and memory?

A

Yes, Stateful Set pods can have different resource requirements based on your configuration in the YAML file.

33
Q

How can you check the status and details of a Stateful Set?

A

You can use kubectl describe statefulset <name> to view the details and status of a Stateful Set.</name>

34
Q

What is the significance of the serviceName field in a Stateful Set’s YAML file?

A

The serviceName field specifies the Headless Service that provides network identity to Stateful Set pods.

35
Q

What command is used to delete a Stateful Set defined in a YAML file?

A

You can delete a Stateful Set defined in a YAML file using kubectl delete -f filename.yaml.

36
Q

What is the role of a Stateful Set in Kubernetes?

A

The role of a Stateful Set is to manage stateful applications and provide each pod with a unique and persistent identity.

37
Q

How does a Stateful Set ensure that each pod has a unique and persistent identity?

A

Stateful Sets assign a unique ordinal index to each pod’s hostname, and they use persistent volume claims (PVCs) to provide persistent storage.

38
Q

In what scenarios is a Stateful Set commonly used?

A

Stateful Sets are commonly used for running databases, message queues, and other stateful workloads where each pod needs a stable network identity and storage.

39
Q

What is the significance of the stable network identity provided by Stateful Sets?

A

The stable network identity ensures that pods in a Stateful Set can communicate with each other consistently, even after rescheduling or scaling.

40
Q

How are Stateful Sets different from Deployments in Kubernetes?

A

Stateful Sets are designed for stateful applications that require unique identities and stable storage, while Deployments are typically used for stateless applications that can be easily scaled and replaced.

41
Q

What is the purpose of the Stateful Sets Lab?

A

The Stateful Sets Lab demonstrates how to create and work with Stateful Sets in Kubernetes to manage stateful applications.

42
Q

What is the key difference between Stateful Sets and Deployments?

A

Stateful Sets are used for stateful applications that require unique and stable network identities and persistent storage, whereas Deployments are typically used for stateless applications.

43
Q

How can you create a Stateful Set in Kubernetes using a YAML file?

A

You can create a Stateful Set by applying a YAML file using the kubectl apply -f command, specifying the YAML file’s name.

44
Q

What is the purpose of the volumeClaimTemplates section in a Stateful Set’s YAML definition?

A

The volumeClaimTemplates section defines how persistent volume claims (PVCs) should be created for pods in the Stateful Set, specifying storage class, access mode, and storage size.

45
Q

How does Stateful Set ensure unique network identities for pods?

A

Stateful Sets assign unique ordinal indices to each pod’s hostname, ensuring a consistent and unique network identity even after scaling or rescheduling.

46
Q

What is the significance of persistent storage in Stateful Sets?

A

Persistent storage ensures that data is retained even if a pod is rescheduled or replaced, making Stateful Sets suitable for stateful applications like databases.