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

Implement bundle APIs and corresponding command in Antctl #694

Merged
merged 2 commits into from
May 29, 2020

Conversation

weiqiangt
Copy link
Contributor

@weiqiangt weiqiangt commented May 8, 2020

  • Add system.antrea.tanzu.vmware.com/v1beta1/bundles API
      on both agent APIServer and controller APIServer for
      generating support bundles.
  • Add system.antrea.tanzu.vmware.com/v1beta1/bundles/download
      for downloading bundles.
  • Add related unit tests and e2e tests.
  • Antctl Command for collecting bundles.

Resolves #703.

Signed-off-by: Weiqiang TANG [email protected]

@weiqiangt weiqiangt added area/api Issues or PRs related to an API. size/XL Denotes a PR that changes 500+ lines, ignoring generated files. labels May 8, 2020
@antrea-bot
Copy link
Collaborator

Thanks for your PR.
Unit tests and code linters are run automatically every time the PR is updated.
E2e, conformance and network policy tests can only be triggered by a member of the vmware-tanzu organization. Regular contributors to the project should join the org.

The following commands are available:

  • /test-e2e: to trigger e2e tests.
  • /skip-e2e: to skip e2e tests.
  • /test-conformance: to trigger conformance tests.
  • /skip-conformance: to skip conformance tests.
  • /test-networkpolicy: to trigger networkpolicy tests.
  • /skip-networkpolicy: to skip networkpolicy tests.
  • /test-all: to trigger all tests.
  • /skip-all: to skip all tests.

These commands can only be run by members of the vmware-tanzu organization.

Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't finished review yet

pkg/apis/system/v1beta1/types.go Outdated Show resolved Hide resolved
pkg/apiserver/registry/system/bundle/dump.go Outdated Show resolved Hide resolved
pkg/apiserver/registry/system/bundle/dump.go Outdated Show resolved Hide resolved
Copy link
Contributor

@jianjuns jianjuns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A general question on the design - if the bundle lifecycle is decided by the client, should we do REST like API and support create, delete, and get (download) against a single path like: /support-bundles/, instead of a separate path for downloading under: /support-bundles/download/?
@tnqn @edwardbadboy

test/e2e/bundle_test.go Outdated Show resolved Hide resolved
pkg/apiserver/registry/system/bundle/dump.go Outdated Show resolved Hide resolved
pkg/apiserver/registry/system/bundle/dump.go Outdated Show resolved Hide resolved
pkg/apiserver/registry/system/bundle/dump.go Outdated Show resolved Hide resolved
pkg/apis/system/v1beta1/types.go Outdated Show resolved Hide resolved
pkg/apis/system/v1beta1/types.go Outdated Show resolved Hide resolved
@weiqiangt weiqiangt force-pushed the weiqiangt/bundle-api branch 3 times, most recently from 11804ac to be9f7f2 Compare May 20, 2020 05:52
Copy link
Contributor

@jianjuns jianjuns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did not review all code yet, but two quick comments.

pkg/apis/system/v1beta1/types.go Outdated Show resolved Hide resolved
pkg/ovs/vsctl/vsctl.go Outdated Show resolved Hide resolved
pkg/agent/util/dump.go Outdated Show resolved Hide resolved
@weiqiangt weiqiangt force-pushed the weiqiangt/bundle-api branch 2 times, most recently from 94db71f to c653212 Compare May 21, 2020 15:48
pkg/apis/system/v1beta1/types.go Outdated Show resolved Hide resolved
pkg/ovs/ovsctl/appctl.go Outdated Show resolved Hide resolved
pkg/util/dump.go Outdated Show resolved Hide resolved
pkg/apiserver/registry/system/bundle/rest.go Outdated Show resolved Hide resolved
@jianjuns
Copy link
Contributor

@weiqiangt @tnqn : are we able to get this one in 0.7.0?

@weiqiangt weiqiangt force-pushed the weiqiangt/bundle-api branch 3 times, most recently from ab9a364 to bda9cf6 Compare May 22, 2020 10:23
Copy link
Contributor

@jianjuns jianjuns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. I did not understand why there are two set of funcs for agent that implement the same functionalities. Could you check my question below?

pkg/agent/util/dump.go Outdated Show resolved Hide resolved
pkg/agent/apiserver/handlers/bundle/handler.go Outdated Show resolved Hide resolved
@weiqiangt
Copy link
Contributor Author

/test-all

jianjuns
jianjuns previously approved these changes May 28, 2020
pkg/antctl/raw/supportbundle/command.go Show resolved Hide resolved
@weiqiangt
Copy link
Contributor Author

/test-all

pkg/apiserver/registry/system/supportbundle/rest.go Outdated Show resolved Hide resolved
pkg/ovs/ovsctl/vsctl.go Outdated Show resolved Hide resolved
@weiqiangt weiqiangt force-pushed the weiqiangt/bundle-api branch 2 times, most recently from aeeb992 to 62aaaac Compare May 28, 2020 05:24
@weiqiangt
Copy link
Contributor Author

