Skip to content

Latest commit

 

History

History
245 lines (182 loc) · 3.65 KB

File metadata and controls

245 lines (182 loc) · 3.65 KB

Practice Test Persistent Volume Claims

Lets do the Labs

Solution

  1. Check the Solution

    Details
    OK
    
  2. Check the Solution

    Details
    OK
    
  3. Check the Solution

    Details
    No
    
  4. Check the Solution

    Details
    apiVersion: v1
    kind: Pod
    metadata:
      name: webapp
    spec:
      containers:
      - name: event-simulator
        image: kodekloud/event-simulator
        env:
        - name: LOG_HANDLERS
          value: file
        volumeMounts:
        - mountPath: /log
          name: log-volume
    
      volumes:
      - name: log-volume
        hostPath:
          # directory location on host
          path: /var/log/webapp
          # this field is optional
          type: Directory
    
  5. Check the Solution

    Details
    apiVersion: v1
    kind: PersistentVolume
    metadata:
      name: pv-log
    spec:
      accessModes:
        - ReadWriteMany
      capacity:
        storage: 100Mi
      hostPath:
        path: /pv/log
    
  6. Check the Solution

    Details
    kind: PersistentVolumeClaim
    apiVersion: v1
    metadata:
      name: claim-log-1
    spec:
      accessModes:
        - ReadWriteOnce
      resources:
        requests:
          storage: 50Mi
    
  7. Check the Solution

    Details
    PENDING
    
  8. Check the Solution

    Details
    AVAILABLE
    
  9. Check the Solution

    Details
    Access Modes Mismatch
    
  10. Check the Solution

    Details
    kind: PersistentVolumeClaim
    apiVersion: v1
    metadata:
      name: claim-log-1
    spec:
      accessModes:
        - ReadWriteMany
      resources:
        requests:
          storage: 50Mi
    
  11. Check the Solution

    Details
    100Mi
    
  12. Check the Solution

    Details
    apiVersion: v1
    kind: Pod
    metadata:
      name: webapp
    spec:
      containers:
      - name: event-simulator
        image: kodekloud/event-simulator
        env:
        - name: LOG_HANDLERS
          value: file
        volumeMounts:
        - mountPath: /log
          name: log-volume
    
      volumes:
      - name: log-volume
        persistentVolumeClaim:
          claimName: claim-log-1
    
  13. Check the Solution

    Details
    Retain
    
  14. Check the Solution

    Details
    The PV is not delete but not available
    
  15. Check the Solution

    Details
    The PVC is stuck in `terminating` state
    
  16. Check the Solution

    Details
    The PVC is being used by a POD
    
  17. Check the Solution

    Details
    kubectl delete pod webapp
    
  18. Check the Solution

    Details
    Deleted
    
  19. Check the Solution

    Details
    Released