Conversation
✅ Deploy Preview for kubernetes-sigs-cluster-api-ibmcloud ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: arshadd-b The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @Amulyam24 |
| Below are the cluster creation scenarios. | ||
| #### Creating a new cluster | ||
| - When resources will be created for new cluster in the cloud the tag will be attached. During deletion flow, will check for tag `powervs.cluster.x-k8s.io/cluster-uuid: UUID` and delete the resources. | ||
| - When resources will be created for new cluster in the cloud the tag will be attached. During deletion flow, will check for tag `powervs.cluster.x-k8s.io/cluster-uuid: UUID` and delete the resources. During creation if resource is created successfully but failed to attach the tag, will clean up the created resource as well before returning error. |
There was a problem hiding this comment.
I am not sure what else we can do, If we relax resource creation then deletion will be an issue.
I think we need to set some condition or event or something to let the user explicitly know that tag is failing so not able to proceed in creating the resource?
/cc @dharaneeshvrd
There was a problem hiding this comment.
But the thing is we have different calls for creation and attach . So the resource is created but attached failed we will error out to user and set condition but what about that created resource ?
There was a problem hiding this comment.
What if we retry the attach tag alone for a few times and if it doesn't succeed, then proceed with deletion, notifying the user to try a different region? Not sure if tagging is affected across regions
There was a problem hiding this comment.
yeah makes sense to me , we can have retry on attach tag itself and after that as well if it is failing, we will delete the resource and ask the user to try in different region
There was a problem hiding this comment.
Say the tag fails for multiple retries and you want to delete all the resources created by the controller then in the next reconcile the the controller will again creates the resources. Isn't it?
There was a problem hiding this comment.
yeah actually what I am thinking if attach tag is failing , we will retry there itself instead of reconcile. If after retries still it fails we will delete resource and error to user to try in different region. If again user trigger cluster creation in the same region then yes again reconcile will happen and same process will be repeated . But not sure what else we can do here .
There was a problem hiding this comment.
If after retries still it fails we will delete resource and error to user trying in different region.
How do you do this in controller?
There was a problem hiding this comment.
If after retries still it fails we will delete resource and error to user trying in different region.
How do you do this in controller?
I think we will just error out to user, User has to provide different region
There was a problem hiding this comment.
Had a discussion in CAPIBM meeting and also with Arshad and here are the points we can do
- Lets create a condition type something like AttachTag and set it on the IBMPowerVSCluster whenever a tag creation fails
- The condition message should be descriptive, Should be like "Failed to attach tag to newly created Workspace "workspace-name", either manually attach tag or delete the cluster and retry it in different region.
There was a problem hiding this comment.
Thanks @Karthik-K-N I will update the proposal as well with these details
105b534 to
f8fe67d
Compare
f8fe67d to
2ed7377
Compare
| Below are the cluster creation scenarios. | ||
| #### Creating a new cluster | ||
| - When resources will be created for new cluster in the cloud the tag will be attached. During deletion flow, will check for tag `powervs.cluster.x-k8s.io/cluster-uuid: UUID` and delete the resources. | ||
| - When resources will be created for new cluster in the cloud the tag will be attached. During deletion flow, will check for tag `powervs.cluster.x-k8s.io/cluster-uuid: UUID` and delete the resources. During creation if resource is created successfully but failed to attach the tag, will retry for some time and if it still fails, we will set condition with descriptive message `Failed to attach tag to newly created Workspace workspace-name, either manually attach tag or delete the cluster and retry it in different region.` |
There was a problem hiding this comment.
This approach LGTM but I think it should be documented in generic format, . @Amulyam24 Please suggest
There was a problem hiding this comment.
I think it will be good to list down failure and success scenarios separately for readability.
You might want to add details about the new condition as well with an example?
There was a problem hiding this comment.
Hi @Amulyam24 I am done with suggested changes
Thanks
b4b218a to
fb3be78
Compare
fb3be78 to
a20e0b8
Compare
Amulyam24
left a comment
There was a problem hiding this comment.
Overall LGTM, have added minor comments.
| When the user triggers deletion of a cluster where tag attachment previously failed, the controller will check the condition status. Based on this condition, the controller will determine whether to proceed with resource deletion. | ||
|
|
There was a problem hiding this comment.
This point seems vague, you might have to add specific details on the action being taken by the controller.
| Below are the cluster creation scenarios. | ||
| #### Creating a new cluster | ||
| - When resources will be created for new cluster in the cloud the tag will be attached. During deletion flow, will check for tag `powervs.cluster.x-k8s.io/cluster-uuid: UUID` and delete the resources. | ||
| ##### Tag Attachment Scenarios |
There was a problem hiding this comment.
Can you PTAL at the format of this section?
| 1. Retry Attempts: The controller retries attaching the tag multiple times over a configured period. | ||
| 2. After Retries Fail: If all retries fail, the controller: | ||
| - Sets a warning condition on the cluster | ||
| - Adds an error message like: "Failed to attach tag to newly created Workspace <workspace-name>. Please manually attach the tag or delete the cluster and recreate it." |
There was a problem hiding this comment.
nit: an example of the condition in the status field would be helpful
| 1. Retry Attempts: The controller retries attaching the tag multiple times over a configured period. | ||
| 2. After Retries Fail: If all retries fail, the controller: | ||
| - Sets a warning condition on the cluster | ||
| - Adds an error message like: "Failed to attach tag to newly created Workspace <workspace-name>. Please manually attach the tag or delete the cluster and recreate it." |
There was a problem hiding this comment.
Please manually attach the tag or delete the cluster and recreate it."
@arshadd-b @Karthik-K-N, for my understanding, what would be the purpose of user manually attaching the tag if the tag creation fails when we would proceed with deletion based on the condition being set and it is being handled for success and failure case?
What this PR does / why we need it:
Improves tags proposal
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 #
Special notes for your reviewer:
/area provider/ibmcloud
Release note: