-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Context:
Currently, when we create a manager, we have the ability to specify the CertDir which contains the server key and certificate. However, this comes with a clause that the server key and certificate files should be named as tls.key and tls.crt, respectively.
Eg:
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
MetricsBindAddress: metricsAddr,
Port: 9443,
LeaderElection: enableLeaderElection,
LeaderElectionID: "86f835c3.example.com",
CertDir: "/apiserver.local.config/certificates",
})
In this example, /apiserver.local.config/certificates directory is expected to have tls.key and tls.cert
Problem:
Operator SDK intends to support OLM for creating and managing of Webhooks. Currently, OLM does not use cert manager, and creates self signed certificates for all the deployments mentioned in the CRD. The OLM uses the API Service logic, and hence the server key and certificates are named as apiserver.key and apiserver.cert.
Issue:
When we use OLM to manage operators built using SDK, we need not create a webhook server manually. However, while using controller-runtime's SetupWebhook, the manager looks for the certificates mentioned above during the initial setup. Though there is an option provided for specifying the directory path of the certificates, there is no flexibility in mentioning the name of the files.
Having the flexibility of specifying the name of the server key and certificate would be helpful.