Is it possible to change the port the k8s psmdb-server service listens to?

Hi percona team,

I’m using the percona psmdb-db helm chart to deploy a mongo server. I see neither helm chart or CR has an option to specify the ports the config servers, the replicasets or mongos servers listen to.
I do not want to change the ports of the containers or the pods, but it would be really nice to be able to change the port specified in the k8s services.
I tried changing the configuration (i.e. sharding.mongos.configuration) to use a different port with no success: neither ports on the container, pod or service are changed.

I understand the operator keeps an eye on the resources and modifies them if any unexpected change is done over them. Is it safe to manually change the ports on the service once I have installed the helm chart and the operator has finished deploying the healthy cluster? How do I know what k8s resources will be overwritten if they detect a manual change? Are manual changes on the k8s resources after helm installations or kubectl apply commands discouraged to avoid misconfigurations on the mongo cluster?

Do you have a suggestion of a workaround to this issue? Is there a percona helm chart configuration I am missing?

Best regards,
Daniel

1 Like

Hello @Daniel_Arellano ,

right now it is not possible to change the port.
We have the following JIRA issue in our queue to track it: [K8SPSMDB-557] Allow user to change the port for MongoDB deployment - Percona JIRA
The issue is not scheduled yet.
I think it should be a minor change in the code, but the problem will be with testing and changing the ports on the fly.

Do you need to change the port for mongos only?

2 Likes

Hi @Sergey_Pronin,

Not really, I would like to change as well port for reaching primary nodes of my mongo cluster. I suppose in this case I’m left with handling this from alternate k8s workarounds like headless services or ingresses to not mess up with the k8s services created by percona.

1 Like

@Daniel_Arellano yes, this would be a way to go.

1 Like