Install Tanzu Build Service on KIND cluster

In this post, I will be covering the steps to be followed to install TBS in KIND (created in mac os):

  1. Install Docker Desktop
  2. Install Kubectl
  3. Install KIND
    brew install kind
  4. Create KIND cluster
kind create cluster
Creating cluster "kind" ...
 ✓ Ensuring node image (kindest/node:v1.21.1) 🖼
 ✓ Preparing nodes 📦
 ✓ Writing configuration 📜
 ✓ Starting control-plane 🕹️
 ✓ Installing CNI 🔌
 ✓ Installing StorageClass 💾
Set kubectl context to "kind-kind"
You can now use your cluster with:

kubectl cluster-info --context kind-kind

Have a question, bug, or feature request? Let us know! https://kind.sigs.k8s.io/#community 🙂

 

Download TBS manually from Tanzu network or using Pivnet CLI:

https://network.pivotal.io/products/build-service/ – Signup is required to download the executable from Tanzu Network

Below pivnet CLI commands can be used too:

How to Install Pivnet CLI:

brew install pivotal/tap/pivnet-cli

https://network.pivotal.io/users/dashboard/edit-profile – To generate or view API token

# To login to Pivnet

pivnet login --api-token='<API Token>'

# To list the Tanzu build service release versions: 
pivnet releases --product-slug='build-service'

# Download specific version

pivnet download-product-files --product-slug='build-service' --release-version='1.3.1' --product-file-id=1058205
2021/10/30 23:03:01 Downloading 'kp-darwin-0.4.0' to 'kp-darwin-0.4.0'
 43.51 MiB / 43.51 MiB [===========================================] 100.00% 24s
2021/10/30 23:03:27 Verifying SHA256
2021/10/30 23:03:27 Successfully verified SHA256

# Rename the downloaded binary file to kp.

# On the command line, make the kp binary file executable:

chmod +x kp

# Move the binary file into a directory that is on your PATH:

mv kp /usr/local/bin/kp

Note: https://network.tanzu.vmware.com/users/dashboard/eulas, refer to manually accept eula.

# Login to docker-hub. This step will save docker-hub credentials to your K8s cluster. Note: You can use other repository too.

docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: eknath009
Password:
Login Succeeded

docker login index.docker.io
Authenticating with existing credentials...
Login Succeeded

Additional tools: I know too many tools, but these are tiny and doesn’t take more than few mins.

Install below mentioned Carvel CLIs for your operating system. These can be found Tanzu Network pages:

  • kapp is a deployment tool that allows users to manage Kubernetes resources in bulk.
# Download using pivnet CLI or from network pages: 

pivnet download-product-files --product-slug='kapp' --release-version='0.40.0' --product-file-id=1047334

# Rename the downloaded binary file to kapp.

# On the command line, make the kapp binary file executable:

chmod +x kapp

# Move the binary file into a directory that is on your PATH:

mv kapp /usr/local/bin/kapp
  • ytt is a templating tool that understands YAML structure.
# Download using pivnet CLI or from network pages: 

pivnet download-product-files --product-slug='ytt' --release-version='0.37.0' --product-file-id=1059869

# Rename the downloaded binary file to ytt.

# On the command line, make the ytt binary file executable:

chmod +x ytt

# Move the binary file into a directory that is on your PATH:

mv ytt /usr/local/bin/ytt
  • kbld is tool that builds, pushes, and relocates container images
# Download using pivnet CLI or from network pages: 

pivnet download-product-files --product-slug='kbld' --release-version='0.31.0' --product-file-id=1047486

# Rename the downloaded binary file to kbld.

# On the command line, make the kbld binary file executable:

chmod +x kbld

# Move the binary file into a directory that is on your PATH:

mv kbld /usr/local/bin/kbld
  • imgpkg is tool that relocates container images and pulls the release configuration files. Note: imgpkg 0.12.0 or higher is required for installation.
# Download using pivnet CLI or from network pages: 

pivnet download-product-files --product-slug='imgpkg' --release-version='0.20.0' --product-file-id=1062573

# Rename the downloaded binary file to imgpkg.

# On the command line, make the imgpkg binary file executable:

chmod +x imgpkg

# Move the binary file into a directory that is on your PATH:

mv imgpkg /usr/local/bin/imgpkg
  • Install KP CLI:

kp CLI is used for interacting with your Tanzu Build Service (TBS) installation on K8s cluster

# Download KP CLI from network pages: 

https://network.pivotal.io/products/build-service/

# Rename the downloaded binary file to kp.

# On the command line, make the kp binary file executable:

chmod +x kp

# Move the binary file into a directory that is on your PATH:

mv kp /usr/local/bin/kp

https://network.pivotal.io/users/dashboard/eulas

 

$ docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: eknath009
Password:
Login Succeeded

$ docker login registry.tanzu.vmware.com
Username: <registered username for Tanzu networks>
Password:
Login Succeeded

$ imgpkg copy -b "registry.pivotal.io/build-service/bundle:1.3.1" --to-repo eknath009/build-service

