Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NSXServiceAccount] Watch mgmt-proxy service and reconcile all NSXSA #1019

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Atish-iaf
Copy link

@Atish-iaf Atish-iaf commented Feb 10, 2025

Reconcile all existing NSXSA incase of following events of K8s service corresponding to mgmt-proxy.

  • new service is created.
  • existing service is deleted.
  • existing service is updated with LB VIP.

While reconciling realized NSXSA, update proxyEndpoints if proxyEndpoints have changed.

@edwardbadboy
Copy link

Thanks for the PR. Let me review it.

@Atish-iaf
Copy link
Author

Hi @edwardbadboy @gran-vmv @liu4480
Please help to review this PR.
Thanks

@Atish-iaf Atish-iaf force-pushed the watch_proxy_service_and_reconcile_nsxsa branch from d2a15ab to b982484 Compare February 11, 2025 05:47
Copy link
Contributor

@gran-vmv gran-vmv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM. A small comment.

r.StatusUpdater.UpdateFail(ctx, obj, err, "", updateNSXServiceAccountStatuswithError)
return ResultRequeue, err
}
r.StatusUpdater.UpdateSuccess(ctx, obj, updateNSXServiceAccountStatus)
r.StatusUpdater.IncreaseDeleteSuccessTotal()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you ask @yanjunz97 for this? I think this may be a mistake.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove r.StatusUpdater.IncreaseDeleteSuccessTotal() here.
@yanjunz97 could you please take a look as well ?

@Atish-iaf Atish-iaf marked this pull request as ready for review February 12, 2025 04:59
// Reconcile all NSXSA if existing Service with label "mgmt-proxy.antrea-nsx.vmware.com" is updated with Service LB VIP
if oldObjHasLabel && newObjHasLabel {
// Service type updated to LB
if oldObj.Spec.Type != corev1.ServiceTypeLoadBalancer && newObj.Spec.Type == corev1.ServiceTypeLoadBalancer {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if oldObj.Spec.Type != newObj.Spec.Type and both are not corev1.ServiceTypeLoadBalancer, will this be ignored, for example, service type has been changed from nodeport to clusterip

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it will be ignored.

@Atish-iaf Atish-iaf marked this pull request as draft February 18, 2025 09:48
Reconcile all NSXSA whenever LB VIP is updated for mgmt-proxy.
For realized NSXSA, update proxyEndpoints only if it has changed.

Signed-off-by: Kumar Atish <[email protected]>
@Atish-iaf Atish-iaf force-pushed the watch_proxy_service_and_reconcile_nsxsa branch from b982484 to d361378 Compare February 18, 2025 15:22
@Atish-iaf Atish-iaf marked this pull request as ready for review February 18, 2025 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants