Skip to content

Commit 6c480ea

Browse files
Provide CertManager certificates for the metrics service.
If certificates are not provided, the metrics service offered by controller-runtime will default to using its own self-signed certificates. While functional, relying on those self-signed certs is not recommended for production environments due to security reasons.
1 parent 99d4973 commit 6c480ea

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cmd/manager/main.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,13 @@ func main() {
186186
// These configurations ensure that only authorized users and service accounts
187187
// can access the metrics endpoint.
188188
FilterProvider: filters.WithAuthenticationAndAuthorization,
189+
190+
// Ensure that metrics is protected with certs managed by cert-manager
191+
// If not informed, the metrics service provided by controller-runtime will generate
192+
// and use its own self-assigned certs which is not recommended for production envs.
193+
CertDir: "/var/certs/",
194+
CertName: "olm-ca.crt",
195+
KeyName: "ca.crt",
189196
}
190197

191198
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{

0 commit comments

Comments
 (0)