vmware-tanzu / package-for-kubeapps

This repo will house the carvel tooling specific configuration and templating for a deployment of Kubeapps (https://github.com/vmware-tanzu/kubeapps) that will be leveraged by TCE
Apache License 2.0
5 stars 0 forks source link

Try out the new kctrl CLI pkg authoring tools #28

Open antgamdia opened 1 year ago

antgamdia commented 1 year ago

In kapp-controller v0.40 they released a new set of tools for authoring packages, it would be nice to explore them to see if we can leverage from them: https://carvel.dev/kapp-controller/docs/v0.40.0/authoring-command/

castelblanque commented 1 year ago

Gave it a quick try. It looks like the best starting point to generate a Carvel package from an existing format.

Both init and releasedon't have CLI params to automate it, but not actually needed as CLI provides a --yes parameter to accept existing data and execute. Both commands follow a wizard approach, getting the information from existing files (if any).

Package init

kctrl package init It generates the vendir file and syncs. This is something that we already have in place, so not needed at first sight.

Package release

kctrl package release --version <version>

This command could be interesting for us, but we need to check further if the outcome we get with it is what the Kubeapps package needs. For example, the package spec.valuesSchema.openAPIv3 looks empty.

More information in the Authoring packages with kctrl page.

100mik commented 1 year ago

Hello! Sorry for the delay, wanted to chime in on this one.

Both init and releasedon't have CLI params to automate it, but not actually needed as CLI provides a --yes parameter to accept existing data and execute. Both commands follow a wizard approach, getting the information from existing files (if any).

The idea is that init is run once to set up the PackageBuild resource. As of now I would suggest running a "mock release" , to update the PackageBuild resource with the value of the OCI registry you will be pushing to. We plan on either introducing a flag or moving this to interaction to the init command as well.

Once you have run these two commands once, the generated vendor, vendor.lock, package-build.yml and package-resources.yml can be committed to the repository.

With these in place, kctrl package release -version 1.0.0 will yield a release as expected, using already supplied values.

For moving on to the next release, you can either do a vendor sync after updating the tag in vendir.yml. Alternatively you could re-run the package init command and answer with the updated tag.

The resources file generated had creationTimestamp and releasedAt set to null.

Addressing this and the two points above this ^ I believe you are looking at package-resources.yml? These are files meant to be used for iterating over packages/ testing them via the dev command. The actual artifacts can be found in the folder carvel-artifacts. These will have the necessary values.

Package not tagged with the specified version, but maybe it is on purpose or needs additional step?

The bundle image itself is not tagged with a specific version intentionally, the version should be derived from spec.version in the Package CR.

images.yml file referencing all images used seems to be correct at first sight.

This is generated on the fly with the image references present at the time of runningrelease !

For example, the package spec.valuesSchema.openAPIv3 looks empty.

This would need you to update the PackageBuild file manually and tell it where the overlays are. It is something we elaborate on in the FAQs.

I am planning on putting together a quick screen grab (asciinema) packaging kubeaps like y'all do and putting it here. That will probably help out!

Thanks a lot for taking the authoring commands for a spin! These early experiments and feedback really help us iron out and tweak the experience to the best it can be 🚀

castelblanque commented 1 year ago

Many thanks for the information @100mik.

I am planning on putting together a quick screen grab (asciinema) packaging kubeaps like y'all do and putting it here

That would be awesome!

100mik commented 1 year ago

Sorry for the delay, took some time to put this together to illustrate the end to end flow with kctrl for kubeapps