Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to use 'kubectl explain' to crd's substance. #82407

Closed
seaurching opened this issue Sep 6, 2019 · 9 comments
Closed

how to use 'kubectl explain' to crd's substance. #82407

seaurching opened this issue Sep 6, 2019 · 9 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one.

Comments

@seaurching
Copy link

Hi, dear authors:
I have an enhancement request of kubernetes's cli-->kubectl explain. Recently, I deploy to k8s clusters called master1 and master2. And has deployed the federation v2.
Now I want to see the federation's kinds like FederatedDeployment's substance. Just like this

[root@master1 Desktop]# kubectl explain deployment.spec --recursive
KIND:     Deployment
VERSION:  extensions/v1beta1
RESOURCE: spec <Object>
DESCRIPTION:
     Specification of the desired behavior of the Deployment.
     DeploymentSpec is the specification of the desired behavior of the
     Deployment.
FIELDS:
   minReadySeconds	<integer>
   paused	<boolean>
   progressDeadlineSeconds	<integer>
   replicas	<integer>
   revisionHistoryLimit	<integer>
   rollbackTo	<Object>
      revision	<integer>
   selector	<Object>
      matchExpressions	<[]Object>
         key	<string>
         operator	<string>
         values	<[]string>
........

While I excute this kinds of command to show the resource federatedDeployment, it show:

[root@master1 Desktop]# kubectl explain federateddeployment --recursive
error: Couldn't find resource for "types.kubefed.io/v1beta1, Kind=FederatedDeployment"

Please tell me how to show the custom-resource-definitions apiservice like federation's federateddeployment or istio's virtualservice and gateway, each of them's substance for write some configuration to yaml file to deploy it with "kubectl apply -f"

Sometimes ago, I see the gitcommit messages says: "it support to use kubectl explain" to show crd. And is this functionality implemented now?

@seaurching seaurching added the kind/feature Categorizes issue or PR as related to a new feature. label Sep 6, 2019
@k8s-ci-robot k8s-ci-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Sep 6, 2019
@k8s-ci-robot
Copy link
Contributor

@qiyongxiao: There are no sig labels on this issue. Please add a sig label by either:

  1. mentioning a sig: @kubernetes/sig-<group-name>-<group-suffix>
    e.g., @kubernetes/sig-contributor-experience-<group-suffix> to notify the contributor experience sig, OR

  2. specifying the label manually: /sig <group-name>
    e.g., /sig scalability to apply the sig/scalability label

Note: Method 1 will trigger an email to the group. See the group list.
The <group-suffix> in method 1 has to be replaced with one of these: bugs, feature-requests, pr-reviews, test-failures, proposals.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@liggitt
Copy link
Member

liggitt commented Sep 6, 2019

starting in v1.15.0, custom resource definitions that specify structural schemas will publish OpenAPI schema documentation, which is what kubectl explain uses.

/close

@k8s-ci-robot
Copy link
Contributor

@liggitt: Closing this issue.

In response to this:

starting in v1.15.0, custom resource definitions that specify structural schemas will publish OpenAPI schema documentation, which is what kubectl explain uses.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@seaurching
Copy link
Author

starting in v1.15.0, custom resource definitions that specify structural schemas will publish OpenAPI schema documentation, which is what kubectl explain uses.

/close

It is empty?

[root@master1 ~]# kubectl explain federateddeployments
KIND:     FederatedDeployment
VERSION:  types.kubefed.io/v1beta1

DESCRIPTION:
     <empty>
[root@master1 ~]# 

@liggitt
Copy link
Member

liggitt commented Sep 7, 2019

check the CRD API object status to see if there is a non-structural condition that needs to be corrected before openapi will be published

@wonderflow
Copy link

Some issue here, I did't see any non-structural condition.

status:
  acceptedNames:
    categories:
    - crossplane
    - oam
    kind: ManualScalerTrait
    listKind: ManualScalerTraitList
    plural: manualscalertraits
    singular: manualscalertrait
  conditions:
  - lastTransitionTime: "2020-05-07T08:54:19Z"
    message: no conflicts found
    reason: NoConflicts
    status: "True"
    type: NamesAccepted
  - lastTransitionTime: "2020-05-07T08:54:26Z"
    message: the initial names have been accepted
    reason: InitialNamesAccepted
    status: "True"
    type: Established
  storedVersions:

But get nothing:

kubectl explain manualscalertraits
KIND:     ManualScalerTrait
VERSION:  core.oam.dev/v1alpha2

DESCRIPTION:
     <empty>

@shay-berman
Copy link

what is the resolution of this ticket?

@seaurching
Copy link
Author

what is the resolution of this ticket?

is still unresolution

@KevinJoiner
Copy link

I was able to fix this by removing x-kubernetes-preserve-unknown-fields: true from my CRD spec since this will cause an empty output when used with kubectl explain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

6 participants