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

Drop the sigs.k8s.io/metrics-server dependency #8

Merged

Conversation

ialidzhikov
Copy link
Collaborator

How to categorize this PR?

/area auto-scaling
/kind cleanup

What this PR does / why we need it:
According to my testing the sigs.k8s.io/metrics-server is not required for the custom-metrics-apiserver to function properly.

I build an image with the changes from this PR. Then I applied the resources from the example dir to existing Seed cluster in Gardener's well know local setup. After that I queried the custom metrics with:

% kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta2/namespaces/shoot--local--local/pods/*/shoot:apiserver_request_total:sum" | jq

Which issue(s) this PR fixes:
Part of #5

Special notes for your reviewer:
N/A

Release note:

NONE

@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Mar 19, 2024
@gardener-robot gardener-robot added area/auto-scaling Auto-scaling (CA/HPA/VPA/HVPA, predominantly control plane, but also otherwise) related kind/cleanup Something that is not needed anymore and can be cleaned up needs/review Needs review size/s Size of pull request is small (see gardener-robot robot/bots/size.py) labels Mar 19, 2024
@gardener-robot-ci-1 gardener-robot-ci-1 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Mar 19, 2024
Copy link
Contributor

@andrerun andrerun left a comment

Choose a reason for hiding this comment

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

Nice!

@ialidzhikov
Copy link
Collaborator Author

I see that starting [email protected], it provides a default OpenAPIConfig. See kubernetes-sigs/custom-metrics-apiserver#110
So, when upgrading to latest custom-metrics-apiserver I suppose we will be able to drop https://github.com/gardener/gardener-custom-metrics/blob/0d2a6f9c3459466b2e2b324f98a9a5116524e337/pkg/metrics_provider/metrics_provider_service.go#L48-L50 - it should set up OpenAPIConfig with the custom_metics types only kubernetes-sigs/custom-metrics-apiserver@d5eaee4#diff-f52b163a3618ca2c9192c6d45f6b154277a2004b34b9b1ecf587baaf51f47780R31-R41.

@ialidzhikov ialidzhikov marked this pull request as ready for review March 21, 2024 14:07
@ialidzhikov ialidzhikov requested a review from a team as a code owner March 21, 2024 14:07
@ialidzhikov ialidzhikov force-pushed the enh/drop-metrics-server-dep branch from 0d2a6f9 to ee3302d Compare March 21, 2024 15:52
@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Mar 21, 2024
@ialidzhikov ialidzhikov requested a review from andrerun March 21, 2024 15:53
@gardener-robot-ci-2 gardener-robot-ci-2 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Mar 21, 2024
@ialidzhikov ialidzhikov merged commit c9cea6d into gardener-attic:main Mar 22, 2024
7 checks passed
@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label Mar 22, 2024
@ialidzhikov ialidzhikov deleted the enh/drop-metrics-server-dep branch March 22, 2024 10:25
andrerun pushed a commit that referenced this pull request Mar 26, 2024
* Drop the replace for k8s.io/client-go

* Drop the sigs.k8s.io/metrics-server dependency
ialidzhikov added a commit to ialidzhikov/gardener-custom-metrics that referenced this pull request Mar 27, 2024
ialidzhikov added a commit to ialidzhikov/gardener-custom-metrics that referenced this pull request Mar 28, 2024
ialidzhikov added a commit to ialidzhikov/gardener-custom-metrics that referenced this pull request Mar 28, 2024
ialidzhikov added a commit to ialidzhikov/gardener-custom-metrics that referenced this pull request Mar 31, 2024
ialidzhikov added a commit to ialidzhikov/gardener-custom-metrics that referenced this pull request Apr 2, 2024
ialidzhikov added a commit to ialidzhikov/gardener-custom-metrics that referenced this pull request Apr 4, 2024
ialidzhikov added a commit to ialidzhikov/gardener-custom-metrics that referenced this pull request Apr 5, 2024
ialidzhikov added a commit to ialidzhikov/gardener-custom-metrics that referenced this pull request Apr 5, 2024
ialidzhikov added a commit to ialidzhikov/gardener-custom-metrics that referenced this pull request Apr 8, 2024
ialidzhikov added a commit that referenced this pull request Apr 10, 2024
…0.16` (#14)

* [prerequisite] Drop the unused client field from the actuators

* [prerequisite] Drop dependency injection funcs

* Upgrade `k8s.io/*` to `v0.28`, `sigs.k8s.io/controller-runtime` to `v0.16`

* Adapt to the breaking change in the manager.Options struct

* Adapt to the breaking change how the watch is being set up

* Use the upstream fake client instead of a custom fake manager

* Drop unit tests for AddNewControllerToManager

* Use k8s.io/utils/ptr instead of the deprecated k8s.io/utils/pointer pkg

* Use the upstream fake client instead of the custom fake client

* Drop the custom fake client

* Drop the fake manager

* Use consistent naming for the manager

* Drop custom OpenAPIConfig instead of the default one from custom-metrics-apiserver

See #8 (comment)

* Adapt to the breaking change how the cache is restricted to object with label selectors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/auto-scaling Auto-scaling (CA/HPA/VPA/HVPA, predominantly control plane, but also otherwise) related kind/cleanup Something that is not needed anymore and can be cleaned up needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/review Needs review size/s Size of pull request is small (see gardener-robot robot/bots/size.py) status/closed Issue is closed (either delivered or triaged)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants