Is exposing mongo replicaset with NodePort working?

So euh… any plan to fix this issue?

1 Like

Interesting, that adding annotation manually to the service does not cause it to be recreated by the Operator. So it should be something else.

1 Like

You mean if you manually add field.cattle.io/publicEndpoints to the service, it won’t be recreated by the operator? Now that’s strange. Maybe if cattle detects that that field exists, it won’t add/modify it? If so, it can be a workaround.

1 Like

It’s impossible to add it manually to the cr, the NodePort isn’t assigned until the service is created, so how would you specify the port?

1 Like

Ok, I take it back.

I have a service:

my-cluster-name-mongos   NodePort    10.11.253.80   <none>        27017:32588/TCP   5m

I add a random annotation to this service through kubectl edit service my-cluster-name-mongos.

After few seconds the service changes the port and my annotation is not there anymore:

my-cluster-name-mongos   NodePort    10.11.253.80   <none>        27017:32378/TCP   5m28s

There is nothing in the Operator logs.

1 Like

Hi all,

I’ve reproduced and tracked down the issue to this line: percona-server-mongodb-operator/psmdb_controller.go at main · percona/percona-server-mongodb-operator · GitHub

Since it’s a deliberate check, I need to talk with the author to decide on a proper fix.

2 Likes

Exactly, that’s the line. For now I’m just removing the added annotation from the list, as a quick work around.

1 Like

any updates on a fix for this?

1 Like

We decided to ignore annotations changes on services and do not run an object update.
It will be delivered in [K8SPSMDB-558] Ignore annotations for object updates - Percona JIRA .

Code not merged yet.

2 Likes