mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-07-19 21:09:27 +00:00
Add notes about dynamic provisioning
This commit is contained in:
@@ -579,3 +579,23 @@ class: extra-details
|
||||
```
|
||||
|
||||
(on each node where Portworx was running)
|
||||
|
||||
---
|
||||
|
||||
class: extra-details
|
||||
|
||||
## Dynamic provisioning without a provider
|
||||
|
||||
- What if we want to use Stateful sets without a storage provider?
|
||||
|
||||
- We will have to create volumes manually
|
||||
|
||||
(by creating Persistent Volume objects)
|
||||
|
||||
- These volumes will be automatically bound with matching Persistent Volume Claims
|
||||
|
||||
- We can use local volumes (essentially bind mounts of host directories)
|
||||
|
||||
- Of course, these volumes won't be available in case of node failure
|
||||
|
||||
- Check [this blog post](https://kubernetes.io/blog/2018/04/13/local-persistent-volumes-beta/) for more information and gotchas
|
||||
@@ -155,6 +155,45 @@ spec:
|
||||
|
||||
e.g.: "replicate the data 3 times, and use SSD media"
|
||||
|
||||
- The extra details are provided by specifying a Storage Class
|
||||
|
||||
---
|
||||
|
||||
## What's a Storage Class?
|
||||
|
||||
- A Storage Class is yet another Kubernetes API resource
|
||||
|
||||
(visible with e.g. `kubectl get storageclass` or `kubectl get sc`)
|
||||
|
||||
- It indicates which *provisioner* to use
|
||||
|
||||
- And arbitrary paramters for that provisioner
|
||||
|
||||
(replications levels, type of disk ... anything relevant!)
|
||||
|
||||
- It is necessary to define a Storage Class to use [dynamic provisioning](https://kubernetes.io/docs/concepts/storage/dynamic-provisioning/)
|
||||
|
||||
- Conversely, it is not necessary to define one if you will create volumes manually
|
||||
|
||||
---
|
||||
|
||||
## Defining a Persistent Volume Claim
|
||||
|
||||
Here is a minimal PVC:
|
||||
|
||||
```yaml
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: my-claim
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Using a Persistent Volume Claim
|
||||
|
||||
Reference in New Issue
Block a user