Deploying my first application via Tanzu Community Edition
This page walks you through the following steps:
- Install Tanzu Community Edition.
- Install Knative CLI
- Create an Unmanaged cluster.
- Install kpack package.
- Install kpack-dependencies package.
- Build an OCI compliant image and Publish the image to your registry.
- Install and Deploy with Knative serving.
Step 1 - Install Tanzu Community Edition
brew install vmware-tanzu/tanzu/tanzu-community-edition
Step 1a. Once the installation is completed, initialize all plugins required by Tanzu Community Edition
/opt/homebrew/Cellar/tanzu-community-edition/v0.12.1/libexec/configure-tce.sh
tanzu unmanaged-cluster create <CLUSTER_NAME> -p 80:80 -p 443:443
kubectl create secret docker-registry tutorial-registry-credentials \
--docker-username=my-dockerhub-username \
--docker-password=my-dockerhub-password \
--docker-server=https://index.docker.io/v1/ \
-n default
Step 4 - Install Kpack package
tanzu package install kpack \
--package-name kpack.community.tanzu.vmware.com \
-f config/kpack/kpack-values.yaml \
--version 0.5.3
Step 5 - Install Kpack Dependencies package
tanzu package install kpack-dependencies \
--package-name kpack-dependencies.community.tanzu.vmware.com \
-f config/kpack_dependencies/kpack-dependencies-values.yaml \
--version 0.0.27
Step 6 - Install Contour package
tanzu package install contour \
--package-name contour.community.tanzu.vmware.com \
-f config/contour/contour-values.yaml \
--version 1.20.1
Step 7 - Install Knative Serving package
tanzu package install knative-serving \
--package-name knative-serving.community.tanzu.vmware.com \
-f config/knative_serving/knative-serving-values.yaml \
--version 1.0.0
Step 8 - Verify kpack, kpack-dependencies and knative-serving packages are installed, and status is "Reconcile succeeded"
tanzu package installed list -A
kubectl get clusterstore -n default
kubectl get clusterstack -n default
kubectl get clusterbuilder -n default
This service account is used to reference the registry secret created in prerequisite step 1 using the manifest service-account.yaml file.
kubectl apply -f service-account.yaml
The image.yaml manifest file defines your image source, builder and tag needed to build and publish your OCI image. To learn how cloud native build packs work visit BuildPacks Docs
Make sure you replace <DOCKER_USERNAME> with your username
kubectl apply -f image.yaml
kubectl logs hello-world-build-1-build-pod -c detect
kubectl logs hello-world-build-1-build-pod -c prepare
kubectl logs hello-world-build-1-build-pod -c build
kubectl logs hello-world-build-1-build-pod -c export
kubectl get images hello-world
To learn more on Knative visit Knative Docs
kn service create hello-world \
--image index.docker.io/ynamadi676/tutorial1@sha256:3889ad138b7739159a015e9e71d810fccf6e707186a3412a5917ea82f36313ad \
--pull-secret tutorial-registry-credentials
open -a Safari.app "http://hello-world.default.127-0-0-1.nip.io/"