Skip to content

Commit

Permalink
Fixed bad merge of Volumes.md
Browse files Browse the repository at this point in the history
  • Loading branch information
z103cb committed Oct 31, 2023
1 parent 6c8cc28 commit e94aefc
Showing 1 changed file with 18 additions and 32 deletions.
50 changes: 18 additions & 32 deletions apiserver/Volumes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.
Expand All @@ -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:

Expand All @@ -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:

Expand All @@ -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:

Expand All @@ -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
}
````
```

0 comments on commit e94aefc

Please sign in to comment.