loft-sh / component-chart

Kubernetes Component Chart - Helm Chart for Application Components in Kubernetes
https://devspace.sh/component-chart/docs/introduction
Apache License 2.0
32 stars 39 forks source link

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

Open thaoula opened 3 years ago

thaoula commented 3 years ago

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

LukasGentele commented 3 years ago

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