admin_dm (admin_dm) wrote,
admin_dm
admin_dm

VMWARE KUBERNETES VOLUME

Create VMDK


vmkfstools -c 2G /vmfs/volumes/datastore1/volumes/myDisk.vmdk


Create Pod which uses vSphere Volume ‘myDisk.vmdk’


#vsphere-volume-pod.yaml

apiVersion: v1
kind: Pod
metadata:
  name: test-vmdk
spec:
  containers:
  - image: gcr.io/google_containers/test-webserver
    name: test-container
    volumeMounts:
    - mountPath: /test-vmdk
      name: test-volume
  volumes:
  - name: test-volume
    # This VMDK volume must already exist.
    vsphereVolume:
      volumePath: "[datastore1] volumes/myDisk.vmdk"
      fsType: ext4


Create the pod


$ kubectl create -f vsphere-volume-pod.yaml

Verify that pod is running


$ kubectl get pods test-vmdk
NAME      READY     STATUS    RESTARTS   AGE
test-vmdk   1/1     Running   0          48m

Tags: #vsphere, kubernetes
Subscribe
  • Post a new comment

    Error

    Comments allowed for friends only

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments