For the labs dealing with storage, I see there is always a storageclass and PV created for us.
If I needed to create my own PV and then have the PV attach to a PVC, is that possible in the environment?
I believe it is this annotation on the storage in our labs that automatically provisions a PV. When you set it to false and then you try to set a PVC to a deployment, the PVC itself will be in pending. I was testing the relation between a PVC PV and Storage class.
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
annotations: storageclass.kubernetes.io/is-default-class: "true"
@Richard4 Yes you can create a PV if you need - refer here https://kubernetes.io/docs/concepts/storage/persistent-volumes/
Also note the below :
A storageclass is a Kubernetes object that stores information about creating a persistent volume for your pod. With a storageclass, you do not need to create a persistent volume separately before claiming it.
For static configuration, administrators pre-build storage. They manually create PVs with specific properties and define a StorageClass that accurately reflects those features. When a pod uses a PVC referencing that StorageClass, it's automatically assigned one of the available static PVs matching its requirements.
Dynamic configuration kicks in when the existing PVs don't fit the request. In this scenario, the Kubernetes cluster automatically provisions a new PV based on the specifications outlined in the StorageClass associated with the PVC.
Refer here the latest docs for your reference : https://docs.openshift.com/container-platform/4.14/storage/understanding-persistent-storage.html
You can refer DO316 course if you want - I am not sure if DO280 covers this topic in details or has any labs to practice on.
@Richard4 This article seems really helpful can you please check it out https://docs.openshift.com/container-platform/3.11/dev_guide/persistent_volumes.html
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.