What should I do to make the operator from operatorhub.io install to other namespace than 'operators'?

131 views
Skip to first unread message

Adrian Zhuang

unread,
Aug 5, 2019, 1:09:00 PM8/5/19
to Operator Framework
I followed the instructions on the operatorhub.io to install the OLM and then the specific operator


Screen Shot 2019-08-05 at 9.59.42 AM.png

So the operator is installed to 'operators' namespace.

I would like it to be installed to other namespaces. Has anyone done so before? Any help? Thanks.

Josiah Ritchie

unread,
Aug 5, 2019, 4:33:04 PM8/5/19
to Operator Framework
Your operator install is just a YAML file. All you need to do is download it, edit the namespace in the file and then apply that file instead of the url. I don't know how that operator works so it might break something else. 

Adrian Zhuang

unread,
Aug 5, 2019, 5:36:54 PM8/5/19
to Operator Framework
Thanks @Josiah. I have tried this but it did not seem to work.

1. download 

wget https://operatorhub.io/install/cockroachdb.yaml


2. change the namespace, so the file now looks like

apiVersion: operators.coreos.com/v1alpha1

kind: Subscription

metadata:

  name: my-cockroachdb

  namespace: default

spec:

  channel: stable

  name: cockroachdb

  source: operatorhubio-catalog

  sourceNamespace: olm

3. apply

kubectl create -f cockroachdb.yaml


No operator was installed to `default` namespace.

Edmund Ochieng

unread,
Aug 6, 2019, 12:54:49 AM8/6/19
to Operator Framework
To deploy an operator to a namespace besides the "operators" namespace, you may need to create an operatorgroup. You can always start by adapting the operatorgroup in the operators namespace.

Animesh Singh

unread,
Aug 6, 2019, 2:16:46 AM8/6/19
to Edmund Ochieng, Operator Framework
Are these instructions documented anywhere? Given the amount of people using OLM, I am assuming this is the first requirement anybody would have hit?

Thanks,

Animesh


--
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/5ff1bdb9-0424-48c4-95f2-1a7fba6a9d4d%40googlegroups.com.

Avni Sharma

unread,
Aug 6, 2019, 2:34:23 AM8/6/19
to Animesh Singh, Edmund Ochieng, Operator Framework

Adrian Zhuang

unread,
Aug 6, 2019, 1:24:45 PM8/6/19
to Operator Framework
I created a operatorgroup global-operators in default namespace, same, no operator was created.

apiVersion: operators.coreos.com/v1

kind: OperatorGroup

metadata:

  name: global-operators

  namespace: default


There seems something still missing with this installation through OLM.

BTW, even without this operatorgroup in default namespace, when I applied the subscription, the csv, crd were created, and the serviceaccount for the operator was also created in the default namespace. It is the operator itself was not created. Any suggestion on where to look for logs maybe?

Thanks.

Adrian Zhuang

unread,
Aug 6, 2019, 1:51:40 PM8/6/19
to Operator Framework
More info:

OLM tries to deploy to operators namespace by ignoring the one set to default:









time="2019-08-06T17:40:04Z" level=info msg="requirements were not met" csv=cockroachdb.v2.1.11 id=0Ow+p namespace=operators phase=Pending


time="2019-08-06T17:44:43Z" level=info msg="syncing APIService" apiSvc=v1alpha1.charts.helm.k8s.io id=ThipI


time="2019-08-06T17:44:43Z" level=info msg="csv in operatorgroup" csv=cockroachdb.v2.1.11 id=b/Hkb namespace=operators opgroup=global-operators phase=Pending


time="2019-08-06T17:44:43Z" level=info msg="scheduling ClusterServiceVersion for install" csv=cockroachdb.v2.1.11 id=b/Hkb namespace=operators phase=Pending


time="2019-08-06T17:44:43Z" level=info msg="csv in operatorgroup" csv=cockroachdb.v2.1.11 id=2dL/f namespace=operators opgroup=global-operators phase=InstallReady


time="2019-08-06T17:44:43Z" level=info msg="csv in operatorgroup" csv=cockroachdb.v2.1.11 id=ji5/w namespace=operators opgroup=global-operators phase=Installing


time="2019-08-06T17:44:43Z" level=info msg="updated annotations to match current operatorgroup" csv=cockroachdb.v2.1.11 id=ji5/w namespace=operators phase=Installing


time="2019-08-06T17:44:44Z" level=info msg="csv in operatorgroup" csv=cockroachdb.v2.1.11 id=L7PnT namespace=operators opgroup=global-operators phase=Installing


time="2019-08-06T17:44:44Z" level=info msg="csv in operatorgroup" csv=cockroachdb.v2.1.11 id=G8W2/ namespace=operators opgroup=global-operators phase=Installing


time="2019-08-06T17:44:45Z" level=info msg="csv in operatorgroup" csv=cockroachdb.v2.1.11 id=IGFRS namespace=operators opgroup=global-operators phase=Installing


time="2019-08-06T17:44:45Z" level=info msg="csv in operatorgroup" csv=cockroachdb.v2.1.11 id=TnSaW namespace=operators opgroup=global-operators phase=Installing


time="2019-08-06T17:44:45Z" level=info msg="csv in operatorgroup" csv=cockroachdb.v2.1.11 id=fxM7n namespace=operators opgroup=global-operators phase=Installing


time="2019-08-06T17:44:46Z" level=info msg="csv in operatorgroup" csv=cockroachdb.v2.1.11 id=sw6iy namespace=operators opgroup=global-operators phase=Installing


time="2019-08-06T17:44:46Z" level=info msg="install strategy successful" csv=cockroachdb.v2.1.11 id=sw6iy namespace=operators phase=Installing strategy=deployment


time="2019-08-06T17:44:47Z" level=info msg="csv in operatorgroup" csv=cockroachdb.v2.1.11 id=dWKgu namespace=operators opgroup=global-operators phase=Succeeded


time="2019-08-06T17:44:47Z" level=info msg="updated annotations to match current operatorgroup" csv=cockroachdb.v2.1.11 id=dWKgu namespace=operators phase=Succeeded

Evan Cordell

unread,
Aug 7, 2019, 9:05:37 AM8/7/19
to Adrian Zhuang, Operator Framework
Hi Adrian,

Is there still a Subscription to Cockroach in the `operators` namespace? (it looks that way from the logs).

The OperatorGroup in `operators`, and the OperatorGroup in `default` both seem to select all namespaces (there are no namespace selectors / lists to restrict it). This means that any operator installed into _either_ of these operatorgroups will be watching all namespaces in the cluster, and will have ownership of the operator's provided apis in the cluster.

I suspect if you look at the status of the ClusterServiceVersion in the `default` namespace, you will see a message about a conflict of provided apis. You can't have two operators managing the same apis in the same namespace - if you remove cockroack from the `operators` namespace, the one in `default` should install properly.

--
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.


--
Evan Cordell

Adrian Zhuang

unread,
Aug 7, 2019, 12:42:55 PM8/7/19
to Operator Framework
Thanks Evan. I am pretty sure that there was only one subscription and that is with the default namespace. The OperatorGroup created as part of the operatorhub.io install is a global one watching all namespaces. So based on your explanation below, am I correct that any operator from the operatorhub.io site can only be installed to one and only one namespace (at this moment, it seems to be the operators namespace)?
To unsubscribe from this group and stop receiving emails from it, send an email to operator-framework+unsub...@googlegroups.com.


--
Evan Cordell
Reply all
Reply to author
Forward
0 new messages