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

[feat] Remove kube-rbac-proxy to expose metrics and replace it with current best practice #556

Merged
merged 19 commits into from
Oct 31, 2024

Conversation

komer3
Copy link
Contributor

@komer3 komer3 commented Oct 28, 2024

Current way exposing metrics for the controller has changed and we no longer should be using kube-rbac-proxy. For more info: https://book.kubebuilder.io/reference/metrics.html

As part of this PR, I refactored the main() and moved flag parsing, setting up manager, setting up controllers, etc into their own functions for better readability and maintainability.

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

Copy link

codecov bot commented Oct 28, 2024

Codecov Report

Attention: Patch coverage is 0.75188% with 132 lines in your changes missing coverage. Please review.

Project coverage is 64.79%. Comparing base (c184c1e) to head (f17e154).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/main.go 0.75% 132 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #556      +/-   ##
==========================================
- Coverage   64.92%   64.79%   -0.13%     
==========================================
  Files          79       79              
  Lines        5622     5633      +11     
==========================================
  Hits         3650     3650              
- Misses       1697     1708      +11     
  Partials      275      275              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@komer3 komer3 marked this pull request as ready for review October 29, 2024 17:07
cmd/main.go Outdated Show resolved Hide resolved
@AshleyDumaine AshleyDumaine self-requested a review October 30, 2024 14:52
cmd/main.go Outdated Show resolved Hide resolved
@AshleyDumaine
Copy link
Member

LGTM aside from the above minor comment

AshleyDumaine
AshleyDumaine previously approved these changes Oct 30, 2024
AshleyDumaine
AshleyDumaine previously approved these changes Oct 30, 2024
AshleyDumaine
AshleyDumaine previously approved these changes Oct 30, 2024
kind: NetworkPolicy
metadata:
labels:
app.kubernetes.io/name: output-dir
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit pick: I wonder if we want to add a label as app.kubernetes.io/name: output-dir

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh good catch. Let me remove that!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated!

AshleyDumaine
AshleyDumaine previously approved these changes Oct 31, 2024
Copy link
Collaborator

@rahulait rahulait left a comment

Choose a reason for hiding this comment

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

LGTM

@komer3 komer3 merged commit e20f97d into main Oct 31, 2024
11 of 13 checks passed
@komer3 komer3 deleted the remove-kube-rbac-proxy branch October 31, 2024 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants