WHAT IS KUBERNETES PT2 Flashcards
STORAGE, LIMITATIONS, NAMESPACES, CONFIG MAPS, SECRETS
What was the primary storage mechanism in Kubernetes initially, and what were its limitations?
Volumes were the initial storage mechanism, directly accessible by pods. However, they were ephemeral, tied to a pod’s lifecycle, and local to a pod, limiting their usefulness for persistent storage needs.
What is a persistent volume in Kubernetes, and how does it differ from a regular volume?
A persistent volume is pod-independent storage defined at the cluster level by an administrator. Unlike regular volumes, it exists independently of any individual pod and can be provisioned and managed separately.
How does a pod request storage from a persistent volume in Kubernetes?
A pod uses a Persistent Volume Claim (PVC) to request storage from the available persistent volumes in the cluster. The PVC decouples the pod from the underlying storage, providing flexibility.
From which sources can Kubernetes pods mount storage?
Pods can mount storage from local storage, remote network storage, or cloud storage services.
How does Kubernetes manage storage backends, and who typically handles the storage backend?
Kubernetes provides the framework for managing storage, but the actual storage backend is handled by various solutions, such as cloud providers or on-premise storage systems.
Why is database storage often handled outside of Kubernetes?
Many organizations prefer using managed database services provided by cloud providers or maintaining their databases on dedicated infrastructure for reliability and performance reasons.
What is the default type of storage in Kubernetes, and how can it be configured for stateful applications?
The default storage in Kubernetes is ephemeral, and useful for temporary data. It can be configured as persistent for stateful applications that require data to be preserved.
While Kubernetes offers a powerful platform for container orchestration, it does have some limitations.
What are those limitations?
- Native code building and deployment: Kubernetes does not natively support code building or deployment processes.
- Node configuration management: Offers limited options for granular node configuration management compared to dedicated enterprise solutions.
What is the primary purpose of namespaces in Kubernetes?
Namespaces divide cluster resources into logical partitions, providing organization and isolation of resources, particularly in large clusters with multiple teams or users.
How do namespaces help prevent resource name conflicts in Kubernetes?
Namespaces create boundaries for resource names, ensuring names are unique within a namespace but can be reused across different namespaces.
Are all resources in Kubernetes tied to namespaces? Give examples
No, some resources, such as Persistent Volumes, nodes, and StorageClasses, are cluster-wide and not tied to a specific namespace.
Can namespaces in Kubernetes be nested or shared by multiple resources?
No, namespaces cannot be nested, and a given resource can only belong to one namespace at a time.
Kubernetes clusters have a default namespace.
can you give examples of some commands for interacting with namespaces:
○View all namespaces: kubectl get ns (where “ns” is shorthand for “namespace”).
○Get pods within a specific namespace: kubectl get pod -n kube-system (the “-n” flag is used to specify the namespace).
○Create a new namespace: kubectl create ns <namespace_name>.</namespace_name>
○Filter namespaces with specific words: kubectl get ns | grep app1.
○Deploy a pod in a specific namespace: kubectl apply -f nginx.yaml -n app1namespace.
What is a ConfigMap in Kubernetes, and
What is the primary benefit of using ConfigMaps in Kubernetes?
A ConfigMap is a mechanism for storing non-confidential configuration data in key-value pairs.
ConfigMaps separate configuration data from application code, making it easier to manage and update settings without modifying the application itself.
What types of settings can be stored in a ConfigMap?
A ConfigMap can store settings such as database URLs, user-preferred languages, and port numbers.