-
Notifications
You must be signed in to change notification settings - Fork 300
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
Add backend_type label to l4_netlbs_count and the L4_netlb latency metrics #2691
Conversation
6431825
to
9938c2b
Compare
/assign @swetharepakula |
if err := common.EnsureServiceFinalizer(service, common.NetLBFinalizerV2, lc.ctx.KubeClient, svcLogger); err != nil { | ||
finalizer := common.NetLBFinalizerV2 | ||
if usesNegBackends { | ||
finalizer = common.NetLBFinalizerV3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change would require us to update the old controller to verify that it detects it's an RBS if it has V3 finalizer:
https://github.com/kubernetes/cloud-provider-gcp/blob/master/providers/gce/gce_util.go#L409
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right, we should add it. IT shouldn't be a problem unless someone removes the rbs annotation so we should update CCM anyway
@@ -94,7 +94,7 @@ func NewL4ILBSyncResult(syncType string, startTime time.Time, svc *corev1.Servic | |||
StartTime: startTime, | |||
SyncType: syncType, | |||
// Internal Load Balancer doesn't support strong session affinity (passing `false` all along) | |||
MetricsState: metrics.InitServiceMetricsState(svc, &startTime, isMultinetService, enabledStrongSessionAffinity, isWeightedLBPodsPerNode), | |||
MetricsState: metrics.InitServiceMetricsState(svc, &startTime, isMultinetService, enabledStrongSessionAffinity, isWeightedLBPodsPerNode, metrics.L4BackendTypeNEG), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider creating a variable for metrics.L4BackendTypeNEG
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this a constant, I'd say we don't need a variable to hold it
pkg/utils/common/finalizer.go
Outdated
updatedObjectMeta.Finalizers = slice.RemoveString(updatedObjectMeta.Finalizers, key, nil) | ||
} | ||
|
||
svcLogger.V(2).Info("Removing finalizers from service", "finalizerKeys", ensureRemoveKeys) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace ensureRemoveKeys with needToRemove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of having 2 for loops you can combine both in one:
svcLogger.V(2).Info("Removing finalizers from service", "finalizerKeys", ensureRemoveKeys) | |
updatedObjectMeta := service.ObjectMeta.DeepCopy() | |
modified := false | |
for _, key := range ensureRemoveKeys { | |
if HasGivenFinalizer(service.ObjectMeta, key) { | |
updatedObjectMeta.Finalizers = slice.RemoveString(updatedObjectMeta.Finalizers, key, nil) | |
svcLogger.V(2).Info("Removing finalizer from service", "finalizerKey", key) | |
modified = true | |
} | |
} | |
if !modified { | |
return nil | |
} | |
return patch.PatchServiceObjectMetadata(kubeClient.CoreV1(), service, *updatedObjectMeta) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was actually part of the parent commit that was merged yesterday
…trics. This will be used to track number of LBs with NEG backends vs ones with IG backends.
9938c2b
to
2934115
Compare
/hold |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mmamczur, swetharepakula 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 |
/unhold |
This extends the L4 NetLB metrics with
backend_type
field that will allow tracking the adoption and performance of NEG backed LBs vs IG ones.