cluster-api-provider-openstack icon indicating copy to clipboard operation
cluster-api-provider-openstack copied to clipboard

Specify the subnet id for the External Network using the external cloud provider

Open raildo opened this issue 3 years ago • 13 comments

/kind feature

Nowadays, CAPO will always choose the first subnet given the OPENSTACK_EXTERNAL_NETWORK_ID based on the current code [0]. Would be nice to have a new configuration option, something like OPENSTACK_EXTERNAL_SUBNET_ID where we could specify on which subnet of the external network, we want the cluster to get a Floating IP.

The use case that I have is when there is no floating IP available on this first subnet to be used, but we do have others subnets on the public network and I would like to choose another subnet with another range of FIPs for the cluster to be deployed, right now we can't do it.

[0] https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/pkg/cloud/services/networking/router.go#L168

We have something similar to that already one on OCCM as you can see here:

https://github.com/kubernetes/cloud-provider-openstack/issues/1328

https://github.com/kubernetes/cloud-provider-openstack/pull/1375

raildo avatar Apr 19 '22 16:04 raildo

um... not sure fully understand this , but follow your [0] makes me think you want to do on ExternalRouterIPs then read your description again seems you want to work on ExternalNetworkID which are 2 different concepts to me

and I guess you want to work on ExternalNetworkID then yes ,provide a subnet ID seems reasonable (but will openstack use 2nd subnet if 1st used up so anyway 2nd subnet will be used later ??)

and yes, I think it should be good for us to add such param, in case not provided, go with "" should be fine

jichenjc avatar Apr 21 '22 00:04 jichenjc

Probably, I pointed out to the wrong code link on [0] when I was trying to find the related code, but you're right on the second statement. When we have a deployment multiple subnets on the external network, I'm looking forward to be able choose on which subnet I want the cluster to grab a Floating IP, that's my suggestion on including that new param OPENSTACK_EXTERNAL_SUBNET_ID (or any other similar name that fits for everyone).

Also I'm ok with, as you mentioned on your comment, if not provided, go with "" on it.

raildo avatar Apr 22 '22 18:04 raildo

/assign

ok, let me give a try

jichenjc avatar Apr 25 '22 01:04 jichenjc

Cool! Thank you, I'm able to test it, if needed, in a real openstack cloud before we merged it. Just let me know :)

raildo avatar Apr 27 '22 12:04 raildo

sorry for the confusion, I read the doc and code again and looks like I misunderstand the code a little bit at beginning in your case [0] ,actually that's logic only when [1] is True

so have you tried openStackCluster.Spec.ExternalRouterIPs.Subnet.UUID to your subnet ID directly thus the UUID will indicate the subnet you choose?

[0] https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/pkg/cloud/services/networking/router.go#L168 [1] https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/pkg/cloud/services/networking/router.go#L158

jichenjc avatar Apr 28 '22 09:04 jichenjc

I haven't tried changing this ID directly. Is there a way to do it using the external template, or should I change the openStackCluster.Spec.ExternalRouterIPs.Subnet.UUID directly after the clusterctl generate? I can give it a shoot here and see how it goes. I can poke you on slack if you want to as well, if you prefer.

raildo avatar Apr 28 '22 11:04 raildo

directly after the clusterctl generate

I think you can give a try after generate, we use yaml file to apply and that clusterctl is just for simple creation sure, ping me any time and reply you when I see it :)

jichenjc avatar Apr 28 '22 13:04 jichenjc

@jichenjc Are you still working on this?

apricote avatar Jun 15 '22 13:06 apricote

@apricote check above comments, I think existing way can achieve the functions so I didn't submit a PR waiting for validation on the way proposed above now

jichenjc avatar Jun 16 '22 03:06 jichenjc

Hey all, sorry for the late response. Unfortunately I was not able to uses the openStackCluster.Spec.ExternalRouterIPs.Subnet.UUID during the previous tests. I'm not sure if someone else can tests it as well, or if you guys want we can pair or try to setup some test env to give it a try.

raildo avatar Jun 16 '22 13:06 raildo

ok, I will try this later when got some time, fully occupied now :(

jichenjc avatar Jun 17 '22 02:06 jichenjc

opened https://github.com/gophercloud/gophercloud/issues/2425 for subnet ID into floating ip creation

for now, can you help to use APIServerFloatingIP as workaround so that you can select from 2nd subnet on the floating ip specificly?

jichenjc avatar Jun 20 '22 10:06 jichenjc

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Sep 18 '22 11:09 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Oct 18 '22 11:10 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-triage-robot avatar Nov 17 '22 11:11 k8s-triage-robot

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Nov 17 '22 11:11 k8s-ci-robot