eks-anywhere icon indicating copy to clipboard operation
eks-anywhere copied to clipboard

Avoid using force apply

Open g-gaston opened this issue 3 years ago • 0 comments

What would you like to be added:

Avoid using kubectl apply --force from the CLI. Specially to apply changes to the eks-a resources.

Why is this needed:

kubectl apply --force follows the following behavior:

  1. Generate the path/update in the same way it would for a normal apply
  2. Try to patch the resource.
  3. If step 2, fails delete the resource.
  4. Recreate the resource using only the provided spec (without taking into account the current state of the resource)

This can be problematic, specially for eks-a cluster resources, where we have different validations to avoid users creating resources under certain conditions (without a paused annotation, etc.). When we start offering full lifecycle support, this can interfere with how the controller works, since deleting an eks-a cluster will trigger deleting the actual infrastructure and losing everything stored in that cluster.

g-gaston avatar Sep 19 '22 21:09 g-gaston