copy | exporting 17 images...
copy | will export registry.pivotal.io/build-service/bundle@sha256:c1b63312ca2333298ede54f6121f17c53bb7d1b68256dbd6dccbc1ba88abded1
copy | will export registry.tanzu.vmware.com/build-service/cert-injection-webhook@sha256:919e1c6be7a3dfa95e441e02ee5c149af6bb744e373fcd369a58d87d3a9825aa
copy | will export registry.tanzu.vmware.com/build-service/dependency-updater@sha256:53874d78a8ad84b3bb96005c0e8da392ab0f42df92f913b47db26597e936dff2
copy | will export registry.tanzu.vmware.com/build-service/kpack-build-init-windows@sha256:6054e3aaa476e9dc637b9852aff598c208420d913ef03e83a68c52e6e1514d6b
copy | will export registry.tanzu.vmware.com/build-service/kpack-build-init@sha256:277e663bdba4c2785a7c23577bdcb1d23d7ab67cdc0bff2ed3dcfa06ec57aadc
copy | will export registry.tanzu.vmware.com/build-service/kpack-completion-windows@sha256:ca921138eeba5cb77c650589fb515e4891bddf2003e11d9fae73fef0948c53e4
copy | will export registry.tanzu.vmware.com/build-service/kpack-completion@sha256:36db9ef78ad605279b124d029ace81ee76692f8463a2c7e2f125b37a8de2878c
copy | will export registry.tanzu.vmware.com/build-service/kpack-controller@sha256:c955647b92f4a9cdfae8f690e694a71a3b48121cbc4f6d3db38fe0e126c2a280
copy | will export registry.tanzu.vmware.com/build-service/kpack-lifecycle@sha256:312ad396210295e41d37ba040ba27d379c2f34d1cafdc26dd83c27d25b2ee5af
copy | will export registry.tanzu.vmware.com/build-service/kpack-rebase@sha256:db6d761b3f505bc0e4206d41bd3163b9afd8c24f05750b0de1d89653ce51ff27
copy | will export registry.tanzu.vmware.com/build-service/kpack-webhook@sha256:957e80206c60ff761917c249b22e146fd04026983721d106b56ff952612ded0b
copy | will export registry.tanzu.vmware.com/build-service/secret-syncer@sha256:ce30da6380d2f6644ea3fc0dec7478021bd28a3727d4ade8802461fce76e9edb
copy | will export registry.tanzu.vmware.com/build-service/setup-ca-certs@sha256:ff42d1864f3a4037a4007f4e9a5c160e04a4513cfeff36a171885149cbfc1bee
copy | will export registry.tanzu.vmware.com/build-service/sleeper@sha256:62287602399117f7419e107c7bfa6190c02eb05ebe4d8b72247d1a4b7998494d
copy | will export registry.tanzu.vmware.com/build-service/smart-warmer@sha256:ff40eedfab38dac9f632a3f119bf51065ea82187ab7e5662cb0c1d0a6762af8c
copy | will export registry.tanzu.vmware.com/build-service/stackify@sha256:f1f4c8af69422a3cc752dc821087cd36dbe6e8d282d85b5b42d2f704c39f3de3
copy | will export registry.tanzu.vmware.com/build-service/stacks-operator@sha256:666d55e2d850d20617bf1db28b232c9c4fd683dd1e8e4eab5ba978ca76f94091
copy | exported 17 images
copy | importing 17 images...

 260.92 MiB / 452.10 MiB [===============================================================================>----------------------------------------------------------]  57.71% 969.31 KiB/s 03m17scopy | Error: Error uploading images: Post "https://index.docker.io/v2/eknath009/build-service/blobs/uploads/": EOF
 451.96 MiB / 452.10 MiB [=============================================================================================================================================]  99.97% 1.00 MiB/s 7m30s

copy | done uploading images
copy | Warning: Skipped layer due to it being non-distributable. If you would like to include non-distributable layers, use the --include-non-distributable-layers flag
Succeeded

 

cat ~/.docker/config.json

docker login registry.pivotal.io

If copy is failing, try with diff imgpkg version or see if you are able to download the images manually:

 

imgpkg pull -b “registry.pivotal.io/build-service/bundle:1.3.1” -o tbs-pkg

docker pull registry.pivotal.io/build-service/bundle:1.3.1

imgpkg pull -b “eknath009/build-service:1.3.1” -o /tmp/bundle

reddye@reddye-a02 ~ % imgpkg pull -b "eknath009/build-service:1.3.1" -o /tmp/bundle
Pulling bundle 'index.docker.io/eknath009/build-service@sha256:c1b63312ca2333298ede54f6121f17c53bb7d1b68256dbd6dccbc1ba88abded1'
  Extracting layer 'sha256:00b964ee7d473681c28949ff3cd7f9c06db1d3c0314c3783ef54dfbe9fb61cc2' (1/1)

Locating image lock file images...
The bundle repo (index.docker.io/eknath009/build-service) is hosting every image specified in the bundle's Images Lock file (.imgpkg/images.yml)

Succeeded
ytt -f /tmp/bundle/values.yaml \
    -f /tmp/bundle/config/ \
    -v docker_repository='build-service' \
    -v docker_username='eknath009' \
    -v docker_password='<password>' \
    -v tanzunet_username='eknath.reddy09@gmail.com' \
    -v tanzunet_password='<password>' \
    -v kp_default_repository='eknath009/build-service' \
    -v kp_default_repository_username='eknath009' \
    -v kp_default_repository_password='<password>' \
    | kbld -f /tmp/bundle/.imgpkg/images.yml -f- \
    | kapp deploy -a tanzu-build-service -f- -y

 

Accept EULA:

https://network.pivotal.io/products/tbs-dependencies/

https://network.pivotal.io/products/tanzu-java-buildpack/

https://network.pivotal.io/products/tanzu-java-native-image-buildpack

https://network.pivotal.io/products/tanzu-nodejs-buildpack/

https://network.pivotal.io/products/tanzu-go-buildpack/

 

if the installing is failing, you can retry the deployment using:

kubectl -n build delete 

kapp delete -a tanzu-build-service

 

kapp delete -a tanzu-build-service

 

3:21:34PM: ongoing: reconcile tanzunetdependencyupdater/dependency-updater (buildservice.tanzu.vmware.com/v1alpha1) namespace: build-service
3:21:34PM: ^ Waiting for generation 1 to be observed

Remove tanzunet_username and tanzunet_password from ytt command.

Leave a Reply