kapp icon indicating copy to clipboard operation
kapp copied to clipboard

kapp should skip waiting on transient resources when delete strategy is orphan.

Open rohitagg2020 opened this issue 3 years ago • 4 comments

Describe the problem/challenge you have While doing a kapp delete, if delete-strategy is orphan for a resource, kapp doesn't delete that resource and its transient resource which is expected behavior. But kapp output continues to print the message which implies that it is waiting for the transient resource to get deleted and ultimately, it errors out. This leads to ambiguity.

Describe the solution you'd like If delete-strategy is orphan, then kapp should skip waiting on transient resources also.


Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible" 👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

rohitagg2020 avatar Mar 28 '22 04:03 rohitagg2020

related to #452

renuy avatar Mar 29 '22 15:03 renuy

Ran into this recently. Got lots of excellent help from the dev team in slack

It's also worth noting that when you apply the correct delete strategy to your application, and then run: kapp delete -a validation.app --wait=false you are greeted with a confusing error message:

kapp: Error: Expected all resources to be gone, but found: replicaset/validation-podinfo-7958dcdc9b (apps/v1) namespace: my-system-validation, pod/validation-podinfo-7958dcdc9b-qxjrz (v1) namespace: my-system-validation

This error reads like it failed, but it actually succeeded, and those resources should exist due to the delete-strategy annotation.

Full log: (with some details redacted)

kapp delete -a validation.app --wait=false
Target cluster 'https://my-eks-cluster.eks.amazonaws.com' (nodes: my-node.ec2.internal, 4+)

Changes

Namespace  Name  Kind  Age  Op  Op st.  Wait to  Rs  Ri

Op:      0 create, 0 delete, 0 update, 0 noop, 0 exists
Wait to: 0 reconcile, 0 delete, 0 noop

Continue? [yN]: y

12:10:17PM: ---- applying complete [0/0 done] ----
12:10:17PM: ---- waiting complete [0/0 done] ----

kapp: Error: Expected all resources to be gone, but found: replicaset/validation-podinfo-7958dcdc9b (apps/v1) namespace: my-system-validation, pod/validation-podinfo-7958dcdc9b-qxjrz (v1) namespace: my-system-validation

davidblum avatar Jan 10 '23 03:01 davidblum

The above error is related to #577. At the end of kapp delete, kapp tries to validate that all the resources have been deleted and then deletes the app metadata configmap and that's why --wait=false doesn't work well with delete because it's bound to fail in scenarios where deletion takes more than a second. The solution would be to not validate that the resources have been deleted or not in case --wait=false is specified.

praveenrewar avatar Jan 10 '23 04:01 praveenrewar

recent bump and more discussion here https://kubernetes.slack.com/archives/CH8KCCKA5/p1691422335059309

renuy avatar Aug 08 '23 16:08 renuy