-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possibility to choose nodeport used port #1381
Comments
Hello @MikeDevresse , well, we thought about it. There are a couple of problems with static NodePort:
we will need to specify unique port for each replica set node. Something like this:
As you see there are bunch of problems and logical loopholes. Do you have any thoughts here? |
Why do you need to set a port for each instance ? you only need one port for each RS right ?
I don't even think it is required for configdb and replicaSets but why not. My use case is to set it on the mongos, and with a static port that I choose which are consistant between environments, I can set approprietly my VPN rules. Right now it is impossible to predict and the port will always be different between environments. |
The problem will occur if these mongos instances land on the same k8s node. Most probably you are going to avoid that through affinity rules, but it does not mean that the problem is not there. We can think of implementing it for a narrow use case. Let me discuss it with the team. Meanwhile, could you pls confirm that you rely on affinity? |
I'm not sure I understand, the nodeport is unique no matter how many mongos we set, it's the kube-proxy that redirects so it doesn't matter if we have anti-affinity or not. |
Sorry, it is my bad. It will not be an issue for mongos. Do you think you can send a PR or work with us on it? |
Can try but not sure at all |
This would also be interesting for me. When I run Percona Server for MongoDB on a local Kind cluster for development, I would like to expose just a single rs instance as a NodePort, to be able to reach it from outside of the cluster. With an unpredictable port number this becomes cumbersome. |
Hey. So we are planning to have a realease this quarter for Operator for MongoDB. We will review the PR that @MikeDevresse shared and see if it can be included. There is a caveat though.
The solution that you request is about having a nodeport for option (1). Which will work. But, we introduced service per pod for mongos for a reason. When the cluster is accessed through mongos and multiple threads execute a transaction using the same driver instance, a transaction may end up being executed on different mongos. This results in the following error:
See more here: https://perconadev.atlassian.net/browse/K8SPSMDB-599 So technically, it is recommended to use service per pod for mongos, but there are cases where single service will work fine for you. |
why not add an option to decide whether we want a single service or service per pod ? |
Hi,
I want to deploy a database instance and expose it, my idea was to use a nodeport but I also wanted to choose the port, bur from what I saw there is no way to do that.
I am using the helm chart to deploy my instance but from what I saw it seems to be an issue coming from the operator.
I want to use a nodeport to make things easier and I want to choose the port to keep it consistant between my clusters
The text was updated successfully, but these errors were encountered: