# Volumes - Kubernetes
# https://kubernetes.io/docs/concepts/storage/volumes/

# A hostPath volume mounts a file or directory from the host node’s filesystem into your Pod. 

# This is not something that most Pods will need, 
# but it offers a powerful escape hatch for some applications.

apiVersion: v1
kind: Pod
metadata:
  name: test-pd
spec:
  containers:
  - image: k8s.gcr.io/test-webserver
    name: test-container
    volumeMounts:
    - mountPath: /test-pd
      name: test-volume
  volumes:
  - name: test-volume
    hostPath:
      # directory location on host
      path: /data
      # this field is optional
      type: Directory

# The supported values for field "type" are:

# 
# Empty string (default) is for backward compatibility, which means that no checks will be performed before mounting the hostPath volume.

# DirectoryOrCreate
# If nothing exists at the given path, an empty directory will be created there as needed with permission set to 0755, having the same group and ownership with Kubelet.

# Directory
# A directory must exist at the given path

# FileOrCreate
# If nothing exists at the given path, an empty file will be created there as needed with permission set to 0644, having the same group and ownership with Kubelet.

# File
# A file must exist at the given path

# Socket
# A UNIX socket must exist at the given path

# CharDevice
# A character device must exist at the given path

# BlockDevice
# A block device must exist at the given path