How to package the metric service and serviceMonitor in the CSV manifest file

23 views
Skip to first unread message

Hui Kang

unread,
Nov 13, 2020, 11:06:01 PM11/13/20
to Operator Framework
Hi,
I am developing an operator using operator-sdk 1.1 and would like to expose the metrics of the operator.

When I install the operator with "make deploy", I observe that the metrics service and serviceMonitor are created from the yaml files. However, the CSV file generated by "make bundle" does not contain any content related to the service or serviceMonitor.

My question is that if there is a way to package the metric service and serviceMonitor in the CSV so that I can deploy the operator using OLM. Thanks.

- Hui

Matt Dorn

unread,
Nov 14, 2020, 1:46:27 PM11/14/20
to Hui Kang, Operator Framework
Hi Hui,

This PR [1] addresses your concern by ensuring that the Service and ServiceMonitor objects end up in the OLM bundle's manifest directory. This should now be featured in operator-sdk v1.2.0 release [2].

Many people are surprised to learn that OLM supports dropping additional kube manifests (other than CSV and CRD) into your OLM bundle's manifest directory. OLM will deploy these objects (and set ownerReferences on them) upon Operator install. Here we show support for creation of kind: Service objects if it resides in your bundle's manifests directory [3].

Matt




--
You received this message because you are subscribed to the Google Groups "Operator Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to operator-framew...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/operator-framework/58d86887-89cb-4db9-8e5f-969d84482c44n%40googlegroups.com.

Chris Johnson (IBM)

unread,
Nov 16, 2020, 9:02:36 AM11/16/20
to Operator Framework
Warning:  You need to be careful which resources you add to the Bundle.  If the version of OLM doesn't support that resource, the InstallPlan will fail.  If you need to support older versions of OLM (e.g. OpenShift 4.5), then you'll need to create multiple Bundles and multiple Catalog Index Images for each version of OLM / OpenShift.

Do we have a nice list of supported Kinds by OLM version already documented?  

Daniel Messer

unread,
Nov 16, 2020, 1:10:32 PM11/16/20
to Chris Johnson (IBM), Operator Framework



--
Daniel Messer

Product Manager Operator Framework & Quay

Red Hat OpenShift

Hui Kang

unread,
Nov 16, 2020, 1:22:37 PM11/16/20
to Operator Framework
Thanks. Upgrading to sdk 1.2 generates the service and servicemonitor yaml files.

- Hui
Reply all
Reply to author
Forward
0 new messages