From e94aefc2d54acc4cb22c71a801638b997b3abd2f Mon Sep 17 00:00:00 2001 From: Laurentiu Bradin <109964136+z103cb@users.noreply.github.com> Date: Tue, 31 Oct 2023 15:22:26 +0200 Subject: [PATCH] Fixed bad merge of Volumes.md --- apiserver/Volumes.md | 50 ++++++++++++++++---------------------------- 1 file changed, 18 insertions(+), 32 deletions(-) diff --git a/apiserver/Volumes.md b/apiserver/Volumes.md index ee869e975eb..6e844336128 100644 --- a/apiserver/Volumes.md +++ b/apiserver/Volumes.md @@ -27,14 +27,14 @@ The code below gives an example of hostPath volume definition: ```shell { - "name": "hostPath", # unique name - "source": "/tmp", # data location on host - "mountPath": "/tmp/hostPath", # mounting path - "volumeType": 1, # volume type - host path - "hostPathType": 0, # host path type - directory - "mountPropagationMode": 1 # mount propagation - host to container + "name": "hostPath", # unique name + "source": "/tmp", # data location on host + "mountPath": "/tmp/hostPath", # mounting path + "volumeType": 1, # volume type - host path + "hostPathType": 0, # host path type - directory + "mountPropagationMode": 1 # mount propagation - host to container } -```` +``` ## PVC volumes @@ -56,20 +56,13 @@ The code below gives an example of PVC volume definition: "mountPropagationMode": 2, # mount propagation mode - bidirectional "readOnly": false # read only } -```` +``` ## Ephemeral volumes -Some application need additional storage but don't care whether that data is stored persistently across restarts. For -example, caching services are often limited by memory size and can move infrequently used data into storage that is -slower than memory with little impact on overall performance. Ephemeral volumes are designed for these use cases. -Because volumes follow the Pod's lifetime and get created and deleted along with the Pod, Pods can be stopped and -restarted without being limited to where some persistent volume is available. +Some application need additional storage but don't care whether that data is stored persistently across restarts. For example, caching services are often limited by memory size and can move infrequently used data into storage that is slower than memory with little impact on overall performance. Ephemeral volumes are designed for these use cases. Because volumes follow the Pod's lifetime and get created and deleted along with the Pod, Pods can be stopped and restarted without being limited to where some persistent volume is available. -Although there are several option of ephemeral volumes, here we are using generic ephemeral volumes, which can be -provided by all storage drivers that also support persistent volumes. Generic ephemeral volumes are similar to emptyDir -volumes in the sense that they provide a per-pod directory for scratch data that is usually empty after provisioning. -But they may also have additional features: +Although there are several option of ephemeral volumes, here we are using generic ephemeral volumes, which can be provided by all storage drivers that also support persistent volumes. Generic ephemeral volumes are similar to emptyDir volumes in the sense that they provide a per-pod directory for scratch data that is usually empty after provisioning. But they may also have additional features: * Storage can be local or network-attached. * Volumes can have a fixed size that Pods are not able to exceed. @@ -86,15 +79,13 @@ The code below gives an example of ephemeral volume definition: "storageClass": "default" # storage class - optional "accessMode": 0 # access mode RWO - optional } -```` +``` ## Config map volumes -A ConfigMap provides a way to inject configuration data into pods. The data stored in a ConfigMap can be referenced in -a volume of type configMap and then consumed by containerized applications running in a pod. +A ConfigMap provides a way to inject configuration data into pods. The data stored in a ConfigMap can be referenced in a volume of type configMap and then consumed by containerized applications running in a pod. -When referencing a ConfigMap, you provide the name of the ConfigMap in the volume. You can customize the path to use -for a specific entry in the ConfigMap. +When referencing a ConfigMap, you provide the name of the ConfigMap in the volume. You can customize the path to use for a specific entry in the ConfigMap. The code below gives an example of config map volume definition: @@ -108,13 +99,11 @@ The code below gives an example of config map volume definition: "sample_code.py":"sample_code.py" } } -```` +``` ## Secret volumes -A secret volume is used to pass sensitive information, such as passwords, to Pods. You can store secrets in the -Kubernetes API and mount them as files for use by pods without coupling to Kubernetes directly. Secret volumes are -backed by tmpfs (a RAM-backed filesystem) so they are never written to non-volatile storage. +A secret volume is used to pass sensitive information, such as passwords, to Pods. You can store secrets in the Kubernetes API and mount them as files for use by pods without coupling to Kubernetes directly. Secret volumes are backed by tmpfs (a RAM-backed filesystem) so they are never written to non-volatile storage. The code below gives an example of secret volume definition: @@ -128,14 +117,11 @@ The code below gives an example of secret volume definition: "subPath": "password" } } -```` +``` ## Emptydir volumes -An emptyDir volume is first created when a Pod is assigned to a node, and exists as long as that Pod is running on -that node. As the name says, the emptyDir volume is initially empty. All containers in the Pod can read and write the -same files in the emptyDir volume, though that volume can be mounted at the same or different paths in each container. -When a Pod is removed from a node for any reason, the data in the emptyDir is deleted permanently. +An emptyDir volume is first created when a Pod is assigned to a node, and exists as long as that Pod is running on that node. As the name says, the emptyDir volume is initially empty. All containers in the Pod can read and write the same files in the emptyDir volume, though that volume can be mounted at the same or different paths in each container. When a Pod is removed from a node for any reason, the data in the emptyDir is deleted permanently. The code below gives an example of empydir volume definition: @@ -146,4 +132,4 @@ The code below gives an example of empydir volume definition: "volumeType": 5, # volume type - ephemeral "storage": "5Gi", # max storage size - optional } -```` +```