carvel-dev / carvel-dev/kapp-controller
Ordering of resource across Kapp deploys
- Dominant language
- Go
- Stars
- 323
- Forks
- 127
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 4
Description
**Describe the problem/challenge you have**
For example, let’s say I have an packageinstall `kns` that deploys knative-serving with contour, and I have another app hello, deployed independently from the pkgi, that just contains a simple knative service. If I delete my `kns` pkgi, `hello` will start failing because no knative stuff is on the cluster. When I reapply my pkgi `kns`, `hello` will try to get applied right away, before `kns` has a chance to finish deploying. Most of the time, things sort themselves out, but sometimes `hello` may be applied to the cluster before Knative is totally ready. Maybe a knative webhook isn't ready, and some defaults don’t get set, or maybe some, but not all, of the CRDs for Knative are applied, so an internal resource doesn't get created as part of the new knative service.
I learned in this [thread](https://kubernetes.slack.com/archives/CH8KCCKA5/p1643228441169700) that it currently is not possible.
Maybe I am wrong about this, but it seems unreasonable to expect a controller to properly reconcile a resource before all of the controller's accompanying resources,svcs,crds,etc are fully ready. I'm not sure how else to avoid this situation.
**Describe the solution you'd like**
I want to be able to make `hello` wait until `kns` is totally ready before trying to deploy again.
I can imagine a set of annotations similar to the change group annotations:
```
kapp.k14s.io/dependent-resource-type: "App"
kapp.k14s.io/dependent-resource-name: "kns"
kapp.k14s.io/dependent-resource-namespace: "default"
```
Perhaps kapp-controller could use these annotations to check that the described resource is indeed ready before trying to reconcile the app.
**Anything else you would like to add:**
Happy to hear other ideas, including ones that don't involve changing kapp-controller, on how to address this situation 😄
---
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.
Contributor guide
Assessment
This issue has not been assessed yet.