Introducing kctrl package authoring commands
by Rohit Aggarwal, Soumik Majumder — Aug 19, 2022
In today’s post, we are going to see how the kctrl CLI eases the process of package authoring.
A package is a combination of configuration metadata and OCI images. It informs the package manager what software it holds and how to install itself onto a Kubernetes cluster.
A package author encapsulates, versions and distributes Kubernetes manifests as package for package consumers to install on a Kubernetes cluster. They can choose to create a package by using a third party manifest like ones released by cert-manager, Dynatrace, etc., or they can distribute their own project Kubernetes manifest by creating a package.
Typical Package Authoring journey ¶
Package Authoring is an iterative process and below are the most common steps performed by the authors:
- Authors know about the Kubernetes manifest they want to package.
- Add/change the manifest by adding additional overlay/template and test the package. This is the iterative part where authors want to make the changes and test them quickly.
- Once all the manifest are in place, create the imgpkg bundle (to be mentioned in the package) and the package itself.
- Add the package to a package repository for distribution.
kctrl help package authors? ¶
Today, before package authors start on their authoring journey, are required to know about tools like imgpkg, kbld, vendir, etc. which are building blocks for Carvel packages. Our intention is to introduce a set of CLI commands that would guide authors through the common packaging steps to enable them to create and release the packages without being familiar with these tools, while also learning about them in the process. We aim to achieve most of the scenarios using kctrl. For more complex use cases authors can always leverage these tools.
kctrl package authoring commands? ¶
kctrl package init: To initialize the Package, PackageInstall and other resources. These resources will be used by the subsequent commands.
kctrl dev: This command will use the Package and PackageInstall generated above and deploy them locally. By locally, we mean that kapp-controller need not be installed on the Kubernetes cluster. Also, it will eliminate the need to push the imgpkg bundle to an OCI registry during the development stage. This will be useful when you are develping the additional overlay/template.
kctrl package release: This command will create and upload the imgpkg bundle with all the Kubernetes manifests of the software. Also, it will create the
metadata.ymlfiles which can be either checked in to the package repository or released as part of the release artifacts.
kctrl package repo release: This command will create and push the package repository bundle consisting of all the Package and PackageMetadata files present in the
packagesfolder of the working directory. This repository bundle can later on be consumed by package consumers.
We’d love your feedback! ¶
kctrl v0.40.0 is an alpha release of the package authoring commands. We are excited for you to try out the tool and eager to hear about your experiences and how it solves your use-case. There is a GitHub issue created to collect the feedback/feature request/suggestion which you would like to see in the future releases. We encourage you to post it there. Alternatively, you can post it in the #carvel in Kubernetes slack channel.
Are you using Carvel? ¶
If you are using any of the Carvel tools, first we would like to thank you! Our goal is to grow the community, improve Carvel and help each other. One of the best ways that helps us do that is to know how others are using the tools. Please add a comment to this pinned issue with details on your use case with any of the Carvel tools.
Join the Carvel Community ¶
We are excited to hear from you and learn with you! Here are several ways you can get involved: