
Kubernetes storage volumes is a very important concept in relation to how data is managed within a Pod (consisting of one or more containers) and also the data lifecycle.
In this post, you will learn about some of the following in relation to Kubernetes storage volumes. There is a practice test which will help you test your knowledge in relation to the storage volumes concept in Kubernetes. This test could prove to be useful and helpful for Kubernetes certification examination for Certified Kubernetes Administration (CKA). It may also prove to be useful for interviews.
- Revision notes on Kubernetes storage volumes
- Practice test
Revision Notes
- Kubernetes different volume types such as some of the following to mount volume into the pod:
- emptyDir
- hostPath
- File systems
- cephfs
- glusterfs
- Cloud platforms
- awsElasticBlockStore
- azureDisk
- azureFile
- gcePersistentDisk
- nfs (network file system)
- Vendor specific volume types
- ScaleIO
- Quobyte
- Flocker
- StorageOS
- vsphereVolume
- rbd (RADOS block device)
- Cinder (Openstack block storage)
- portworxVolume
- The following represents a template Pod specification file representing details on how volumes can be defined at Pod and containers level.
- At Pod level, the volume information is defined using following template. Pay attention to the field spec.volumes.
spec: containers: - name: someContainerName ... volumes: - name: someVolumeName <volumeType>:
</li>
<li>At container level, the volume specification is defined using following template. Pay attention to the field <strong>spec.containers.volumeMounts</strong>.spec: containers: - name: someContainerName ... volumeMounts: - mountPath: somePath name: someVolumeName volumes: - name: someVolumeName <volumeType>:
- At Pod level, the volume information is defined using following template. Pay attention to the field spec.volumes.
- Based on the above, the following represents a sample Pod specification file demonstrating the volumes (volume of type hostPath) defined at Pod and containers level. Pay attention to the fields such as spec.containers.volumeMounts and spec.volumes.
apiVersion: v1 kind: Pod metadata: name: test-pod spec: containers: - image: k8s.gcr.io/test-webserver name: test-container volumeMounts: - mountPath: /test-pod name: test-volume volumes: - name: test-volume hostPath: path: /data
- Kubernetes support different types of volumes to be mounted, from different cloud platform storage system, into the pod. The following represents volume types for AWS, Azure and Google cloud:
- awsElasticBlockStore (AWS)
- azureDisk (Azure)
- azureFile (Azure)
- gcePersistentDisk (Google Cloud)
- Kubernetes support different types of volumes to be mounted, from different types of file systems, into the pod.
- cephfs (Ceph File system)
- glusterfs (Gluster File system)
Practice Tests – Kubernetes Storage Volumes
The following represents questions and answers which can help you to test your knowledge in relation to Kubernetes storage volumes.
Only one volume can be specified at the Pod level
Volumes at Pod level are erased after Pods get deleted, for all volume types
The volume for the container is specified using which of the following field
The volume for the pod is specified using which of the following field
The contents of the volume type, cephfs or glusterfs, are erased when the pod is removed
Kubernetes allow sharing volumes mounted by a Container to other Containers in the same Pod or even other Pods
Which of the following volume types allows several volumes to be mapped into the same directory
Kubernetes allow custom plugin to be written to support different storage vendor volume types
Kubernetes secret volume is backed by which of the following
Which of the following is used to mount persistent volume into the pod?
Which of the following is a resource in the cluster?
Share your Results:
Additional Practice Tests
These are additional practice tests which relates to core concepts part of CKA certification test. Note that as per syllabus, core concepts will cover 19% questions in CKA certification test.
- Practice Test on introduction to Kubernetes
- Practice Test on Pods, Taints and Tolerations
- Practice Test on Container hooks / Pods
- Practice Test on Pod Lifecycle
- Practice Test on Services
- Practice test on service discovery
Further Reading / References
Summary
In this post, you briefly learned about details related to Kubernetes storage volumes. You were also provided with a set of questions and answers in form of practice test to check your knowledge in relation to Kubernetes storage volumes.
Did you find this post useful? Do you have any questions or suggestions about this article in relation to practice tests and revision notes in relation to Kubernetes storage volumes? Leave a comment and ask your questions and I shall do my best to address your queries.
Leave a Reply