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

Feature: Add ServiceAnnotationLoadBalancerIP for deprecated LoadBalancerIP

Open LittleGoWitch opened this issue 3 years ago • 16 comments

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.:


LittleGoWitch avatar Jun 21 '22 21:06 LittleGoWitch

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...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Jun 21 '22 21:06 netlify[bot]

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...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Jun 21 '22 21:06 netlify[bot]

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:

k8s-ci-robot avatar Jun 21 '22 21:06 k8s-ci-robot

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.

k8s-ci-robot avatar Jun 21 '22 21:06 k8s-ci-robot

[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.

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 Jun 21 '22 21:06 k8s-ci-robot

Looks like the change is not compatible for existing services still using service.spec.LoadBalancerIP.

jwtty avatar Jun 22 '22 01:06 jwtty

@jwtty So should I set both service.spec.loadBalancerIP and the annotation?

LittleGoWitch avatar Jun 22 '22 05:06 LittleGoWitch

/assign @nilo19

LittleGoWitch avatar Jun 22 '22 05:06 LittleGoWitch

/ok-to-test

nilo19 avatar Jun 22 '22 07:06 nilo19

@AfrouzMashayekhi thanks for the contribution!

  1. Please add an E2E test.
  2. 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.

nilo19 avatar Jun 22 '22 07:06 nilo19

I would suggest the annotation overweights the service spec, if both are set at a time.

nilo19 avatar Jun 22 '22 07:06 nilo19

thanks @nilo19 could you walk me through, any similar PR or spec?

LittleGoWitch avatar Jun 22 '22 07:06 LittleGoWitch

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

jwtty avatar Jun 22 '22 08:06 jwtty

@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.

k8s-ci-robot avatar Jul 01 '22 05:07 k8s-ci-robot

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

Sorry for the late reply, I think that is a good option.

nilo19 avatar Jul 06 '22 01:07 nilo19

@AfrouzMashayekhi do you still have time on this PR? I am going to implement dualstack service support which needs this lb annotation change. Thanks.

lzhecheng avatar Aug 22 '22 15:08 lzhecheng

@AfrouzMashayekhi Also to support dualstack, I hope the ServiceAnnotationLoadBalancerIP can be ServiceAnnotationLoadBalancerIPs.

lzhecheng avatar Aug 23 '22 01:08 lzhecheng

Hi @lzhecheng! Sorry for the late response; unfortunately, I'm occupied. Feel free to assign it to yourself

LittleGoWitch avatar Aug 29 '22 11:08 LittleGoWitch

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.

lzhecheng avatar Aug 29 '22 23:08 lzhecheng

@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.

k8s-ci-robot avatar Aug 31 '22 01:08 k8s-ci-robot

@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 avatar Sep 26 '22 07:09 yang-wang11

@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 avatar Sep 27 '22 07:09 lzhecheng

@lzhecheng thanks for the quick response. I suppose your change will be compatible with the legacy field, right?

yang-wang11 avatar Sep 27 '22 07:09 yang-wang11

@lzhecheng thanks for the quick response. I suppose your change will be compatible with the legacy field, right?

Yes, sure.

lzhecheng avatar Sep 27 '22 08:09 lzhecheng

This feature has been supported in #2428 . Closing this one.

lzhecheng avatar Oct 11 '22 01:10 lzhecheng