Different types of Volumes

Hello i have a question, in my case I understand that this way of creating the VOLUMES are created in the HOST of the CLUSTER, but the scenarios of its handling are variants:

VOLUME TYPE # 1:

  • I understand that this type of VOLUME is NOT persistent & if the POD is DELETED, the VOLUME is DELETED.

    volumeMounts:

    • mountPath: /my-directory-in-pod
      name: data

volumes:

  • name: data
    emptyDir: {}

VOLUME TYPE # 2:

  • I understand that this type of VOLUME is YES persistent & if the POD is REMOVED, the VOLUME is KEPT alive.

    volumeMounts:

    • mountPath: /my-directory-in-pod
      name: data

volumes:

  • name: data
    persistentVolumeClaim:
    claimName: my-remote-pvc

VOLUME TYPE # 3:

  • I understand that this type of VOLUME copies the contents of a directory in the HOST to the directory in the POD environment.

    volumeMounts:

    • mountPath: /my-directory-in-pod*
      name: data*

volumes:

  • name: data
    hostPath:
    path: /directory-in-host
    type: Directory

TYPE VOLUME # 4:

  • I understand that this type of VOLUME saves the content (DATA) of the CONFIGMAP, to the directory in the POD environment.

    volumeMounts:

    • mountPath: /my-directory-in-pod
      name: data

volumes:

  • name: data
    configMap:
    name: my-configmap

VOLUME TYPE # 5:

  • I understand that this type of VOLUME saves the content (DATA) of the SECRET, to the directory in the POD environment.

  • I understand that the ‘readOnly: true’, makes the content of the directory in the POD, only READ (cannot be registered in it).

    volumeMounts:

    • mountPath: my-directory-in-pod
      name: data
      readOnly: true

volumes:

  • name: data
    secret:
    secretName: my-secret

If you could tell me if the analysis I have entered is correct or in which it is not.

Thank you.

Hello, @maktup
Yes, your explanation is correct.