Hi all,
I think I need some help considering operator dependencies. I work on
Sandboxed Containers Operator[*] (it uses Kata to run pods within VMs).
We added a validating webhook to it by generating it with operator-sdk.
The operator-sdk-generated webhook relies on cert-manager to manage the
webhook's certificate so our operator now depends on cert-manager.
I'd like to specify cert-manager as a dependency of Sandboxed Container
Operator. To that end, I added the following to our
ClusterServiceVersion:
spec:
required:
- kind: Certificate
name:
certificates.cert-manager.io version: v1alpha2
This does seem to pull in cert-manager when I install our operator via
OperatorHub, however, there seems to be some interaction between our
and cert-manager's installModes.
At the moment, we support OwnNamespace and SingleNamespace while
cert-manager only supports AllNamespaces. With this config, an attemp
to install our operator fails because cert-manager enters a Failed state
with "Failed: OwnNamespace InstallModeType not supported, cannot
configure to watch own namespace".
If I remove the support for the offending OwnNamespace installMode from
our CSV, now OpenShift console won't let me install because you have to
support at least one of a) running in one namespace, b) running in all
namespaces. The check is performed by testing that at least one of
OwnNamespace and AllNamespacess is supported (I found this in the
OpenShift console code).
So, not being able to support OwnNamespace due to cert-manager
requirements, if I turn on AllNamespaces in our CSV at this point,
installation seems to conclude successfully however our operator's
controller manager ends up stuck in CrashLoopBackOff with an error
message that suggests it cannot find a certificate. I think it's worth
pointing out here that although both operators are installed,
cert-manager runs in our operator's namespace for some reason. I
suspect this might a problem because if you inspect cert-manager's
installation .yaml[**] it looks like cert-manager relies on running in
its own namespace (called 'cert-manager').
I'm looking for a way to specify cert-manager as a dependency so that it
runs in its own namespace (note that if I give up on using the
dependency mechanism and just install cert-manager manually and then our
operator, everything works).
Or, more broadly, seeing as operator-sdk's webhooks seem to rely on
cert-manager which is not a standard part of OpenShift clusters, I'm
probably not alone running into this problem - what is the
usual/expected way of dealing with this?
Thanks in advance,
pvl
[*]
https://github.com/openshift/sandboxed-containers-operator [**]
https://github.com/jetstack/cert-manager/releases/download/v1.4.0/cert-manager.yaml