cloud-provider-azure
cloud-provider-azure copied to clipboard
Feature: Add ServiceAnnotationLoadBalancerIP for deprecated LoadBalancerIP
What type of PR is this?
/kind feature /kind api-change /kind deprecation
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes https://github.com/kubernetes-sigs/cloud-provider-azure/issues/1781
Special notes for your reviewer:
Does this PR introduce a user-facing change?
As Kubernetes v1.24, service.Spec.LoadbalancerIP may be removed in future Kubernetes API version, so we need to add a new annotation service.beta.kubernetes.io/azure-load-balancer-ip for setting Azure LoadBalancerIP
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
Deploy Preview for warm-cascaron-bb779f ready!
| Name | Link |
|---|---|
| Latest commit | f9989af7454b308c630ad2d7bca71a4914199e1c |
| Latest deploy log | https://app.netlify.com/sites/warm-cascaron-bb779f/deploys/62b233a96968e2000ee86b72 |
| Deploy Preview | https://deploy-preview-1920--warm-cascaron-bb779f.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
Deploy Preview for kubernetes-sigs-cloud-provide-azure ready!
| Name | Link |
|---|---|
| Latest commit | f9989af7454b308c630ad2d7bca71a4914199e1c |
| Latest deploy log | https://app.netlify.com/sites/kubernetes-sigs-cloud-provide-azure/deploys/62b233a97757e10009177ae3 |
| Deploy Preview | https://deploy-preview-1920--kubernetes-sigs-cloud-provide-azure.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
Welcome @AfrouzMashayekhi!
It looks like this is your first PR to kubernetes-sigs/cloud-provider-azure 🎉. 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-sigs/cloud-provider-azure 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:
Hi @AfrouzMashayekhi. Thanks for your PR.
I'm waiting for a kubernetes-sigs 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.
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: AfrouzMashayekhi
To complete the pull request process, please assign nilo19 after the PR has been reviewed.
You can assign the PR to them by writing /assign @nilo19 in a comment when ready.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
Looks like the change is not compatible for existing services still using service.spec.LoadBalancerIP.
@jwtty So should I set both service.spec.loadBalancerIP and the annotation?
/assign @nilo19
/ok-to-test
@AfrouzMashayekhi thanks for the contribution!
- Please add an E2E test.
- If the check of spec.LoadBalancerIP is fully deleted, a lot of existing clusters will be broken. We need to make both options work at this stage, and mark the spec.LoadBalancerIP as deprecated. We will remove it in the future, but not now.
I would suggest the annotation overweights the service spec, if both are set at a time.
thanks @nilo19 could you walk me through, any similar PR or spec?
I feel a wrapper to get service LoadBalancerIP might be a solution: getServiceLoadBalancerIP():
if annotation is set:
return annotation value
return service.spec.LoadBalancerIP
Similar function to refer would be getClusterFromPIPClusterTags
What do you think? @nilo19 @AfrouzMashayekhi
@AfrouzMashayekhi: 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.
I feel a wrapper to get service LoadBalancerIP might be a solution:
getServiceLoadBalancerIP():if annotation is set: return annotation value return service.spec.LoadBalancerIPSimilar function to refer would be getClusterFromPIPClusterTags
What do you think? @nilo19 @AfrouzMashayekhi
Sorry for the late reply, I think that is a good option.
@AfrouzMashayekhi do you still have time on this PR? I am going to implement dualstack service support which needs this lb annotation change. Thanks.
@AfrouzMashayekhi Also to support dualstack, I hope the ServiceAnnotationLoadBalancerIP can be ServiceAnnotationLoadBalancerIPs.
Hi @lzhecheng! Sorry for the late response; unfortunately, I'm occupied. Feel free to assign it to yourself
Hi @lzhecheng! Sorry for the late response; unfortunately, I'm occupied. Feel free to assign it to yourself
Got it. I will do it for dual-stack as well.
@AfrouzMashayekhi: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:
| Test name | Commit | Details | Required | Rerun command |
|---|---|---|---|---|
| pull-cloud-provider-azure-check | f9989af7454b308c630ad2d7bca71a4914199e1c | link | true | /test pull-cloud-provider-azure-check |
| pull-cloud-provider-azure-unit | f9989af7454b308c630ad2d7bca71a4914199e1c | link | true | /test pull-cloud-provider-azure-unit |
| pull-cloud-provider-azure-e2e-ccm-vmss-capz | f9989af7454b308c630ad2d7bca71a4914199e1c | link | true | /test pull-cloud-provider-azure-e2e-ccm-vmss-capz |
| pull-cloud-provider-azure-e2e-ccm-capz | f9989af7454b308c630ad2d7bca71a4914199e1c | link | true | /test pull-cloud-provider-azure-e2e-ccm-capz |
| pull-cloud-provider-azure-e2e-ccm-vmss-basic-lb | f9989af7454b308c630ad2d7bca71a4914199e1c | link | true | /test pull-cloud-provider-azure-e2e-ccm-vmss-basic-lb |
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.
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. I understand the commands that are listed here.
@AfrouzMashayekhi @lzhecheng
Hey, May I know whether there have any volunteers who still supporting this feature? we have an emergency case for supporting the Static IP for load balancers. so I hope we can use the LB annotation( "service.beta.kubernetes.io/azure-load-balancer-ip") instead of the deprecated field LoadBalancerIP for our clusters.
If no one else is available, I'd be happy to help with this
@yang-wang11
Hello, I will do it. Now I am working on supporting dual-stack and it takes some time. However, I can make a small commit first with single stack annotation.
@lzhecheng thanks for the quick response. I suppose your change will be compatible with the legacy field, right?
@lzhecheng thanks for the quick response. I suppose your change will be compatible with the legacy field, right?
Yes, sure.
This feature has been supported in #2428 . Closing this one.