This topic guides you through getting started with VMware Tanzu Developer Tools for Visual Studio Code (VS Code).
Install VMware Tanzu Developer Tools for Visual Studio Code.
The extension makes use of the following files within your project:
workload.yamlcatalog-info.yamlTiltfile.tanzuignoreYou can create these files by using the instructions in this topic, or use the files in the View an example project section.
There are two ways to create these files:
workload.yaml fileworkload.yaml provides instructions to the Supply Chain Choreographer about how to build and manage a workload.
The extension requires only one workload.yaml file per project. workload.yaml must be a single-document YAML file, not a multidocument YAML file.
Before beginning to write your workload.yaml file, ensure that you know:
my app.web.github.com/mycompany/myapp.main.workload.yaml file by using code snippets:
config in the root directory of your project. For example, my project/config.workload.yaml in the new config directory. For example, my project/config/workload.yaml.Open the new workload.yaml file in VS Code, enter tanzu workload in the file to trigger the code snippets, and either press Enter or left-click the tanzu workload text in the drop-down menu.

Fill in the template by pressing the Tab key.
workload.yaml file manually, follow this example:
apiVersion: carto.run/v1alpa1
kind: Workload
metadata:
name: APP-NAME
labels:
apps.tanzu.vmware.com/workload-type: WORKLOAD-TYPE
app.kubernetes.io/part-of: APP-NAME
spec:
source:
git:
url: GIT-SOURCE-URL
ref:
branch: GIT-BRANCH-NAME
Where:
APP-NAME is the name of your application.WORKLOAD-TYPE is the type of this workload. For example, web.GIT-SOURCE-URL is your GitHub source code URL.GIT-BRANCH-NAME is the Git branch of your source code.Alternatively, you can use the Tanzu CLI to create a workload.yaml file. For more information about the Tanzu CLI command, see Tanzu apps workload apply in the Tanzu CLI documentation.
catalog-info.yaml filecatalog-info.yaml enables the workloads of this project to appear in Tanzu Application Platform GUI.
Before beginning to write your catalog-info.yaml file, ensure that you:
my app.catalog-info.yaml file by using the code snippets:
catalog in the root directory of your project. For example, my project/catalog.catalog-info.yaml in the new config directory. For example, my project/catalog/catalog-info.yaml.Open the new catalog-info.yaml file in VS Code, enter tanzu catalog-info in the file to trigger the code snippets, and then either press Enter or left-click the tanzu catalog-info text in the drop-down menu.

Fill in the template by pressing the Tab key.
catalog-info.yaml file manually, follow this example:
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: APP-NAME
description: APP-DESCRIPTION
tags:
- tanzu
annotations:
'backstage.io/kubernetes-label-selector': 'app.kubernetes.io/part-of=APP-NAME'
spec:
type: service
lifecycle: experimental
owner: default-team
Where:
APP-NAME is the name of your applicationAPP-DESCRIPTION is the description of your applicationThe Tiltfile file provides the Tilt configuration to enable your project to Live Update on your Kubernetes cluster that has Tanzu Application Platform. The Tanzu Developer Tools extension requires only one Tiltfile per project.
Before beginning to write your Tiltfile file, ensure that you know:
my app.docker.io/mycompany/myapp.local path value unchanged. For more information, see local path in the glossary.workload.yaml file. For example, config/workload.yaml.Tiltfile with no file extension in the root directory of your project. For example, my project/Tiltfile.Open the new Tiltfile file in VS Code and enter tanzu tiltfile in the file to trigger the code snippets, and then either press Enter or left-click the tanzu tiltfile text in the drop-down menu.

Fill in the template by pressing the Tab key.
If the targeting Kubernetes cluster enabled by Tanzu Application Platform is not running on your local machine, add a new line to the end of the Tiltfile template and enter:
allow_k8s_contexts('CONTEXT-NAME')
Where CONTEXT-NAME is the name of your current Kubernetes context.
SOURCE_IMAGE = os.getenv("SOURCE_IMAGE", default='SOURCE-IMAGE')
LOCAL_PATH = os.getenv("LOCAL_PATH", default='.')
NAMESPACE = os.getenv("NAMESPACE", default='default')
k8s_custom_deploy(
'APP-NAME',
apply_cmd="tanzu apps workload apply -f PATH-TO-WORKLOAD-YAML --live-update" +
" --local-path " + LOCAL_PATH +
" --SOURCE-IMAGE " + SOURCE_IMAGE +
" --namespace " + NAMESPACE +
" --yes >/dev/null" +
" && kubectl get workload APP-NAME --namespace " + NAMESPACE + " -o yaml",
delete_cmd="tanzu apps workload delete -f PATH-TO-WORKLOAD-YAML --namespace " + NAMESPACE + " --yes" ,
deps=['pom.xml', './target/classes'],
container_selector='workload',
live_update=[
sync('./target/classes', '/workspace/BOOT-INF/classes')
]
)
k8s_resource('APP-NAME', port_forwards=["8080:8080"],
extra_pod_selectors=[{'carto.run/workload-name': 'APP-NAME', 'app.kubernetes.io/component': 'run'}])
allow_k8s_contexts('CONTEXT-NAME')
Where:
SOURCE-IMAGE is the value of source image.APP-NAME is the name of your application.PATH-TO-WORKLOAD-YAML is the local file system path to workload.yaml. For example, config/workload.yaml.CONTEXT-NAME is the name of your current Kubernetes context. If your Kubernetes cluster enabled by Tanzu Application Platform is running locally on your local machine, you can remove the entire allow_k8s_contexts line. For more information, see the Tilt documentation..tanzuignore fileThe .tanzuignore file specifies the file paths to exclude from the source code image. When working with local source code, you can exclude files from the source code to be uploaded within the image. Directories must not end with the system path separator (/ or \). See this example. in GitHub.
Before you begin, you need a container registry for the sample application.
You can view a sample application that demonstrates the necessary configuration files. There are two ways to obtain the sample application:
Tanzu Java Web App in Application Accelerator.git clone to clone the tanzu-java-web-app repository from GitHub.tanzu-java-web-app directory.your-registry.io/project with your container registry.