cancel
Showing results for 
Search instead for 
Did you mean: 
Richard4
Mission Specialist
Mission Specialist
  • 1,345 Views

openshift - storage

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?

Labels (1)
4 Replies
Richard4
Mission Specialist
Mission Specialist
  • 1,288 Views

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"

Chetan_Tiwary_
Community Manager
Community Manager
  • 1,273 Views

@Richard4 Yes you can create a PV if you need - refer here  https://kubernetes.io/docs/concepts/storage/persistent-volumes/ 

Also note the below : 

Chetan_Tiwary__0-1702904915450.png

 

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.

 

0 Kudos
Chetan_Tiwary_
Community Manager
Community Manager
  • 1,272 Views

Refer here the latest docs for your reference : https://docs.openshift.com/container-platform/4.14/storage/understanding-persistent-storage.html 

 

Chetan_Tiwary__1-1702907202698.png

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. 

0 Kudos
Wasim_Raja
Moderator
Moderator
  • 1,278 Views

@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

0 Kudos
Join the discussion
You must log in to join this conversation.