preloader

kbld

Overview

kbld is an image solver to automate the process of building, pushing and resolving image references in development and deployment workflows.

A common use case is to resolve all immutable image references automatically and produce image lock files.

Theory

  • Know what kbld is and how it fits into the Carvel toolchain.
  • Review the kbld documentation

Review documentation (45min)

Practical

  • Know how to use kbld for resolving image references.
  • Create a kbld configuration file
cat <<- _EOF_ > "kbld.yaml"
---
apiVersion: kbld.k14s.io/v1alpha1
kind: Config
minimumRequiredVersion: 0.31.0
searchRules:
  - keyMatcher:
    path:
      - spec
      - images:
        allIndexes: true
  - keyMatcher:
    name: image
    updateStrategy:
      entireValue: {}
_EOF_
  • Create some sample YAML including images.
cat << _EOF_ > "source.yaml"
apiVersion: v1
kind: Thing
spec:
    image: docker.io/busybox
_EOF_
  • Run the file through kbld
cat source.yaml | kbld --file -

kbld will resolve the immutable reference and output to screen. But this is not super useful by itself. Instead the output can be read as input by other tools.

  • Write the resolved image references in a format compatible with imgpkg
cat source.yaml | \
kbld \
    --file - \
    --img-lock-output images.yml

The basic kbld tutorial is now complete!

For a longer form tutorial check out how kbld fits into a carvel package the hard way