/test-all

tnqn
tnqn previously approved these changes May 28, 2020
Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some typos I must have missed in my first review, along with one question

otherwise code LGTM, I think all my previous comments were addressed

pkg/antctl/raw/supportbundle/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/supportbundle/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/supportbundle/command.go Outdated Show resolved Hide resolved
pkg/antctl/raw/supportbundle/command.go Show resolved Hide resolved
kubeconfig.APIPath = "/apis"
kubeconfig.GroupVersion = &systemv1beta1.SchemeGroupVersion
kubeconfig.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
kubeconfig.Insecure = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tnqn @weiqiangt
A bit of a last-minute question, is this only needed for the self-signed certificate case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid not. There is no server verification function in Antctl for now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If antctl talks to kube-apiserver, it should use the K8s CA cert set in kubeconfig to verify kube-apiserver, and kube-apiserver will then start a new HTTPS request against antrea-controller and use CABundle in APIServices to verify it.
But support bundle command goes to antrea-controller and antrea-agent directly, we can probably read antrea-ca ConfigMap to verify antrea-controller, but we don't publish antrea-agent's self-signed cert yet, so no way to verify them for now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the clarification @tnqn.

@weiqiangt / @tnqn do you think you could open an issue to track this? I don't know if you have a solution / long-term plan in mind already.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just created one #758.

test/e2e/supportbundle_test.go Outdated Show resolved Hide resolved
pkg/support/dump.go Outdated Show resolved Hide resolved
pkg/support/dump.go Outdated Show resolved Hide resolved
@antoninbas antoninbas added this to the Antrea v0.7.0 release milestone May 28, 2020
Implement `antctl bundle` command for collecting bundle via CLI

Signed-off-by: Weiqiang TANG <[email protected]>
Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@weiqiangt
Copy link
Contributor Author

/test-all

@weiqiangt
Copy link
Contributor Author

/test-e2e

@weiqiangt
Copy link
Contributor Author

/test-conformance

1 similar comment
@weiqiangt
Copy link
Contributor Author

/test-conformance

@weiqiangt
Copy link
Contributor Author

/test-e2e

@weiqiangt
Copy link
Contributor Author

/test-networkpolicy

@lzhecheng
Copy link
Contributor

/test-conformance
/test-e2e
/test-networkpolicy

@weiqiangt weiqiangt merged commit 2e084e0 into antrea-io:master May 29, 2020
McCodeman pushed a commit to McCodeman/antrea that referenced this pull request Jun 2, 2020
)

- Add system.antrea.tanzu.vmware.com/v1beta1/bundles API
   on both agent APIServer and controller APIServer for
   generating support bundles.
- Add system.antrea.tanzu.vmware.com/v1beta1/bundles/download
   for downloading bundles.
- Add related unit tests and e2e tests.
- An antctl command for collecting bundles.

Resolves antrea-io#703.

Signed-off-by: Weiqiang TANG <[email protected]>
McCodeman pushed a commit that referenced this pull request Jun 2, 2020
- Add system.antrea.tanzu.vmware.com/v1beta1/bundles API
   on both agent APIServer and controller APIServer for
   generating support bundles.
- Add system.antrea.tanzu.vmware.com/v1beta1/bundles/download
   for downloading bundles.
- Add related unit tests and e2e tests.
- An antctl command for collecting bundles.

Resolves #703.

Signed-off-by: Weiqiang TANG <[email protected]>
GraysonWu pushed a commit to GraysonWu/antrea that referenced this pull request Sep 22, 2020
)

- Add system.antrea.tanzu.vmware.com/v1beta1/bundles API
   on both agent APIServer and controller APIServer for
   generating support bundles.
- Add system.antrea.tanzu.vmware.com/v1beta1/bundles/download
   for downloading bundles.
- Add related unit tests and e2e tests.
- An antctl command for collecting bundles.

Resolves antrea-io#703.

Signed-off-by: Weiqiang TANG <[email protected]>
GraysonWu pushed a commit to GraysonWu/antrea that referenced this pull request Sep 23, 2020
)

- Add system.antrea.tanzu.vmware.com/v1beta1/bundles API
   on both agent APIServer and controller APIServer for
   generating support bundles.
- Add system.antrea.tanzu.vmware.com/v1beta1/bundles/download
   for downloading bundles.
- Add related unit tests and e2e tests.
- An antctl command for collecting bundles.

Resolves antrea-io#703.

Signed-off-by: Weiqiang TANG <[email protected]>
@weiqiangt weiqiangt deleted the weiqiangt/bundle-api branch December 24, 2020 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Issues or PRs related to an API. size/XL Denotes a PR that changes 500+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement APIs for collecting debug information
8 participants