jorgemarey / nomad-nova-autoscaler

MIT License
14 stars 3 forks source link

Association of floating-IPs possible #3

Closed neuroserve closed 3 months ago

neuroserve commented 4 months ago

Hi *,

how can I associate a floating IP with an autoscaler-created instance automatically? It would be nice, if a floating IP could be allocated and associated on-demand automatically during the creation of the instance. Like with an option "floating-ip = true".

Currently I have to attach floating IPs to newly created instances manually. Or is there another way?

Kind regards

jorgemarey commented 4 months ago

Hi @neuroserve,

Currently it's not possible, but I'll look into it. I shouldn't be to complicated.

I'll comment here once I have news about it.

Thanks

jorgemarey commented 3 months ago

Hi @neuroserve sorry for the delay. I'm making the changes for this right now. Just some questions. I'm thinking about adding a configuration option floatingip_pool_name that will be needed to set on the target if someone wants to associate a floating for the created instances.

neuroserve commented 3 months ago

I'm not sure about the setups of other OpenStack users. In our openstack environment I get this

openstack floating ip pool list
Floating ip pool operations are only available for Compute v2 network.

In Terraform I request a flip with this:

resource "openstack_networking_floatingip_v2" "postgres_flip" {
  pool  = "ext01"
}

Thus I guess, the pool name is OK.

I'm not sure about the second one. I would suggest to allocate new addresses for every instance created - catering for those people who assign flips temporarily to services, they need to access from outside sometimes.

Would you disassociate and release the flips of instances, that are "scaled down", too? Or is that not possible?

jorgemarey commented 3 months ago

Thus I guess, the pool name is OK.

OK!

I'm not sure about the second one. I would suggest to allocate new addresses for every instance created - catering for those people who assign flips temporarily to services, they need to access from outside sometimes.

I'll start allocating a new address each time, and later maybe I'll and option to allow for reuse previously allocated IPs ip present.

Would you disassociate and release the flips of instances, that are "scaled down", too? Or is that not possible?

Yes, that's the idea. Once the instance is destroyed the floating will be released.

Hope I can get this working soon. I'll keep you updated. Thanks

neuroserve commented 3 months ago

Thanks! And you support security groups already. Security is covered!

jorgemarey commented 3 months ago

This should be added now in 0.4.1. Let me know if you try it.

neuroserve commented 3 months ago

Works. New VMs automatically get a flip associated. Haven't seen any scale down events so far. Looks good!