text stringlengths 0 59.1k |
|---|
claimName: pvc0001 |
``` |
[Download example](storageos-pvcpod.yaml?raw=true) |
Create the pod: |
```bash |
$ kubectl create -f examples/volumes/storageos/storageos-pvcpod.yaml |
``` |
Verify that the pod has been created: |
```bash |
$ kubectl get pods |
NAME READY STATUS RESTARTS AGE |
test-storageos-redis-pvc 1/1 Running 0 40s |
``` |
### Dynamic Provisioning |
Dynamic provisioning can be used to auto-create volumes when needed. They require a Storage Class, a Persistent Volume Claim, and a Pod. |
#### Storage Class |
Kubernetes administrators can use storage classes to define different types of storage made available within the cluster. Each storage class definition specifies a provisioner type and any parameters needed to access it, as well as any other configuration. |
StorageOS supports the following storage class parameters: |
* `pool`: The name of the StorageOS distributed capacity pool to provision the volume from. Uses the `default` pool which is normally present if not specified. |
* `description`: The description to assign to volumes that were created dynamically. All volume descriptions will be the same for the storage class, but different storage classes can be used to allow descriptions for different use cases. Defaults to `Kubernetes volume`. |
* `fsType`: The default filesystem type to request. Note that user-defined rules within StorageOS may override this value. Defaults to `ext4`. |
* `adminSecretNamespace`: The namespace where the API configuration secret is located. Required if adminSecretName set. |
* `adminSecretName`: The name of the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted. |
1. Create storage class |
Example spec: |
```yaml |
kind: StorageClass |
apiVersion: storage.k8s.io/v1 |
metadata: |
name: sc-fast |
provisioner: kubernetes.io/storageos |
parameters: |
pool: default |
description: Kubernetes volume |
fsType: ext4 |
adminSecretNamespace: default |
adminSecretName: storageos-secret |
``` |
[Download example](storageos-sc.yaml?raw=true) |
Create the storage class: |
```bash |
$ kubectl create -f examples/volumes/storageos/storageos-sc.yaml |
``` |
Verify the storage class has been created: |
```bash |
$ kubectl describe storageclass fast |
Name: fast |
IsDefaultClass: No |
Annotations: <none> |
Provisioner: kubernetes.io/storageos |
Parameters: description=Kubernetes volume,fsType=ext4,pool=default,secretName=storageos-secret |
No events. |
``` |
1. Create persistent volume claim |
Example spec: |
```yaml |
apiVersion: v1 |
kind: PersistentVolumeClaim |
metadata: |
name: fast0001 |
spec: |
storageClassName: fast |
accessModes: |
- ReadWriteOnce |
resources: |
requests: |
storage: 5Gi |
``` |
Create the persistent volume claim (pvc): |
```bash |
$ kubectl create -f examples/volumes/storageos/storageos-sc-pvc.yaml |
``` |
Verify the pvc has been created: |
```bash |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.