1

I am studying "kubectl describe" sourcecodes at https://github.com/kubernetes/kubectl/blob/master/pkg/describe/describe.go

However, I still could not figure out how "kubectl decsribe [CRD]" works (as in which function/functions are called).

I am a Go newbie, so would like to get some pointers please. Thanks.

I have read describePod function and understand how it works more or less, but still could not figure out how "kubectl describe [CRD]" works.

Jonas
  • 121,568
  • 97
  • 310
  • 388
Daniel Yeap
  • 17
  • 1
  • 4

2 Answers2

1

The "kubectl describe " function can be found in the command-line interface (CLI) of Kubernetes, specifically in the "kubectl" tool. "kubectl" is used to manage and interact with a Kubernetes cluster and its resources. enter image description here

wikijay
  • 11
  • 3
0

Kubectl describe command helps to view the entire information about the kubernetes resources like Pods,deployments,services,nodes,jobs etc.

By using CRD(Custom Resource Definition) you can do CRUD operations like create, update, get and delete commands to access the resources. To use CRD we need to use the API groups.

Example:

Suppose you specify an API group as example.crd.com, which means you can issue the get, list, create, update, and delete commands to access the custom resources under the API group example.crd.com. You can use kubectl describe crd <crd_name> to get a description of the CRD.

For more information refer this official doc

Try this similar SO’s SO1 and SO2 for more information