Skip to content
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

Tag controller created resources in cloud rather than using ControllerCreated status field #1938

Open
Karthik-K-N opened this issue Sep 2, 2024 · 2 comments
Labels
area/provider/ibmcloud Issues or PRs related to ibmcloud provider kind/feature Categorizes issue or PR as related to a new feature.
Milestone

Comments

@Karthik-K-N
Copy link
Contributor

/kind feature
/area provider/ibmcloud

Describe the solution you'd like
[A clear and concise description of what you want to happen.]

Currently in Power VS cluster reconciler whenever a resource is created by controller it internally sets controllercreated filed under respective resource to true(For ref) , Which was initially introduces to allow proper cleanup of newly created resource vs the use of existing resources.

Though its working as expected and serving the purpose, we forsee few of the disadvantage of using this field.

  1. The filed is set to true during the first reconcilation of resource as the resource is created, during next reconcilation the field is never touched as resource is already exist in cloud, so which makes controller logic not idempotent and if the first reconcilation event is missed controller behavior changes. Its against k8s principle of reconcilation of having level trigger rather than edge triggered.
  2. The status is expected to created from spec, considering the scenario of back and recover, If we move the spec to fresh management cluster which setting the status , the controller created will be set as false as the resource already exist in cloud but it was created during its previous concilation.

In order to mitigate these problems, One of the alternatives discussed was tagging the resource in cloud, In general the highlevel idea is

  1. Whenever a resource is created in cloud tag the resource with some unique idnetifier with predefined tag, During deletion we will use this tag to idetify whether to delete or preserve the resources.

Limitations

  1. Currently all the resources does not support tagging, For example we use DHCP server in Power VS workspace which does not allow us to tag.

Alternatives discussed

  1. Using predetermined name for resource for the controller created resources.
    • Idea was to name the resource with specific format for controller created resources and use it identify for deletion ,

Limitation:

  • We allow users to specify the name they wish to have it for resources.

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. area/provider/ibmcloud Issues or PRs related to ibmcloud provider labels Sep 2, 2024
@Karthik-K-N
Copy link
Contributor Author

We had discussed about deciding name for the tag in slack. As of now we decided to use following format

powervs.cluster.x-k8s.io-resource-owner:<cluster_name>

@mkumatag
Copy link
Member

We had discussed about deciding name for the tag in slack. As of now we decided to use following format

powervs.cluster.x-k8s.io-resource-owner:<cluster_name>

LGTM

@mkumatag mkumatag added this to the Next milestone Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/provider/ibmcloud Issues or PRs related to ibmcloud provider kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

3 participants