microsoft / service-fabric

Service Fabric is a distributed systems platform for packaging, deploying, and managing stateless and stateful distributed applications and containers at large scale.
https://docs.microsoft.com/en-us/azure/service-fabric/
MIT License
3.02k stars 399 forks source link

Azure Service Fabric Cluster Static Public Ip Reservation #569

Open mariusisac opened 5 years ago

mariusisac commented 5 years ago

Hello, I am using Service Fabric to host a server for an IOT solution. The IOT devices have the server IP configured (Azure Public IP address). Problem is, last week after a failed Service Fabric auto-update, I had to redeploy the cluster, but I lost the IP address in the process, and had to manually send someone to set the new IP address on the devices. How can i reserve this IP to not face this issue in the future, and reassign the IP to a new deploy? I am not even able to set the update to manual: image

juho-hanhimaki commented 5 years ago

I would reserve IP addresses as separate resources (to separate resource group). This way even if you delete the cluster or something else catastrophic happens you can still keep the same ip address resources. Also you need to set the IP address type to static instead of dynamic so it will always stay the same.

Also I would prefer to use DNS hostname over IP address for IoT since then you can make changes to infrastructure in future without having to worry about IP addresses.

mariusisac commented 5 years ago

The IP address is set to static, but only as long as the virtual machine is running after that it gets released. Also I am not able to set a Reserved IP address to the Load Balance (or to reserve the current) it is simply not allowed.

Yes I would also prefer the DNS option but unfortunately we are unable to use it.

juho-hanhimaki commented 5 years ago

As long as the "publicIPAllocationMethod" is "Static" the IP address should not get released ever.

"Reserved IP address" you're referring to uses probably classic deployment model and I don't know if its supported. I think its recommended to use "Public IP address" which is ARM based.

https://docs.microsoft.com/en-us/azure/templates/microsoft.network/2019-04-01/publicipaddresses

So you should be able to just create a Public IP Address with Static allocation method and then assign it to the load balancer. The IP should stay the same even if load balancer is deleted.

masnider commented 4 years ago

@mariusisac are you able to confirm the IP address allocation method? Also just FYI the IP address is associated with the public load balancer or another similar Azure networking resource, not the cluster, so you shouldn't need to reset it or lose it or anything even if you decide to blow away the cluster in the back. Is it possible that instead of just deleting the cluster you accidentally deleted the entire resource group? That could definitely cause your IP to change if you didn't have a static allocation preserved elsewhere. Similarly to "put the IP back" should be more about associating it with that public endpoint like the Azure network load balancer.

abarberenaCPDS commented 4 years ago

Hi @mariusisac, I recommend using the Azure Service Bus, sounds like either relay or hybrid modes are more suitable for your scenario.