kapp-controller icon indicating copy to clipboard operation
kapp-controller copied to clipboard

Provide a first-class API (as part of App CR status) for discovering deployed resources by App CR

Open antgamdia opened this issue 3 years ago • 1 comments

What steps did you take:

  1. Create a PackageInstall via kubectl (not using kapp deploy, I mean)
  2. Get the generated App via kubectl, kubectl get app my-app -oyaml

What happened:

The App does not have any labels/annotations.

What did you expect:

I would have expected this App CR to have something like:

  labels:
    kapp.k14s.io/app: "1637859835366892605"

Anything else you would like to add:

This problem has been discussed at this Carvel community channel thread and there is a temporary workaround: get the ConfigMap whose name is <appname>-ctrl and get from the Data["spec"] the key labelValue.

The motivation main motivation for having this annotation exposed by the App CR is for other clients (like, in my case, the Kubeapps project) to have bidirectional traceability of the resources created as a consequence of an App CR (regardless they're using Kapp or just plain kubectl calls).

Particulary, Kubeapps needs this to display to the users which Kubernetes resources are part of an installation. Some examples and demo video on the Carvel bundles support in Kubeapps: https://github.com/kubeapps/kubeapps/pull/3816

Environment:

  • kapp Controller version (execute kubectl get deployment -n kapp-controller kapp-controller -o yaml and the annotation is kbld.k14s.io/images):
        - Path: /Users/dhelfand/go/src/github.com/vmware-tanzu/carvel-kapp-controller
          Type: local
        - Dirty: false
          RemoteURL: https://github.com/vmware-tanzu/carvel-kapp-controller
          SHA: 8167469ad3d7c61ce1d170e0f809b437308ce070
          Tags:
          - v0.30.0
  • Kubernetes version (use kubectl version)
- Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.4", GitCommit:"b695d79d4f967c403a96986f1750a35eb75e75f1", GitTreeState:"clean", BuildDate:"2021-11-17T15:48:33Z", GoVersion:"go1.16.10", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.1", GitCommit:"5e58841cce77d4bc13713ad2b91fa0d961e69192", GitTreeState:"clean", BuildDate:"2021-05-21T23:01:33Z", GoVersion:"go1.16.4", Compiler:"gc", Platform:"linux/amd64"}

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.

antgamdia avatar Nov 25 '21 17:11 antgamdia

Thanks for this @antgamdia. I think adding this via the status for the App CR makes sense. This could then be also shared with PackageInstalls/PackageRepositories. It may even be an interesting way to track which Package CRs are part of a PackageRepository as documented in #124.

danielhelfand avatar Nov 29 '21 15:11 danielhelfand