Skip to content

Latest commit

 

History

History
148 lines (106 loc) · 2.37 KB

13-Practice-Test-Storage-Class.md

File metadata and controls

148 lines (106 loc) · 2.37 KB

Practice Test - Storage Class

Solution

  1. Check the Solution

    0
    
  2. Check the Solution

    2
    
  3. Check the Solution

    local-storage
    
  4. Check the Solution

    WaitForFirstConsumer
    
  5. Check the Solution

    portworx-volume
    
  6. Check the Solution

    NO
    
  7. Check the Solution

    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: local-pvc
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 500Mi
      storageClassName: local-storage
    
  8. Check the Solution

    Pending
    
  9. Check the Solution

    A Pod consuming the volume in not scheduled
    
  10. Check the Solution

    The Storage Class called local-storage makes use of VolumeBindingMode set to WaitForFirstConsumer. This will delay the binding and provisioning of a PersistentVolume until a Pod using the PersistentVolumeClaim is created.
    
  11. Check the Solution

    apiVersion: v1
    kind: Pod
    metadata:
      name: nginx
      labels:
        name: nginx
    spec:
        containers:
        - name: nginx
          image: nginx:alpine
          volumeMounts:
          - name: local-persistent-storage
            mountPath: /var/www/html
        volumes:
        - name: local-persistent-storage
          persistentVolumeClaim:
            claimName: local-pvc
    
  12. Check the Solution

    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      name: delayed-volume-sc
    provisioner: kubernetes.io/no-provisioner
    volumeBindingMode: WaitForFirstConsumer