# Cluster wide kubernetes Operator for Percona XtraDB Cluster

**URL:** <https://forums.percona.com/t/cluster-wide-kubernetes-operator-for-percona-xtradb-cluster/7626>\
**Category:** Percona Operator for MySQL\
**Created:** [May 14, 2020, 7:16am UTC](https://forums.percona.com/t/cluster-wide-kubernetes-operator-for-percona-xtradb-cluster/7626 "2020-05-14T07:16:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dbcoder](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@dbcoder](https://forums.percona.com/u/dbcoder)\
**Post date:** [May 14, 2020, 7:16am UTC](https://forums.percona.com/t/cluster-wide-kubernetes-operator-for-percona-xtradb-cluster/7626/1 "2020-05-14T07:16:16Z")

</div>

Hello community,  
I am quiete new with using Percona . I was wonderning if there is a possibility to have a cluster wide operator.  
Basically allowing the creation of differents clusters in differents namespaces.  
Thank you in advance.

---

<div class="post-metadata">

**Author:** ![Ivan\_Pylypenko](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ivan_pylypenko/32/2452_2.png) [@Ivan\_Pylypenko](https://forums.percona.com/u/Ivan_Pylypenko)\
**Post date:** [May 14, 2020, 7:22am UTC](https://forums.percona.com/t/cluster-wide-kubernetes-operator-for-percona-xtradb-cluster/7626/2 "2020-05-14T07:22:23Z")

</div>

Hi  
Cluster wide scope is not supported since the operator uses role based privileges, which narrows the operation to operators’ namespace.  
However if you’re interested in such functionality, you can escalate your request to the corresponding Percona department.

---

<div class="post-metadata">

**Author:** ![dbcoder](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@dbcoder](https://forums.percona.com/u/dbcoder)\
**Post date:** [May 14, 2020, 7:36am UTC](https://forums.percona.com/t/cluster-wide-kubernetes-operator-for-percona-xtradb-cluster/7626/3 "2020-05-14T07:36:55Z")

</div>

Hi,  
Thank you for your quick response :). How can I do that?

---

<div class="post-metadata">

**Author:** ![Ivan\_Pylypenko](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ivan_pylypenko/32/2452_2.png) [@Ivan\_Pylypenko](https://forums.percona.com/u/Ivan_Pylypenko)\
**Post date:** [May 14, 2020, 8:02am UTC](https://forums.percona.com/t/cluster-wide-kubernetes-operator-for-percona-xtradb-cluster/7626/4 "2020-05-14T08:02:12Z")

</div>

DBcoder,  
You will be contacted by our sales team.  
Cluster wide operation is not on our agenda and we would need some priority adjustments if you confirm your interest in this feature.

---

<div class="post-metadata">

**Author:** ![dbcoder](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@dbcoder](https://forums.percona.com/u/dbcoder)\
**Post date:** [May 14, 2020, 9:30am UTC](https://forums.percona.com/t/cluster-wide-kubernetes-operator-for-percona-xtradb-cluster/7626/5 "2020-05-14T09:30:32Z")

</div>

Yes our team is very intersted by this feature.

---

<div class="post-metadata">

**Author:** ![magic](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/magic/32/2592_2.png) [@magic](https://forums.percona.com/u/magic)\
**Post date:** [January 15, 2021, 2:59pm UTC](https://forums.percona.com/t/cluster-wide-kubernetes-operator-for-percona-xtradb-cluster/7626/6 "2021-01-15T14:59:27Z")

</div>

Hello Guys,

I’m digging into this topic also - `cluster-wide` operator.

According to this page [https://www.percona.com/doc/kubernetes-operator-for-pxc/cluster-wide.html](https://www.percona.com/doc/kubernetes-operator-for-pxc/cluster-wide.html) cluster-wide operator is possible.

According to this topic, which is from May 2020, it’ seems not to be possible?

The way it should work, as I understand, is that we create one percona operator in for eg. namespace `pxc-operator` like so (this is from the link above):

`kubectl create namespace pxc-operator`  
`kubectl apply -f deploy/cw-bundle.yaml -n pxc-operator`

Then we can create `db-cluster` in any other namespaces.  
`kubectl apply -f deploy/cr.yaml -n <any_other_namespace>`

Do I get those information right? Or I am wrong?

**UPDATE:**  
I have found a solution to install it.

The problem that I was facing is that I had old `pxc` objects hanging in `etcd`. While they were there, I couldn’t deploy the db-cluster with `kubectl apply -f deploy/cr.yaml -n <namespace>`. I had to clean `pxc` objects, old cgrd’s, delete the operator to do all this, and then redeploy.

It looks like the cluster-wide install works fine. I have the operator in pxc-operator namespace. And the databases in other namespaces.

If I may ask, by the way, what is the reason, that it is advised to use the deployment per namespace, not cluster-wide? Is it because of the security reasons? Or performance? Or maintenance (that the operator is in another, maybe unavailable for the user, namespace?)

---

<div class="post-metadata">

**Author:** ![vadimtk](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/vadimtk/32/9528_2.png) [@vadimtk](https://forums.percona.com/u/vadimtk)\
**Post date:** [January 15, 2021, 7:48pm UTC](https://forums.percona.com/t/cluster-wide-kubernetes-operator-for-percona-xtradb-cluster/7626/7 "2021-01-15T19:48:39Z")

</div>

The primary reason to use operator per namespace if maintenance.  
You have more granular control when to upgrade operator.  
Cluster-wide is also valid choice though.
