mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Move provisioning examples out of 'experimental' directory.
Dynamic provisioning is pretty stable now.
This commit is contained in:
parent
7171f6fd5f
commit
907c4ad98d
@ -1,6 +1,6 @@
|
|||||||
## Persistent Volume Provisioning
|
## Persistent Volume Provisioning
|
||||||
|
|
||||||
This example shows how to use experimental persistent volume provisioning.
|
This example shows how to use dynamic persistent volume provisioning.
|
||||||
|
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
|
|
||||||
@ -191,19 +191,19 @@ parameters:
|
|||||||
First create Quobyte admin's Secret in the system namespace. Here the Secret is created in `kube-system`:
|
First create Quobyte admin's Secret in the system namespace. Here the Secret is created in `kube-system`:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ kubectl create -f examples/experimental/persistent-volume-provisioning/quobyte/quobyte-admin-secret.yaml --namespace=kube-system
|
$ kubectl create -f examples/persistent-volume-provisioning/quobyte/quobyte-admin-secret.yaml --namespace=kube-system
|
||||||
```
|
```
|
||||||
|
|
||||||
Then create the Quobyte storage class:
|
Then create the Quobyte storage class:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ kubectl create -f examples/experimental/persistent-volume-provisioning/quobyte/quobyte-storage-class.yaml
|
$ kubectl create -f examples/persistent-volume-provisioning/quobyte/quobyte-storage-class.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
Now create a PVC
|
Now create a PVC
|
||||||
|
|
||||||
```
|
```
|
||||||
$ kubectl create -f examples/experimental/persistent-volume-provisioning/claim1.json
|
$ kubectl create -f examples/persistent-volume-provisioning/claim1.json
|
||||||
```
|
```
|
||||||
|
|
||||||
Check the created PVC:
|
Check the created PVC:
|
||||||
@ -239,7 +239,7 @@ No events.
|
|||||||
Create a Pod to use the PVC:
|
Create a Pod to use the PVC:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ kubectl create -f examples/experimental/persistent-volume-provisioning/quobyte/example-pod.yaml
|
$ kubectl create -f examples/persistent-volume-provisioning/quobyte/example-pod.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Azure Disk
|
#### Azure Disk
|
||||||
@ -263,7 +263,7 @@ parameters:
|
|||||||
### User provisioning requests
|
### User provisioning requests
|
||||||
|
|
||||||
Users request dynamically provisioned storage by including a storage class in their `PersistentVolumeClaim`.
|
Users request dynamically provisioned storage by including a storage class in their `PersistentVolumeClaim`.
|
||||||
The annotation `volume.beta.kubernetes.io/storage-class` is used to access this experimental feature. It is required that this value matches the name of a `StorageClass` configured by the administrator.
|
The annotation `volume.beta.kubernetes.io/storage-class` is used to access this feature. It is required that this value matches the name of a `StorageClass` configured by the administrator.
|
||||||
In the future, the storage class may remain in an annotation or become a field on the claim itself.
|
In the future, the storage class may remain in an annotation or become a field on the claim itself.
|
||||||
|
|
||||||
```
|
```
|
||||||
@ -302,10 +302,10 @@ and automatically bound to the claim requesting storage.
|
|||||||
```
|
```
|
||||||
$ kubectl get pv
|
$ kubectl get pv
|
||||||
|
|
||||||
$ kubectl create -f examples/experimental/persistent-volume-provisioning/gce-pd.yaml
|
$ kubectl create -f examples/persistent-volume-provisioning/gce-pd.yaml
|
||||||
storageclass "slow" created
|
storageclass "slow" created
|
||||||
|
|
||||||
$ kubectl create -f examples/experimental/persistent-volume-provisioning/claim1.json
|
$ kubectl create -f examples/persistent-volume-provisioning/claim1.json
|
||||||
persistentvolumeclaim "claim1" created
|
persistentvolumeclaim "claim1" created
|
||||||
|
|
||||||
$ kubectl get pv
|
$ kubectl get pv
|
||||||
@ -353,10 +353,10 @@ From the key value, we will create a secret. We must create the Ceph admin Secre
|
|||||||
$ kubectl create secret generic ceph-secret-admin --from-literal=key='AQBfxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==' --namespace=kube-system --type=kubernetes.io/rbd
|
$ kubectl create secret generic ceph-secret-admin --from-literal=key='AQBfxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==' --namespace=kube-system --type=kubernetes.io/rbd
|
||||||
```
|
```
|
||||||
|
|
||||||
Now modify `examples/experimental/persistent-volume-provisioning/rbd/rbd-storage-class.yaml` to reflect your environment, particularly the `monitors` field. We are now ready to create our RBD Storage Class:
|
Now modify `examples/persistent-volume-provisioning/rbd/rbd-storage-class.yaml` to reflect your environment, particularly the `monitors` field. We are now ready to create our RBD Storage Class:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ kubectl create -f examples/experimental/persistent-volume-provisioning/rbd/rbd-storage-class.yaml
|
$ kubectl create -f examples/persistent-volume-provisioning/rbd/rbd-storage-class.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
The kube-controller-manager is now able to provision storage, however we still need to be able to map the RBD volume to a node. Mapping should be done with a non-privileged key, if you have existing users you can get all keys by running `ceph auth list` on your Ceph cluster with the admin key. For this example we will create a new user and pool.
|
The kube-controller-manager is now able to provision storage, however we still need to be able to map the RBD volume to a node. Mapping should be done with a non-privileged key, if you have existing users you can get all keys by running `ceph auth list` on your Ceph cluster with the admin key. For this example we will create a new user and pool.
|
||||||
@ -382,7 +382,7 @@ You are now ready to provision and use RBD storage.
|
|||||||
With the storageclass configured, let's create a PVC in our example namespace, `myns`:
|
With the storageclass configured, let's create a PVC in our example namespace, `myns`:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ kubectl create -f examples/experimental/persistent-volume-provisioning/claim1.json --namespace=myns
|
$ kubectl create -f examples/persistent-volume-provisioning/claim1.json --namespace=myns
|
||||||
```
|
```
|
||||||
|
|
||||||
Eventually the PVC creation will result in a PV and RBD volume to match:
|
Eventually the PVC creation will result in a PV and RBD volume to match:
|
||||||
@ -423,7 +423,7 @@ No events.
|
|||||||
With our storage provisioned, we can now create a Pod to use the PVC:
|
With our storage provisioned, we can now create a Pod to use the PVC:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ kubectl create -f examples/experimental/persistent-volume-provisioning/rbd/pod.yaml --namespace=myns
|
$ kubectl create -f examples/persistent-volume-provisioning/rbd/pod.yaml --namespace=myns
|
||||||
```
|
```
|
||||||
|
|
||||||
Now our pod has an RBD mount!
|
Now our pod has an RBD mount!
|
||||||
@ -435,5 +435,5 @@ $ kubectl exec -it $PODNAME --namespace=myns -- df -h | grep rbd
|
|||||||
```
|
```
|
||||||
|
|
||||||
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
|
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
|
||||||
[]()
|
[]()
|
||||||
<!-- END MUNGE: GENERATED_ANALYTICS -->
|
<!-- END MUNGE: GENERATED_ANALYTICS -->
|
Loading…
Reference in New Issue
Block a user