Stateful Sets Flashcards
What is the role of a Stateful Set in Kubernetes?
The role of a Stateful Set is to manage stateful applications in Kubernetes, providing each pod with a unique and persistent identity.
How does a Stateful Set assign unique identifiers to its pods?
Each pod in a Stateful Set is assigned a unique identifier in the form of a sequence number appended to the Stateful Set name.
What is the key feature of Stateful Sets regarding pod creation and deletion?
Stateful Sets ensure that pods are created and deleted in a specific order, maintaining the order of pod creation and deletion.
What is the significance of setting the cluster IP to “None” in a Headless Service associated with a Stateful Set?
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 do you delete Persistent Volume Claims (PVCs) associated with a Stateful Set when deleting the Stateful Set itself?
Deleting a Stateful Set will not automatically delete the associated PVCs. You must manually delete the PVCs if needed.
What is Kubernetes Helm?
Helm is a package manager for Kubernetes that simplifies the deployment and management of Kubernetes applications using charts, which are pre-configured templates.
What is a Kubernetes ConfigMap?
A ConfigMap is a Kubernetes resource that stores configuration data separately from application code, allowing you to configure applications without changing their code.
What is a Kubernetes Secret?
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.
What is Kubernetes RBAC?
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.
What is a Kubernetes Persistent Volume (PV)?
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.
What is Kubernetes StatefulSet?
A StatefulSet is a Kubernetes resource used for deploying stateful applications, ensuring that Pods have stable network identities and storage.
What is Kubernetes Horizontal Pod Autoscaling (HPA)?
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.
What is Kubernetes Kubeconfig?
Kubeconfig is a file used to configure access to a Kubernetes cluster. It contains cluster information, user credentials, and context settings.
What is a Kubernetes Helm Chart?
A Helm Chart is a package of pre-configured Kubernetes resources used for deploying applications. It simplifies application deployment and management.
What is Kubernetes etcd?
etcd is a distributed key-value store used by Kubernetes to store configuration data and manage cluster state.
What is Kubernetes CNI (Container Network Interface)?
CNI is a standard for network plugins in Kubernetes, allowing different networking solutions to be used within a cluster for container networking.
What is the purpose of a Stateful Set in Kubernetes?
A Stateful Set is used to manage stateful applications and provides stable network identities for individual pods.
How does a Stateful Set differ from a Deployment in Kubernetes?
Unlike Deployments, Stateful Sets maintain a stable and unique identity for each pod, and they are suitable for stateful applications like databases.
What does the service section in a Stateful Set’s YAML file specify?
The service section defines a Headless Service, typically with clusterIP: None, which provides network identity to Stateful Set pods.
How are Stateful Set pods created and deleted within the Stateful Set?
Stateful Set pods are created in a predictable sequence and deleted in reverse order.
What is the purpose of Persistent Volume Claims (PVCs) in a Stateful Set?
PVCs define storage requirements for Stateful Set pods, allowing them to persist data across pod restarts.
Can you scale a Stateful Set horizontally by increasing the number of replicas?
Yes, you can scale a Stateful Set horizontally by increasing the number of replicas to accommodate more instances of stateful pods.
How does the naming convention for Stateful Set pods work?
Stateful Set pods are named with a unique ordinal index, such as pod-0, pod-1, etc., ensuring predictable and stable naming.
What kind of applications or services are suitable for Stateful Sets?
Stateful Sets are suitable for applications that require stable network identities and persistent storage, like databases and messaging systems.
What happens when a Stateful Set pod is deleted or crashes?
Stateful Sets ensure that a new pod with the same ordinal index and network identity is created to replace the deleted or crashed pod.
How do you create a Stateful Set in Kubernetes?
You can create a Stateful Set by defining its specifications in a YAML file and applying it using kubectl apply -f filename.yaml.
How does Stateful Set ensure ordered pod creation and deletion?
Stateful Sets maintain ordered creation and deletion by assigning each pod a unique and predictable ordinal index.
Can Stateful Set pods be rescheduled to different nodes?
Yes, Stateful Set pods can be rescheduled to different nodes if necessary, while still maintaining their stable network identity.
What does it mean when a Stateful Set pod is in the “Running” state?
When a Stateful Set pod is in the “Running” state, it indicates that the pod is successfully deployed and operational.
How does a Stateful Set’s service discovery work for its pods?
Stateful Set pods can discover each other and the service using DNS naming based on their stable network identities.
What is the key benefit of using Stateful Sets for stateful applications?
The key benefit is that Stateful Sets provide predictable and stable network identities and ensure ordered pod management for stateful applications.
Can Stateful Set pods have different resource requirements, such as CPU and memory?
Yes, Stateful Set pods can have different resource requirements based on your configuration in the YAML file.
How can you check the status and details of a Stateful Set?
You can use kubectl describe statefulset <name> to view the details and status of a Stateful Set.</name>
What is the significance of the serviceName field in a Stateful Set’s YAML file?
The serviceName field specifies the Headless Service that provides network identity to Stateful Set pods.
What command is used to delete a Stateful Set defined in a YAML file?
You can delete a Stateful Set defined in a YAML file using kubectl delete -f filename.yaml.
What is the role of a Stateful Set in Kubernetes?
The role of a Stateful Set is to manage stateful applications and provide each pod with a unique and persistent identity.
How does a Stateful Set ensure that each pod has a unique and persistent identity?
Stateful Sets assign a unique ordinal index to each pod’s hostname, and they use persistent volume claims (PVCs) to provide persistent storage.
In what scenarios is a Stateful Set commonly used?
Stateful Sets are commonly used for running databases, message queues, and other stateful workloads where each pod needs a stable network identity and storage.
What is the significance of the stable network identity provided by Stateful Sets?
The stable network identity ensures that pods in a Stateful Set can communicate with each other consistently, even after rescheduling or scaling.
How are Stateful Sets different from Deployments in Kubernetes?
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.
What is the purpose of the Stateful Sets Lab?
The Stateful Sets Lab demonstrates how to create and work with Stateful Sets in Kubernetes to manage stateful applications.
What is the key difference between Stateful Sets and Deployments?
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.
How can you create a Stateful Set in Kubernetes using a YAML file?
You can create a Stateful Set by applying a YAML file using the kubectl apply -f command, specifying the YAML file’s name.
What is the purpose of the volumeClaimTemplates section in a Stateful Set’s YAML definition?
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.
How does Stateful Set ensure unique network identities for pods?
Stateful Sets assign unique ordinal indices to each pod’s hostname, ensuring a consistent and unique network identity even after scaling or rescheduling.
What is the significance of persistent storage in Stateful Sets?
Persistent storage ensures that data is retained even if a pod is rescheduled or replaced, making Stateful Sets suitable for stateful applications like databases.