-
Notifications
You must be signed in to change notification settings - Fork 43
Cluster reconciliation should reconcile exited ELB #53
Cluster reconciliation should reconcile exited ELB #53
Conversation
9fb70dd
to
486939c
Compare
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.
@ashish-amarnath What do you think about cleaning up the load balancer on cluster delete so that we don't have to clean up exited containers on create?
I'm curious how you're ending up with exited containers in the first place -- what sort of workflow are you using?
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 out of scope for this PR but do we have any tests that can verify this change?
@amy Yes, we should have a good testing story for capd as a whole. This scenario, in particular, is kinda hard to test via automated tests. The repro steps for this is pretty much me doing bad things on purpose. |
interesting... i'd really like to find a balance here between readability and robustness. CAPD doesn't have to be robust as it will never be a production system and should explicitly be designed to not be a robust system and more to be a general example of cluster-api assumptions. So I'm thinking about what is the equivalent use case in cluster-api-provider-aws -- if we stop a node I don't think even CAPA is smart enough to clean up the old stopped node. Because of that I think this logic should move into to the cluster delete and the SetupLoadBalancer should assume the environment is clean. Does that seem reasonable to you? |
@chuckha drawing comparison w/ capa.. this is equivalent to deleting the ELB fronting the API server. At which point, IIRC, capa controller will reconcile the deleted ELB. No? |
That's a good comparison, certainly more accurate than mine. There seems to be no equivalent state between aws and docker with regards to killing the container. A stopped container == what in AWS world? I would suggest that instead of cleaning up before creating that we instead add The only use case this particular code is covering is adding support for the |
Depends on which container you stop. Stopping the |
ok, I think I see the use case now. The outlined use case for this is simulating a stopped load balancer. This situation doesn't exist in AWS since you cannot stop and ELB, but it does exist in docker. Do I have it right? |
This is correct.
In AWS you can delete the ELB from the AWS console and the capa cluster actuator will recreate it. |
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.
/approve
Thank you for clarifying the use case regarding this situation, much appreciated
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ashish-amarnath, chuckha 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 |
/lgtm on amy's behalf |
/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.
Overall, lgtm, but we should be using logging now that #27 has merged.
actuators/actuators.go
Outdated
@@ -40,9 +44,11 @@ func getRole(machine *clusterv1.Machine) string { | |||
} | |||
|
|||
func getExternalLoadBalancerNode(clusterName string) (*nodes.Node, error) { | |||
fmt.Printf("Getting external load balancer node for cluster %q\n", clusterName) |
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.
These fmt.Printf
s should be replaced with log statements now that #27 has merged.
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.
#27 added loggers into the clusterActuator and machineActuators. This function is not in either of those scopes. So, we'll need to use klog
or something like that.
Looks like the build also failed because of undefined: fmt
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.
the interim step is to pass a log through to all of these functions and rely on the logger interface. we should not use klog anywhere.
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 should not use klog anywhere.
+1
always pass a logger interface and not the logging implementation directly, whether it's fmt or klog.
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.
fixed!
* get only running ELB containers * remove exited ELB containers with name conflict Signed-off-by: Ashish Amarnath <[email protected]>
e43c100
to
3aa185e
Compare
/lgtm @detiber you ok removing the hold? |
/hold cancel |
Signed-off-by: Ashish Amarnath [email protected]
What this PR does / why we need it:
Cluster reconciliation should reconcile deleted ELBs
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #52
Special notes for your reviewer:
Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.
Release note: