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

Update namespace controller to use the metadata client #78744

Merged
merged 3 commits into from Jul 11, 2019

Conversation

@smarterclayton
Copy link
Contributor

commented Jun 5, 2019

The namespace controller currently uses dynamic client and JSON to perform operations only on resource metadata. This PR changes the namespace controller to use the metadata client - a client that uses the server-side conversion logic to retrieve only the metadata about the object in protobuf - to more efficiently interact with the server.

Built on #77819 and #78743

Part of https://github.com/kubernetes/enhancements/blob/master/keps/sig-api-machinery/20190322-server-side-get-to-ga.md

/kind cleanup

The namespace controller has been updated to use the metadata client which improves memory
and CPU usage of the Kube controller manager.

@k8s-ci-robot k8s-ci-robot requested review from brendandburns and deads2k Jun 5, 2019

@smarterclayton smarterclayton changed the title The namespace controller currently uses dynamic client and JSON to perform operations only on resource metadata. This PR changes the namespace controller to use the metadata client - a client that uses the server-side conversion logic to retrieve only the metadata about the object in protobuf - to more efficiently interact with the server. Update namespace controller to use the metadata client Jun 5, 2019

@smarterclayton smarterclayton force-pushed the smarterclayton:client_ns branch from f3f0f5b to d0f8099 Jun 5, 2019

@smarterclayton smarterclayton force-pushed the smarterclayton:client_ns branch 5 times, most recently from c393856 to 18b5bef Jun 5, 2019

@fedebongio

This comment has been minimized.

Copy link
Contributor

commented Jun 6, 2019

/assign @cheftako

@smarterclayton smarterclayton force-pushed the smarterclayton:client_ns branch from 18b5bef to c0747ca Jun 24, 2019

@@ -498,6 +498,7 @@ staging/src/k8s.io/client-go/kubernetes/typed/core/v1
staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake
staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake
staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake
staging/src/k8s.io/client-go/metadata/fake

This comment has been minimized.

Copy link
@cheftako

cheftako Jun 25, 2019

Member

Can we just fix the lint errors and not add to the tech debt?

This comment has been minimized.

Copy link
@smarterclayton

smarterclayton Jun 29, 2019

Author Contributor

Lint on fake is pushing the line of what I consider debt. Just because lint suggests it doesn’t mean it really deserves the effort - in this case, godoc on fakes for documented interfaces that are consistent across the codebase and only used in tests is something that may never justify the investment.

@smarterclayton smarterclayton force-pushed the smarterclayton:client_ns branch from c0747ca to 01bffc9 Jul 8, 2019

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Jul 8, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: smarterclayton

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@smarterclayton

This comment has been minimized.

Copy link
Contributor Author

commented Jul 8, 2019

@derekwaynecarr if you want to look at namespace controller changes as well

@smarterclayton smarterclayton force-pushed the smarterclayton:client_ns branch from 01bffc9 to efb2377 Jul 10, 2019

@smarterclayton

This comment has been minimized.

Copy link
Contributor Author

commented Jul 10, 2019

Updated, PTAL

smarterclayton added some commits Apr 3, 2019

Fake ObjectReaction should handle PartialObjectMetadata special
When a client requests a PartialObjectMetadata returned from the
ObjectReaction type, if the object has a GVK set use that instead
of what the schema returns, since the majority of clients getting
partial object metadata will be doing so using the metadata client
or server side conversion.
Add fake client, informer factory, and lister to metadata client
These will be used by the garbage collector controller and others that
use higher level primitives.
Switch the namespace controller to use the metadata client
The metadata client uses protobuf and returns only a subset of object
data (the metadata) which allows operations that act only on objects
generically to work much faster. Use the metadata client in the
namespace controller to reduce the amount of work the namespace controller
has to do in large namespaces.

@smarterclayton smarterclayton force-pushed the smarterclayton:client_ns branch from efb2377 to 50fd472 Jul 10, 2019

@smarterclayton

This comment has been minimized.

Copy link
Contributor Author

commented Jul 10, 2019

/retest

@liggitt

This comment has been minimized.

Copy link
Member

commented Jul 10, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm label Jul 10, 2019

@k8s-ci-robot k8s-ci-robot merged commit ca6cc69 into kubernetes:master Jul 11, 2019

22 of 23 checks passed

pull-kubernetes-kubemark-e2e-gce-big Job triggered.
Details
cla/linuxfoundation smarterclayton authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-conformance-image-test Skipped.
pull-kubernetes-cross Skipped.
pull-kubernetes-dependencies Job succeeded.
Details
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-csi-serial Skipped.
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gce-iscsi Skipped.
pull-kubernetes-e2e-gce-iscsi-serial Skipped.
pull-kubernetes-e2e-gce-storage-slow Skipped.
pull-kubernetes-godeps Skipped.
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-local-e2e Skipped.
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-node-e2e-containerd Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
pull-publishing-bot-validate Skipped.
tide In merge pool.
Details

@liggitt liggitt added this to the v1.16 milestone Aug 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.