Skip to content

Integrate ezbake as library for Carvel/Kubernetes tile support - #612

Merged
rizwanreza merged 18 commits into
mainfrom
carvel-kiln-integration-using-ezbake
Mar 23, 2026
Merged

Integrate ezbake as library for Carvel/Kubernetes tile support#612
rizwanreza merged 18 commits into
mainfrom
carvel-kiln-integration-using-ezbake

Conversation

@rizwanreza

@rizwanreza rizwanreza commented Jan 21, 2026

Copy link
Copy Markdown
Contributor

Embeds ezbake functionality into kiln as a Go library, adding full lifecycle support for baking, uploading, publishing, and reproducibly re-baking Carvel/Kubernetes tiles.

New commands

  • kiln carvel bake — Transforms an imgpkg bundle into a BOSH release and bakes it into a .pivotal file. When a Kilnfile.lock is present, downloads the cached BOSH release from Artifactory instead of regenerating locally.
  • kiln carvel upload — Generates a BOSH release from Carvel tile source, uploads the tarball to Artifactory, and writes Kilnfile.lock with the remote location and checksum.
  • kiln carvel publish — Bakes a final tile with version stamping and produces a JSON bake record for reproducible builds.
  • kiln carvel re-bake — Reproduces a tile build from a bake record, verifying source revision matches the git checkout.

New packages

  • internal/carvel — Core Baker that reads tile metadata (base.yml) and imgpkg bundles, generates a BOSH release via bosh create-release, creates a kiln-compatible structure in .ezbake/, and invokes kiln bake to produce the final .pivotal file.
  • internal/carvel/models — Data models for tile metadata, Carvel lockfiles, package installs, runtime configs, and jobs.

Architecture

The kiln carvel command group is registered in main.go and delegates to subcommands via jhanda.CommandSet. Each subcommand uses the standard flags.Standard embedded struct to load Kilnfiles with variable interpolation (e.g., from ~/.kiln/credentials.yml), keeping credential handling consistent with existing kiln commands. The Baker interface drives the imgpkg-to-BOSH transformation and tile assembly.

Other changes

  • Consistent lockfile serializationCarvelLockfile now uses releases (plural, as a slice) instead of release (singular), matching the standard KilnfileLock format in pkg/cargo.
  • CI lint fixes — Resolved all staticcheck and unused findings across the new files (capitalized error strings, redundant embedded field selectors, unnecessary fmt.Sprintf, unused functions).
  • CI test stability — Test BeforeEach blocks that run git commit now pass -c user.name / -c user.email inline so they work on CI runners without global git config.
  • Acceptance and unit tests — Full test coverage for all four subcommands, the Baker, and the Carvel model types.

Usage

# Bake a Carvel tile locally
kiln carvel bake --source-directory /path/to/tile --output-file tile.pivotal

# Upload the BOSH release to Artifactory (writes Kilnfile.lock)
kiln carvel upload --source-directory /path/to/tile --kilnfile /path/to/Kilnfile

# Publish a versioned tile and produce a bake record
kiln carvel publish --source-directory /path/to/tile --output-file tile.pivotal --version 1.0.0 --final

# Reproduce a tile from a bake record
kiln carvel re-bake --output-file tile.pivotal bake-record.json

Test plan

  • go test ./internal/carvel/... — Baker and model unit tests
  • go test ./internal/commands/... — All carvel subcommand tests (bake, upload, publish, re-bake)
  • go test ./internal/acceptance/carvel/... — Integration/acceptance tests
  • golangci-lint run ./... — Zero lint issues

rizwanreza and others added 5 commits March 10, 2026 15:54
Bring in changes from ezbake's yogesh/vks-tile-changes branch that
make the carvel baker work with any k8s runtime (VKS, TKR) instead
of being tied to the registry release.

- Remove separate package-install job; consolidate into registry-data
- Generate full K8s manifest templates (ServiceAccount, ClusterRole,
  ClusterRoleBinding, Secret, PackageInstall) per package install
- Add BOSH link consumer (cluster/cluster-info) for namespace resolution
- Switch runtime config from registry to tanzu-content release
- Inject content-namespace from BOSH link into values context
- Backfill tests for all new behaviors

ai-assisted=yes
Co-authored-by: Yogesh Katreddy Veera <yogesh.katreddy@broadcom.com>
Co-authored-by: Praveen Rewar <praveen.rewar@broadcom.com>

Made-with: Cursor
@rizwanreza
rizwanreza force-pushed the carvel-kiln-integration-using-ezbake branch from da7e134 to 9af3123 Compare March 10, 2026 20:54
@rizwanreza
rizwanreza marked this pull request as draft March 10, 2026 21:17
@rizwanreza
rizwanreza marked this pull request as ready for review March 12, 2026 20:10
Comment thread internal/carvel/models/lockfile.go Outdated
)

type CarvelLockfile struct {
Release CarvelReleaseLock `yaml:"release"`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend that we rename this to releases or at least serialize it as such so that the Kilnfile.lock is consistent with non-Carvel tiles

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Comment thread internal/commands/carvel.go Outdated
Comment thread internal/carvel/baker.go Outdated
@rizwanreza
rizwanreza requested a review from notrepo05 March 23, 2026 03:45
it's now in tas-ecosystem repo
@rizwanreza
rizwanreza merged commit 261b55e into main Mar 23, 2026
2 checks passed
@rizwanreza
rizwanreza deleted the carvel-kiln-integration-using-ezbake branch March 23, 2026 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants