text stringlengths 0 59.1k |
|---|
Access Modes: RWO |
Capacity: 2Gi |
Message: |
Source: |
Type: vSphereVolume (a Persistent Disk resource in vSphere) |
VolumePath: [datastore1] volumes/myDisk |
FSType: ext4 |
No events. |
``` |
3. Create Persistent Volume Claim. |
See example: |
```yaml |
kind: PersistentVolumeClaim |
apiVersion: v1 |
metadata: |
name: pvc0001 |
spec: |
accessModes: |
- ReadWriteOnce |
resources: |
requests: |
storage: 2Gi |
``` |
[Download example](vsphere-volume-pvc.yaml?raw=true) |
Creating the persistent volume claim: |
``` bash |
$ kubectl create -f examples/volumes/vsphere/vsphere-volume-pvc.yaml |
``` |
Verifying persistent volume claim is created: |
``` bash |
$ kubectl describe pvc pvc0001 |
Name: pvc0001 |
Namespace: default |
Status: Bound |
Volume: pv0001 |
Labels: <none> |
Capacity: 2Gi |
Access Modes: RWO |
No events. |
``` |
3. Create Pod which uses Persistent Volume Claim. |
See example: |
```yaml |
apiVersion: v1 |
kind: Pod |
metadata: |
name: pvpod |
spec: |
containers: |
- name: test-container |
image: registry.k8s.io/test-webserver |
volumeMounts: |
- name: test-volume |
mountPath: /test-vmdk |
volumes: |
- name: test-volume |
persistentVolumeClaim: |
claimName: pvc0001 |
``` |
[Download example](vsphere-volume-pvcpod.yaml?raw=true) |
Creating the pod: |
``` bash |
$ kubectl create -f examples/volumes/vsphere/vsphere-volume-pvcpod.yaml |
``` |
Verifying pod is created: |
``` bash |
$ kubectl get pod pvpod |
NAME READY STATUS RESTARTS AGE |
pvpod 1/1 Running 0 48m |
``` |
### Storage Class |
__Note: Here you don't need to create vmdk it is created for you.__ |
1. Create Storage Class. |
Example 1: |
```yaml |
kind: StorageClass |
apiVersion: storage.k8s.io/v1beta1 |
metadata: |
name: fast |
provisioner: kubernetes.io/vsphere-volume |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.