-
Notifications
You must be signed in to change notification settings - Fork 200
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
Fix: unused ingress resources cleanup for external listeners #954
Conversation
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.
Nothing major really from me, though I'm no expert on this.
for _, res := range externalListenerResources { | ||
o := res(log, eListener, ingressConfig, name, defaultControllerName) |
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.
Naming here is once again a bit hard to understand with res
and o
.
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 is from the previous state of the repo.
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.
I know, it's more of a comment that I don't think it's the greatest naming scheme ever. :D
You don't need to change it (my approval doesn't depend on it at all), it just would be nicer I think.
deletionCounter++ | ||
} | ||
} | ||
if deletionCounter > 0 { | ||
log.Info(fmt.Sprintf("Removed '%d' resources for envoy ingress", deletionCounter)) | ||
} |
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.
Question: Wouldn't it be better to put a log message in the place of deleteCounter++
stating deleted envoy ingress resource %s
where %s
is the name of the object?
This way we will see removed 5 resources for envoy ingress
, not sure if that is more useful than seeing removed resources for envoy ingress
vs. the more informative listing of removed resources.
I can be convinced we don't need the resource level info, just curious.
Same for the Istio version.
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.
Then it would be 5 remove message in case envoy. I think it is a good idea to do this with lower log level like: log.V(1).Info(...) What do you think?
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.
Yeah, I think this one line would be great for info and maybe we could add a debug level message for the individual resources.
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.
I'm still not too keen on some of these EListener shorhands but I wouldn't block the PR on that. Otherwise all looks good to me!
|
d90d972
to
2ce938d
Compare
What's in this PR?
Removing unused ingress resources (nodePort services, istio ingress, envoy ingress) for external listeners
Why?
Koperator uses envoy as the ingress controller by default. When the users want to expose their Kafka brokers via LoadBalancer, the Koperator deploys these necessary resources: . But it doesn’t seem to remove these resources when they are not needed, for example, the users switch from LoadBalancer to NodePort. Moreover, the brokers are still reachable via the stale loadbalancer service. Same applies when changing from NodePort to LoadBalancer and from istioingress ingresscontroller to envoy ingress controller and vice-versa.
Additional context
Checklist