-
Notifications
You must be signed in to change notification settings - Fork 39
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
Discontinue kube-rbac-proxy and disable metrics service #721
Conversation
Testing1. Access
|
TLSOpts: tlsOpts, | ||
} | ||
|
||
if secureMetrics { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why someone will use insecure metrics, cant we always use secureMetircs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is enabled by default. The reason why it is controlled by a flag of its own is, in prod env it is recommended to setup proper certs and keys before opting in for secure metrics.
If someone does not want to do that and just wants to check something, they may disable it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you document the steps to provide certificates, so that production deployments may replace automatic generated ones?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -128,8 +135,27 @@ func main() { | |||
os.Exit(1) | |||
} | |||
|
|||
disableHTTP2 := func(config *tls.Config) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this one for test clusters or means for production clusters also?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Production clusters as well. As of now, curl
misses support for HTTP2 on some distros. We can enable it by default once we are sure that all the clients support HTTP2.
Kubebuilder's default scaffolding also follows the same procedure as of now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good overall, just a few nits regarding comments and documentation
@@ -128,8 +135,27 @@ func main() { | |||
os.Exit(1) | |||
} | |||
|
|||
disableHTTP2 := func(config *tls.Config) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please leave a comment in the code why it is disabled by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
TLSOpts: tlsOpts, | ||
} | ||
|
||
if secureMetrics { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you document the steps to provide certificates, so that production deployments may replace automatic generated ones?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on other thought, Do we need the metrics? if not lets disable it?
It is enabled in all of the other projects by default. Still, we could disable it if not needed. Thoughts @nixpanic ? |
Metrics enabled by default is fine, I think. However, the metrics should be useful though. Not sure what the metrics contain, and if there is anything related to the CSI-Addons procedures. If it is only minor things, calling it "metrics for kubernetes-csi-addons" would not really be correct. In that case, the usefulness for the project is little, and disabling sets more appropriate expectations for users. |
It includes these metrics and also the metrics for all the CRs that are reconciled by the controllers. |
In that case, disable it by default. These are not metrics about CSI-Addons procedures, it is too incomplete for that. Once we add metrics about the different CSI-Addons procedures, it can be enabled by default. |
343da07
to
65189b6
Compare
The metrics service is now disabled by default (by setting its bind address to 0). In order to enable it,
#- metrics_service.yaml
#patches:
#- path: manager_metrics_patch.yaml
# target:
# kind: Deployment
# The following RBAC configurations are used to protect
# the metrics endpoint with authn/authz. These configurations
# ensure that only authorized users and service accounts
# can access the metrics endpoint.
# - metrics_auth_role.yaml
# - metrics_auth_role_binding.yaml
# - metrics_reader_role.yaml
# - metrics_reader_role_binding.yaml |
@@ -138,7 +174,8 @@ func main() { | |||
RenewDeadline: &leaderElectionRenewDeadline, | |||
RetryPeriod: &leaderElectionRetryPeriod, | |||
WebhookServer: webhook.NewServer(webhook.Options{ | |||
Port: 9443, | |||
Port: 9443, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might not need webhook server as well, lets check and address this in followup as well.
This patch drops support for kube-rbac-proxy and uses controller manager's WithAuthenticationAndAuthorization. Closes: csi-addons#643 Signed-off-by: Niraj Yadav <[email protected]>
Signed-off-by: Niraj Yadav <[email protected]>
65189b6
to
2142a14
Compare
This patch drops support for kube-rbac-proxy
and uses controller manager's
WithAuthenticationAndAuthorization.
Closes: #643
For more details please refer here
In addition to migration, some of the resources have been re-categorized for better placement and the metrics service is now disabled by default as it did not contain any significant information specific to csi-addons. It can be re-enabled by following the steps outlined in #721 (comment)