Nodeport not being recongnized for rep set

Hello All,

I downloaded and started to use percona-helm-charts-psmdb-operator-1.18.0/charts/psmdb-db for my install, I was previously using 1.17.1. In 1.17.1 you could expose the rep set nodeport by using exposeType. In 1.18.0 it is only type ( see below ). After deploying when I check my services it is not using nodeport only ClusterIP. I tried to change type to exposeType in 1.18.0 but still no luck, any suggestions ? I only want to expose the rep set I have sharding disabled

1.17.1

expose:
  enabled: true
  exposeType: NodePort

1.18.0

expose:
  enabled: true
  type: NodePort

Hi @Henry_Smearman ,

Could you describe the steps to reproduce and issue you face in more detail? I have tried to reproduce it but get the same behavior in both 1.17.1 and 1.18.0 - NodePort services are created for rs:
1.18.0:

$ helm install helm-1180 percona/psmdb-db --version 1.18.0 --set sharding.enabled=false --set replsets.rs0.expose.enabled=true --set replsets.rs0.expose.type=NodePort

$ k get service -w | grep helm-1180
helm-1180-psmdb-db-rs0       ClusterIP   None             <none>        27017/TCP         104s
helm-1180-psmdb-db-rs0-0     NodePort    34.118.229.21    <none>        27017:30870/TCP   103s
helm-1180-psmdb-db-rs0-1     NodePort    34.118.226.186   <none>        27017:30797/TCP   77s
helm-1180-psmdb-db-rs0-2     NodePort    34.118.225.52    <none>        27017:31415/TCP   49s

1.17.1:

$ helm install helm-1171-2 percona/psmdb-db --version 1.17.1 --set sharding.enabled=false --set replsets.rs0.expose.enabled=true --set replsets.rs0.expose.exposeType=NodePort

$ k get service -w | grep helm-1171-2
helm-1171-2-psmdb-db-rs0     ClusterIP   None             <none>        27017/TCP         11m
helm-1171-2-psmdb-db-rs0-0   NodePort    34.118.227.74    <none>        27017:31036/TCP   11m
helm-1171-2-psmdb-db-rs0-1   NodePort    34.118.238.124   <none>        27017:31273/TCP   10m
helm-1171-2-psmdb-db-rs0-2   NodePort    34.118.239.32    <none>        27017:32035/TCP   10m

Hello @eleonora.zinchenko ,

Thanks for your reply. I use the following to install. I download the helm charts from https://github.com/percona/percona-helm-charts/archive/refs/tags/psmdb-operator-1.18.0.zip, deploy the operator and then deploy my rep set from charts/psmdb-db/ dir using the following command, helm install test118 . --version 1.18.0 --set sharding.enabled=false --set replsets.rs0.expose.enabled=true --set replsets.rs0.expose.type=NodePort.

kubectl get services | grep test118
test118-psmdb-db-rs0 ClusterIP None 27017/TCP 31s
test118-psmdb-db-rs0-0 ClusterIP 10.101.10.161 27017/TCP 30s
test118-psmdb-db-rs0-1 ClusterIP 10.108.164.66 27017/TCP 15s
test118-psmdb-db-rs0-2 ClusterIP 10.100.107.80 27017/TCP 5s

Hi @Henry_Smearman ,

I can reproduce it only in case I leave a dot at the end of NodePort in command:
The following command results in ClusterIP (note dot in the end):

$  helm install test1182 . --version 1.18.0 --set sharding.enabled=false --set replsets.rs0.expose.enabled=true --set replsets.rs0.expose.type=NodePort.
$ k get service |grep -w test1182
test1182-psmdb-db-rs0     ClusterIP   None             <none>        27017/TCP         6m43s
test1182-psmdb-db-rs0-0   ClusterIP   34.118.226.231   <none>        27017/TCP         6m41s
test1182-psmdb-db-rs0-1   ClusterIP   34.118.231.58    <none>        27017/TCP         38s
test1182-psmdb-db-rs0-2   ClusterIP   34.118.226.46    <none>        27017/TCP         6s

The following results in NodePort:

$ helm install test118 . --version 1.18.0 --set sharding.enabled=false --set replsets.rs0.expose.enabled=true --set replsets.rs0.expose.type=NodePort
$ k get service |grep -w test118
test118-psmdb-db-rs0      ClusterIP   None             <none>        27017/TCP         7m38s
test118-psmdb-db-rs0-0    NodePort    34.118.233.239   <none>        27017:31938/TCP   7m37s
test118-psmdb-db-rs0-1    NodePort    34.118.231.111   <none>        27017:31623/TCP   7m8s
test118-psmdb-db-rs0-2    NodePort    34.118.235.202   <none>        27017:32202/TCP   74s

Can you recheck that you do not pass anything extra like . or other symbols in command?

Hello @eleonora.zinchenko ,

Thanks for helping! I confirmed I do not have “.” at the end of the command. I copied your working command and still the issues persists. I have tried this on both my kub cluster and my minikube cluster, same results on both clusters. No issues with 1.17.1.

helm install test118 . --version 1.18.0 --set sharding.enabled=false --set replsets.rs0.expose.enabled=true --set replsets.rs0.expose.type=NodePort

kubectl get services | grep test118
test118-psmdb-db-rs0 ClusterIP None 27017/TCP 3m1s
test118-psmdb-db-rs0-0 ClusterIP 10.103.228.228 27017/TCP 3m
test118-psmdb-db-rs0-1 ClusterIP 10.104.65.58 27017/TCP 2m45s
test118-psmdb-db-rs0-2 ClusterIP 10.96.220.29 27017/TCP 2m35s

Hi,

That is strange.

deploy the operator and then deploy my rep set

Can you describe how you deploy operator? Do you use 1.18.0 crd?

Hello,

For the operator I install from the percona-helm-charts-psmdb-operator-1.18.0/charts/psmdb-operator dir .

helm install operator . --version 1.18.0

kubectl get crds

NAME CREATED AT
perconaservermongodbbackups.psmdb.percona.com 2024-11-11T21:23:37Z
perconaservermongodbrestores.psmdb.percona.com 2024-11-11T21:23:37Z
perconaservermongodbs.psmdb.percona.com 2024-11-11T21:23:37Z

Hi,

It seems you did not update 1.17.0 CRDs that is why new type is not used. I could reproduce your issue when using 1.17.0 CRD with 1.18.0 Operator.
If you had old crds installed before installing 1.18.0 operator you need to “manually” update them.

kubectl apply --server-side -f https://raw.githubusercontent.com/percona/percona-server-mongodb-operator/v1.18.0/deploy/crd.yaml
kubectl apply -f https://raw.githubusercontent.com/percona/percona-server-mongodb-operator/v1.18.0/deploy/rbac.yaml

Please see Upgrade MongoDB and the Operator - Percona Operator for MongoDB .

1 Like

Hello,

Thanks so much! that was it !

kubectl get services | grep test118
test118-psmdb-db-rs0 ClusterIP None 27017/TCP 46s
test118-psmdb-db-rs0-0 NodePort 10.111.49.138 27017:30770/TCP 46s
test118-psmdb-db-rs0-1 NodePort 10.101.199.90 27017:30344/TCP 30s
test118-psmdb-db-rs0-2 NodePort 10.109.64.12 27017:31574/TCP 20s

1 Like