user630702
user630702

Reputation: 3097

Kubernetes Documentation or API reference

I seem to find it hard to quickly lookup something in k8s docs or api reference. Terraform docs are very clear to understand.

How do one find what's the child element for parent? For example, for PV Claim resources needs a child requests but its not described anywhere except in example in this link, but there aren't examples for everything.

Either I'm looking at the wrong docs or I'm not doing proper research. I wonder what's the proper way or what I should know before checking the docs.

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: myclaim
spec:
  accessModes:
    - ReadWriteOnce
  volumeMode: Filesystem
  resources:
    requests:
      storage: 8Gi

Upvotes: 0

Views: 94

Answers (1)

Jonas
Jonas

Reputation: 128807

I seem to find it hard to quickly lookup something in k8s docs or api reference. Terraform docs are very clear to understand.

The fastest and easiest way to quickly get documentation about Kubernetes resources is to use kubectl explain <resource> e.g:

kubectl explain PersistentVolumeClaim.spec.resources

In this case with output like:

KIND:     PersistentVolumeClaim
VERSION:  v1

RESOURCE: resources <Object>

DESCRIPTION:
     Resources represents the minimum resources the volume should have. More
     info:
     https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources

     ResourceRequirements describes the compute resource requirements.

FIELDS:
   limits   <map[string]string>
     Limits describes the maximum amount of compute resources allowed. More
     info:
     https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/

   requests <map[string]string>
     Requests describes the minimum amount of compute resources required. If
     Requests is omitted for a container, it defaults to Limits if that is
     explicitly specified, otherwise to an implementation-defined value. More
     info:
     https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/

Then you get a good description of available fields. But as you say, it is not very clear what fields is needed in this case.

Upvotes: 1

Related Questions