component-chart icon indicating copy to clipboard operation
component-chart copied to clipboard

Allow NodePort to be specified for services to allow connection to services such as databases

Open thaoula opened this issue 3 years ago • 1 comments

Hi All,

I have just started using DevSpace which seems really nice!!.

I currently migrating from Docker Compose with 10 services (Redis, MongoDB, NodeJS, Caddy etc).

I am trying to configure a MongoDB ReplicaSet Deployment using the Component Chart and our existing dockerfiles.

So far, I can get MongoDB to build and deploy fine on a K3D development cluster. The last remaining challenge is accessing the database server from outside the cluster.

From what I can tell, there appears to be no way to configure a nodePort for a service. You can set the type but cannot specify a port. It is always a random port.

If I try to add nodePort to the config, I get the following error - line 7: field nodePort not found in type latest.ServicePortConfig

So for now, I stopped using the component chart and switched to using manifests directly. Using manifests, I was able to set a nodePort on the service and can access the database from the host machine.

Is there a way to specify a nodePort?

Regards, Tarek

thaoula avatar Sep 28 '21 06:09 thaoula

Have you tried using port forwarding? That will allow you to access the database via localhost:port whenever devspace dev is running.

LukasGentele avatar Sep 28 '21 20:09 LukasGentele