Configure the network services
To expose a node port for the application you must configure the network services.
- List available services by running the following command:
Example output:$ oc get svcNAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE headless ClusterIP None <none> 5434/TCP 16d kubernetes ClusterIP 172.30.0.1 <none> 443/TCP 17d openshift ExternalName <none> kubernetes.default.svc.cluster.local <none> 17d rhel9-vm-lb-ssh-service LoadBalancer 172.30.138.217 192.0.2.100 22000:32240/TCP 21h - Edit the required YAML file by running the following command:
$ oc edit svc <service-name> - Leave the existing
nodePortentry unchanged and add new ports for MongoDB without anodePortentry. By default, RHOCP selects an available port in the `30000-32767` range.ports: - name: ssh nodePort: 32240 port: 22000 protocol: TCP targetPort: 22 - name: mongodb port: 27017 protocol: TCP targetPort: 27017 - Verify that the service node port is updated by running the following
command:
$ oc get svcExample output:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE headless ClusterIP None <none> 5434/TCP 16d kubernetes ClusterIP 172.30.0.1 <none> 443/TCP 17d openshift ExternalName <none> kubernetes.default.svc.cluster.local <none> 17d rhel9-vm-lb-ssh-service LoadBalancer 172.30.138.217 192.0.2.100 22000:32240/TCP,27017:31220/TCP 16s