kubeplus icon indicating copy to clipboard operation
kubeplus copied to clipboard

Show property comments in kubectl explain of new CRD

Open devdattakulkarni opened this issue 1 year ago • 1 comments

KubePlus generates OpenAPI schema from values.yaml of the helm chart when registering the CRD. Right now we are ignoring the comments in the values.yaml. Because of this when we use 'kubectl explain' on the CRD, we do not see any comments about the attributes in the Spec definition. We should update the CRD registration to use the comments available in values.yaml when registering the OpenAPI schema definition.

As an alternative, you can use the 'kubectl man' plugin. It displays the values.yaml as part of the spec properties of CRD.

devdattakulkarni avatar Mar 24 '23 19:03 devdattakulkarni

This requires understanding of OpenAPI schema, how it is used in Kubernetes, and how KubePlus is generating the OpenAPI schema for the generated CRD.

KubePlus specific changes will be in deploy/kubeconfiggenerator.py, specifically the "registercrd" method.

devdattakulkarni avatar Apr 16 '24 11:04 devdattakulkarni