-
Notifications
You must be signed in to change notification settings - Fork 304
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
Bugfix: don't GC instance groups while multi-cluster ingresses exist #838
Conversation
Hi @skmatti. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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. |
/assign mrhohn |
/assign bowei |
/ok-to-test |
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 overall, some minor comments
BTW should we fix the GC logic for L7ILB here as well? It may be as simple as tweaking these: ingress-gce/pkg/utils/utils.go Lines 288 to 305 in 78801b3
|
Discussed offline, seems like that works properly as is and doesn't need any fix :) |
Will let @bowei also take a look. |
@@ -631,35 +612,24 @@ func updateAnnotations(client kubernetes.Interface, name, namespace string, anno | |||
func (lbc *LoadBalancerController) ToSvcPorts(ings []*v1beta1.Ingress) []utils.ServicePort { | |||
var knownPorts []utils.ServicePort | |||
for _, ing := range ings { | |||
// Only resources associated with GCE Ingress are managed by this controller. | |||
if !utils.IsGCEIngress(ing) { |
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.
Do we want to do the filter inside or outside this function?
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.
We either needed to have toKeepGceIngresses
and toKeepIngresses
both or handle this filter in the downstream. I think second one is straightforward. I improved the doc of both helper methods to specify that it returns a list of svc ports owned by this controller.
// toLbNames translates a list of ingresses into their corresponding load balancer names. | ||
func toLbNames(ings []*v1beta1.Ingress) []string { | ||
lbNames := make([]string, 0, len(ings)) | ||
for _, ing := range ings { | ||
// Only resources associated with GCE Ingress are managed by this controller. | ||
if !utils.IsGCEIngress(ing) { |
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.
see comment above
// GCBackends garbage collects backends for all Ingresses given some existing state. | ||
GCBackends(state interface{}) error | ||
// GCBackends garbage collects backends for all ingresses given a list of ingresses to exclude from GC. | ||
GCBackends(toKeep []*v1beta1.Ingress) error |
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 might want to sync up with rohit about why this was interface
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.
Discussed offline with Rohit and interface is not required anymore.
/assign @rramkumar1 |
/lgtm It seems strange that toCleanup is not related at all with the GC action (e.g. it is only after GC deletes the resources for a given Ingress that the finalizer is removed). It seems worthwhile to have a follow on change that makes it more explicit connection, as this will lead to bugs. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bowei, MrHohn, skmatti 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 |
Fixes #836
Existing GC workflow deletes instance groups as soon all GCE ingresses are deleted. But, instance groups should be retained as they are shared by multi-cluster ingresses as well.