Skip to content

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

@Karthik-K-N

Description

@Karthik-K-N

/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.]

Metadata

Metadata

Assignees

Labels

area/provider/ibmcloudIssues or PRs related to ibmcloud providerkind/featureCategorizes issue or PR as related to a new feature.priority/important-soonMust be staffed and worked on either currently, or very soon, ideally in time for the next release.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions