dotnet / tye

Tye is a tool that makes developing, testing, and deploying microservices and distributed applications easier. Project Tye includes a local orchestrator to make developing microservices easier and the ability to deploy microservices to Kubernetes with minimal configuration.
MIT License
5.29k stars 520 forks source link

How to host on ip address? #1342

Open halitkalayci opened 2 years ago

halitkalayci commented 2 years ago

Having issue hosting multiple asp.net core projects on local ip address.

In yaml file i define binding like this:

But project is not starting on ip address, however i can access from localhost:3043 address.

Phiph commented 2 years ago

Hi @Sanchklyc,

Thanks for raising an issue!

I'm curious to what you are trying to achieve - are you trying to get your service accessible from computers external to your localhost?

You may be able to access the service using your LAN IP by opening your computers firewall- however this is not recommended.

It also means that your Tye file is not shareable to other developers, as your binding is assuming they use the 192.168.0.0/24 or 192.168.0.0/16 IP ranges.

If you can explain what you are trying to achieve I can do my best to help or advise otherwise.

halitkalayci commented 2 years ago

Hello @Phiph ,

Thanks for your response. I'am trying to host my API which i need to call from my mobile phone so that's why i need to host it on my ip address. When i'm starting project in debugging mode setting ip adress in launchSettings.json, it is hosted on ip adress without problem.

But i couldn't figure out how to achieve the same output with tye.

Thank you.

Phiph commented 2 years ago

Hi @Sanchklyc,

Tye isn't the right technology for your use case, and you shouldn't explicitly bind to an IP address. As for the deployment step the IP address has no value and could differ in the target environment.

So when you bind a port to your computer, you can open it out to your local network via your systems firewall. (IIS works in a simular same way if you wanted to google it) It's not a 100% recommended, but you can do it.

If you're debugging a response from a mobile app, can you run the app on an emulator on your PC?

Alternatively, if it's just a few .NET Core projects why not host them in Azure using the free credits and use Remote Debugging?

odidev commented 1 year ago

Hi Team,

I am working on coolstore-microservices on the Linux/AMD64 AWS instance, which uses tye to run the application.

My application ran with tye run and I can curl to http://localhost:8000/ locally on the AWS instance. However, I am unable to open my application in the browser with my public IP of the AWS instance.

May I know, is there a way I can access my application on the AWS public IP on the browser after running tye run?

I have already disabled firewall, but that hasn’t helped.

Kindly provide some pointers on this issue.

Phiph commented 1 year ago

Hey @odidev,

Tye is working as designed if you can access it locally. I wouldn't recommend using it for hosting an application.

I'd recommend reaching out to AWS support for help if you wish to get it running in your environment, it sounds like a networking problem.

Phiph commented 1 year ago

@halitkalayci I. hope you're alright.

Did you manage to get your system working in the end?

I was thinking about this the other day.... you could run tye locally and supplement it with grok

That way it act's privately but being tunnelled by grok.