kubernetes / cloud-provider-openstack

Apache License 2.0
623 stars 611 forks source link

[occm] add a node selector support for loadbalancer services #2601

Closed kayrus closed 6 months ago

kayrus commented 6 months ago

What this PR does / why we need it:

This PR adds an ability to specify loadbalancer service with a node selector.

Big thanks to @ririko-nakamura for the initial code.

A new OCCM node-selector option is added into the [LoadBalancer] config section. And a new loadbalancer.openstack.org/node-selector service annotation support is added.

Which issue this PR fixes(if applicable): fixes #1770

Special notes for reviewers:

Release note:

added a node selector support for loadbalancer services
linux-foundation-easycla[bot] commented 6 months ago

CLA Signed


The committers listed above are authorized under a signed CLA.

k8s-ci-robot commented 6 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zetaab

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: - ~~[OWNERS](https://github.com/kubernetes/cloud-provider-openstack/blob/master/OWNERS)~~ [zetaab] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
jichenjc commented 6 months ago

/lgtm

kayrus commented 6 months ago

@jichenjc @zetaab @dulek this PR is clearly a feature, and this improvement affects only selected environments. Keeping in mind that the default behavior wasn't changed, is there a chance we can cherry-pick the fix to earlier OCCM versions?

jichenjc commented 6 months ago

generally only with bugs to backport.. but I think this unblock some use case so should be good backport if everyone agree

dulek commented 6 months ago

Yeah, I'm not opposed to backporting this, seems like it was highly anticipated. @stephenfin, @mdbooth, how do you look at this?

kayrus commented 6 months ago

/cherry-pick release-1.30

kayrus commented 6 months ago

/cherry-pick release-1.29

kayrus commented 6 months ago

/cherry-pick release-1.28

k8s-infra-cherrypick-robot commented 6 months ago

@kayrus: new pull request created: #2603

In response to [this](https://github.com/kubernetes/cloud-provider-openstack/pull/2601#issuecomment-2133866159): >/cherry-pick release-1.30 Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
k8s-infra-cherrypick-robot commented 6 months ago

@kayrus: new pull request created: #2604

In response to [this](https://github.com/kubernetes/cloud-provider-openstack/pull/2601#issuecomment-2133866265): >/cherry-pick release-1.29 Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
k8s-infra-cherrypick-robot commented 6 months ago

@kayrus: #2601 failed to apply on top of branch "release-1.28":

Applying: POC of TargetNodeLabels selector on OpenStack LB
Applying: Fix type errors
Applying: Update implementation of getKeyValuePropertiesFromServiceAnnotation
Applying: gofmt -w -s ./pkg
Applying: Polish the code and add documentation
Using index info to reconstruct a base tree...
M   docs/openstack-cloud-controller-manager/expose-applications-using-loadbalancer-type-service.md
M   docs/openstack-cloud-controller-manager/using-openstack-cloud-controller-manager.md
M   pkg/openstack/loadbalancer.go
M   pkg/openstack/loadbalancer_test.go
M   pkg/openstack/openstack.go
M   pkg/util/util.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/util/util.go
Auto-merging pkg/openstack/openstack.go
Auto-merging pkg/openstack/loadbalancer_test.go
CONFLICT (content): Merge conflict in pkg/openstack/loadbalancer_test.go
Auto-merging pkg/openstack/loadbalancer.go
Auto-merging docs/openstack-cloud-controller-manager/using-openstack-cloud-controller-manager.md
CONFLICT (content): Merge conflict in docs/openstack-cloud-controller-manager/using-openstack-cloud-controller-manager.md
Auto-merging docs/openstack-cloud-controller-manager/expose-applications-using-loadbalancer-type-service.md
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0005 Polish the code and add documentation
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
In response to [this](https://github.com/kubernetes/cloud-provider-openstack/pull/2601#issuecomment-2133866367): >/cherry-pick release-1.28 Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.