This topic tells you how to create a custom ClusterBuildpack for Tanzu Build Service. A ClusterBuildpack is a cluster scoped version of a Buildpack.

You can create a custom ClusterBuildpack and add it to a ClusterBuilder in your environment. A common use case for this is if you want to use an alternative JVM. For more information, see Use an Alternative JVM in the Tanzu Buildpacks documentation.

Create a ClusterBuildpack

If you create your own buildpack image, you can create your ClusterBuildpack from it. For example:

apiVersion: kpack.io/v1alpha2
kind: ClusterBuildpack
metadata:
  name: sample-cluster-buildpack
spec:
  serviceAccountRef:
    name: sample-sa
    namespace: sample-namespace
  image: gcr.io/paketo-buildpacks/java@sha256:fc1c6fba46b582f63b13490b89e50e93c95ce08142a8737f4a6b70c826c995de

Add your ClusterBuildpack to a ClusterBuilder

After creating your ClusterBuildpack, you can create a ClusterBuilder that references this buildpack. For example:

---

apiVersion: kpack.io/v1alpha2
kind: ClusterBuilder
metadata:
  name: my-cluster-builder
spec:
  tag: gcr.io/sample/builder
  stack:
    name: base-jammy
    kind: ClusterStack
  store:
    name: default
    kind: ClusterStore
  serviceAccountRef:
    name: default
    namespace: default
  order:
    - group:
      - name: sample-cluster-buildpack
        kind: ClusterBuildpack
        id: paketo-buildpacks/nodejs
        version: 1.2.3
check-circle-line exclamation-circle-line close-line
Scroll to top icon