Skip to content

Latest commit

 

History

History
245 lines (182 loc) · 3.65 KB

10-Practice-Test-Persistent-Volume-Claims.md

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

    OK
    
  2. Check the Solution

    OK
    
  3. Check the Solution

    No
    
  4. Check the Solution

    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

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

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

    PENDING
    
  8. Check the Solution

    AVAILABLE
    
  9. Check the Solution

    Access Modes Mismatch
    
  10. Check the Solution

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

    100Mi
    
  12. Check the Solution

    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

    Retain
    
  14. Check the Solution

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

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

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

    kubectl delete pod webapp
    
  18. Check the Solution

    Deleted
    
  19. Check the Solution

    Released