cloud-provider-openstack icon indicating copy to clipboard operation
cloud-provider-openstack copied to clipboard

[occm] Support specifying a sort order for node addresses

Open ederst opened this issue 2 years ago • 5 comments

What this PR does / why we need it: This introduces a configuration key which influences the way the provider reports the node addresses to the Kubernetes node resource.

The default order depends on the hard-coded order the provider queries the addresses and what the cloud returns, which does not guarantee a specific order.

To override this behavior it is possible to specify a comma separated list of CIDRs. Essentially, this will sort and group all addresses matching a CIDR in a prioritized manner, where the first item having a higher priority than the last. All non-matching addresses will remain in the same order they are already in.

For example, this option can be useful when having multiple or dual-stack interfaces attached to a node and needing a user-controlled, deterministic way of sorting the addresses.

Which issue this PR fixes(if applicable): Fixes at least my issue with occm reporting either IPv6 or IPv4 when trying to access Pods and not needing to deactivate IPv6 reporting or specifying the IPv6 network as an external network (which is only possible if the IPv6 is from a different network anyhow).

Special notes for reviewers: None so far.

Release note:

[openstack-cloud-controller-manager] Support specifying a sort order for node addresses

ederst avatar Jul 21 '22 16:07 ederst

Welcome @ederst!

It looks like this is your first PR to kubernetes/cloud-provider-openstack 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/cloud-provider-openstack has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot avatar Jul 21 '22 16:07 k8s-ci-robot

Hi @ederst. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 Jul 21 '22 16:07 k8s-ci-robot

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign jichenjc for approval by writing /assign @jichenjc in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Jul 21 '22 16:07 k8s-ci-robot

/ok-to-test

jichenjc avatar Jul 22 '22 06:07 jichenjc

@ederst: PR needs rebase.

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 Aug 25 '22 11:08 k8s-ci-robot

/lgtm /approve

Thanks for the PR, I met this issue before so I Think it's helpful feature

jichenjc avatar Nov 04 '22 07:11 jichenjc

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jichenjc

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Nov 04 '22 07:11 k8s-ci-robot