Hi All!
I am targeting CKA exam but not feeling comfortable with volumes.
Do we need to remember the attributes/proprties for pv,pvc etc in manifest file or there is a better way to recollect these properties.
Thanks,
Hari
Hi All!
I am targeting CKA exam but not feeling comfortable with volumes.
Do we need to remember the attributes/proprties for pv,pvc etc in manifest file or there is a better way to recollect these properties.
Thanks,
Hari
As with all, you have the documentation available. Each question provides a couple of doc links which when clicked will open the page in the Firefox browser on the exam terminal.
Also get comfortable with kubectl explain
(some output removed for brevity)
kubectl explain pv.spec
KIND: PersistentVolume
VERSION: v1
FIELD: spec <PersistentVolumeSpec>
DESCRIPTION:
spec defines a specification of a persistent volume owned by the cluster.
Provisioned by an administrator. More info:
https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistent-volumes
PersistentVolumeSpec is the specification of a persistent volume.
FIELDS:
accessModes <[]string>
accessModes contains all ways the volume can be mounted. More info:
https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes
hostPath <HostPathVolumeSource>
hostPath represents a directory on the host. Provisioned by a developer or
tester. This is useful for single-node development and testing only! On-host
storage is not supported in any way and WILL NOT WORK in a multi-node
cluster. More info:
https://kubernetes.io/docs/concepts/storage/volumes#hostpath
local <LocalVolumeSource>
local represents directly-attached storage with node affinity
storageClassName <string>
storageClassName is the name of StorageClass to which this persistent volume
belongs. Empty value means that this volume does not belong to any
StorageClass.
volumeMode <string>
volumeMode defines if a volume is intended to be used with a formatted
filesystem or to remain in raw block state. Value of Filesystem is implied
when not included in spec.
Possible enum values:
- `"Block"` means the volume will not be formatted with a filesystem and
will remain a raw block device.
- `"Filesystem"` means the volume will be or is formatted with a
filesystem.
then drill into a property
kubectl explain pv.spec.hostPath
KIND: PersistentVolume
VERSION: v1
FIELD: hostPath <HostPathVolumeSource>
DESCRIPTION:
hostPath represents a directory on the host. Provisioned by a developer or
tester. This is useful for single-node development and testing only! On-host
storage is not supported in any way and WILL NOT WORK in a multi-node
cluster. More info:
https://kubernetes.io/docs/concepts/storage/volumes#hostpath
Represents a host path mapped into a pod. Host path volumes do not support
ownership management or SELinux relabeling.
FIELDS:
path <string> -required-
path of the directory on the host. If the path is a symlink, it will follow
the link to the real path. More info:
https://kubernetes.io/docs/concepts/storage/volumes#hostpath
type <string>
type for HostPath Volume Defaults to "" More info:
https://kubernetes.io/docs/concepts/storage/volumes#hostpath
Possible enum values:
- `""` For backwards compatible, leave it empty if unset
- `"BlockDevice"` A block device must exist at the given path
- `"CharDevice"` A character device must exist at the given path
- `"Directory"` A directory must exist at the given path
- `"DirectoryOrCreate"` If nothing exists at the given path, an empty
directory will be created there as needed with file mode 0755, having the
same group and ownership with Kubelet.
- `"File"` A file must exist at the given path
- `"FileOrCreate"` If nothing exists at the given path, an empty file will
be created there as needed with file mode 0644, having the same group and
ownership with Kubelet.
- `"Socket"` A UNIX socket must exist at the given path