This topic tells you how to manage ClusterStacks with your Tanzu Build Service (commonly known as TBS).
A ClusterStack is a cluster scoped resource that provides the build and run images for the Cloud Native Buildpack stack that will be used in a Builder.
Tanzu Build Service includes stacks for Ubuntu Bionic and Ubuntu Jammy distributions.
Note: Ubuntu Bionic will no longer receive support starting in April 2023. Migrate to Jammy stacks as soon as possible before this date.
Stacks are installed automatically during installation by automatic dependency updates or installed manually using the kp
CLI. These ClusterStacks are referenced in corresponding ClusterBuilder resources.
For more information about security and patching cadence for these stacks and their ideal use cases, see Stacks. You can access more detailed release notes for the stacks by following these links:
Name | ID |
---|---|
tiny | io.paketo.stacks.tiny |
base | io.buildpacks.stacks.bionic |
full | io.buildpacks.stacks.bionic |
tiny-jammy | io.buildpacks.stacks.jammy.tiny |
base-jammy | io.buildpacks.stacks.jammy |
full-jammy | io.buildpacks.stacks.jammy |
The kp
CLI can be used to manage clusterstack. See the kpack-cli help text.
$ kp clusterstack
Cluster Stack Commands
Usage:
kp clusterstack [command]
Aliases:
clusterstack, csk
Available Commands:
create Create a cluster stack
delete Delete a cluster stack
list List cluster stacks
save Create or update a cluster stack
status Display cluster stack status
update Update a cluster stack
Flags:
-h, --help help for clusterstack
Use "kp clusterstack [command] --help" for more information about a command.
Note: These docs assume you are using kp CLI v0.10.x with Tanzu Build Service v1.10.x. If a feature is not working, you might need to upgrade your CLI.
Note: Only Build Service Admins (that is, users with the pb-admin-role
kubernetes ClusterRole) can perform clusterstack commands.
Users can create a clusterstack by using build and run images from a Docker registry or the local machine. The run and build images provided during clusterstack creation are uploaded to the kp_default_repository
, which is the docker-repository
specified during Tanzu Build Service install.
If you use a Docker registry for the stack images:
kp clusterstack create <clusterstack-name> \
--build-image <location of build-image> \
--run-image <location of run-image>
Note: The user must have read access to the source Docker registry and write access to the kp default registry on the local machine.
For example:
kp csk create my-clusterstack \
-b gcr.io/test/stack/run:latest
-r gcr.io/test/stack/build:latest
If you use local stack images created with docker save
:
kp clusterstack create <clusterstack-name> \
--build-image <path to build-image>.tar \
--run-image <path to run-image>.tar
Note: The user must have write access to the kp default registry on the local machine.
For example:
kp csk create my-clusterstack \
-b ./local-build-image.tar \
-r ./local-run-image.tar
Users can update a stack by using build and run images from a Docker registry or the local machine. The run and build images provided during clusterstack update are uploaded to the kp-default-repository
, which is the kp_default_repository
specified during Tanzu Build Service install.
If using a Docker registry:
kp clusterstack update <stack-name> \
--build-image <location of build-image> \
--run-image <location of run-image>
Note: The user must have read access to the source Docker registry and write access to the kp default registry on the local machine.
For example:
kp csk update my-clusterstack \
-b gcr.io/test/stack/run:latest
-r gcr.io/test/stack/build:latest
If using local stack images created with docker save
:
kp clusterstack update <stack-name> \
--build-image <path to build-image>.tar \
--run-image <path to run-image>.tar
Note: The user must have write access to the kp default registry on the local machine.
For example:
kp csk update my-clusterstack \
-b ./local-build-image.tar \
-r ./local-run-image.tar
Users can create or update a ClusterStack by using the save
command. The kp clusterstack save
command is used exactly the same as kp clusterstack create
and kp clusterstack update
, but it determines whether a clusterstack needs to be created or updated.
Users can get the current status of a clusterstack by running:
kp clusterstack status <stack-name>
The following is an example of the output for this command:
Status: Ready
ID: org.cloudfoundry.stacks.cflinuxfs3
Run Image: paketo/run:full-cnb
Build Image: paketo/build:full-cnb
Users can delete an existing clusterstack by running:
kp clusterstack delete <stack-name>
Note: The user is not asked for a confirmation before deletion.
Users can view the list of all ClusterStacks created:
The following is an example of the output for this command:
NAME READY ID
base True io.buildpacks.stacks.bionic
full True io.buildpacks.stacks.bionic
tiny True io.paketo.stacks.tiny
default True io.buildpacks.stacks.jammy
base-jammy True io.buildpacks.stacks.bionic
full-jammy True io.buildpacks.stacks.bionic
tiny-jammy True io.buildpacks.stacks.jammy.tiny
To achieve Stack only updates for an Image, you can pin the Buildpack versions in the Builder used for creating the image.