@@ -35,7 +35,7 @@ import (
3535 metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
3636 "sigs.k8s.io/controller-runtime/pkg/webhook"
3737
38- clustersv1alpha1 "go.etcd.io/etcd-operator/api/v1alpha1"
38+ operatorv1alpha1 "go.etcd.io/etcd-operator/api/v1alpha1"
3939 "go.etcd.io/etcd-operator/internal/controller"
4040 // +kubebuilder:scaffold:imports
4141)
4848func init () {
4949 utilruntime .Must (clientgoscheme .AddToScheme (scheme ))
5050
51- utilruntime .Must (clustersv1alpha1 .AddToScheme (scheme ))
51+ utilruntime .Must (operatorv1alpha1 .AddToScheme (scheme ))
5252 // +kubebuilder:scaffold:scheme
5353}
5454
@@ -98,26 +98,24 @@ func main() {
9898
9999 // Metrics endpoint is enabled in 'config/default/kustomization.yaml'. The Metrics options configure the server.
100100 // More info:
101- // - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.19.0 /pkg/metrics/server
101+ // - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.19.1 /pkg/metrics/server
102102 // - https://book.kubebuilder.io/reference/metrics.html
103103 metricsServerOptions := metricsserver.Options {
104104 BindAddress : metricsAddr ,
105105 SecureServing : secureMetrics ,
106- // TODO(user): TLSOpts is used to allow configuring the TLS config used for the server. If certificates are
107- // not provided, self-signed certificates will be generated by default. This option is not recommended for
108- // production environments as self-signed certificates do not offer the same level of trust and security
109- // as certificates issued by a trusted Certificate Authority (CA). The primary risk is potentially allowing
110- // unauthorized access to sensitive metrics data. Consider replacing with CertDir, CertName, and KeyName
111- // to provide certificates, ensuring the server communicates using trusted and secure certificates.
112- TLSOpts : tlsOpts ,
106+ TLSOpts : tlsOpts ,
113107 }
114108
115109 if secureMetrics {
116110 // FilterProvider is used to protect the metrics endpoint with authn/authz.
117111 // These configurations ensure that only authorized users and service accounts
118112 // can access the metrics endpoint. The RBAC are configured in 'config/rbac/kustomization.yaml'. More info:
119- // https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.19.0 /pkg/metrics/filters#WithAuthenticationAndAuthorization
113+ // https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.19.1 /pkg/metrics/filters#WithAuthenticationAndAuthorization
120114 metricsServerOptions .FilterProvider = filters .WithAuthenticationAndAuthorization
115+
116+ // TODO(user): If CertDir, CertName, and KeyName are not specified, controller-runtime will automatically
117+ // generate self-signed certificates for the metrics server. While convenient for development and testing,
118+ // this setup is not recommended for production.
121119 }
122120
123121 mgr , err := ctrl .NewManager (ctrl .GetConfigOrDie (), ctrl.Options {
0 commit comments