Skip to main content

Deploy sample application

Contributors netapp-aruldeepa

Deploy sample application.

Steps
  1. Mount the volume in a pod.

    kubectl create -f pv-pod.yaml

    These examples show basic configurations to attach the PVC to a pod:
    Basic configuration:

    kind: Pod
    apiVersion: v1
    metadata:
      name: pv-pod
    spec:
      volumes:
        - name: pv-storage
          persistentVolumeClaim:
           claimName: basic
      containers:
        - name: pv-container
          image: nginx
          ports:
            - containerPort: 80
              name: "http-server"
          volumeMounts:
            - mountPath: "/my/mount/path"
              name: pv-storage
    Note You can monitor the progress using kubectl get pod --watch.
  2. Verify that the volume is mounted on /my/mount/path.

    kubectl exec -it task-pv-pod -- df -h /my/mount/path
Filesystem                                                        Size  Used Avail Use% Mounted on
192.168.188.78:/trident_pvc_ae45ed05_3ace_4e7c_9080_d2a83ae03d06  1.1G  320K  1.0G   1% /my/mount/path
  1. You can now delete the Pod. The Pod application will no longer exist, but the volume will remain.

    kubectl delete pod task-pv-pod