Got a question about *using the documentation* ``` apiVersion: v1 kind: Persis . . .

Dave McLean:
got a question about using the documentation

apiVersion: v1
kind: PersistentVolumeClaim
metadata: <...>
spec:
  <...>
  resources:
    requests:
      storage: 3Gi

^ here’s the YAML for a PVC. I need to specify 50Mi of storage on the PVC for which the syntax is like:

spec:
  resources:
    requests:
      storage: 50Mi

Before extensive googling I wasn’t sure how to do the above so I tried using k explain:

k explain PersistentVolumeClaim.spec.resources

which gives me this:

FIELDS:
   limits       <map[string]string>
   requests     <map[string]string> 

ok so I know that I need:

spec:
  resources:
    requests: <SOMETHING>

This documentation says that requests is a map of string:string but it doesn’t tell me what the available options are and it definitely doesn’t seem to tell me that I need: storage: in there.

k explain PersistentVolumeClaim.spec.resources.requests doesn’t seem to say that I need storage either.

how can I tell, from the k explain response, what I’m meant to put inside spec.resources.requests ? What goes inside spec.resources.limts? and how can I tell from the docs?

I know that I can just google things until I find I example but that’s slow and might not always work.

*I want to know how I can use the docs to know what to put inside <http://spec.re|spec.re>*sources

unnivkn:
https://kubernetes.io/docs/tasks/configure-pod-container/assign-memory-resource/

Dave McLean:
Sorry, I meant using k explain but also that page does not show how to assign storage resources for a persistentVolumeClaim , and doesn’t show that the correct object hierachy is:

resources:
  requests:
    storage:      &lt;--- how do I know to put the storage key in?

In a similar vein the syntax for specifying the capacity of a persistent volume is like:

spec:
  capacity:
    storage:     &lt;---- how do I know to put the storage key here too? It doesn't seem to appear in the docs

Dave McLean:
I think it’s a bug in the docs?

unnivkn:
Looks like in k8s pv, pvc documentation there is no examples with storage: Mi, instead every where they refer Gi. In case if you get a question in the exam, they will provide exact information. eg: 50Mi or 1Gi etc

chris resnik:
I think this is where keeping well-sorted bookmarks comes in handy

chris resnik:
k explain is great but only if you have time and already know what you need…. like man pages that can be cryptic at the best of times

chris resnik:
when in doubt, check the documentation on kubernetes . io and check an example

chris resnik:
but it’s a fair question, Dave

chris resnik:
i’ve been asking myself these questions, too