This is the first in a series of Getting started how-to guides for developers. It walks you through deploying your first application on Tanzu Application Platform by using Tanzu Application Platform GUI.
NoteThis walkthrough uses Tanzu Application Platform GUI. Alternatively, you can deploy your first application on Tanzu Application Platform using the Application Accelerator Extension for VS Code.
Before you start, complete all Getting started prerequisites. For background on application accelerators, see Application Accelerator.
In this example, you use the Tanzu-Java-Web-App
accelerator. You also use Tanzu Application Platform GUI. For information about connecting to Tanzu Application Platform GUI, see Access Tanzu Application Platform GUI.
From Tanzu Application Platform GUI portal, click Create located on the left side of the navigation pane to see the list of available accelerators.
Locate the Tanzu Java Web App accelerator and click CHOOSE.
In the Generate Accelerators dialog box, replace the default value dev.local
in the prefix for container image registry text box with the registry in the form of SERVER-NAME/REPO-NAME
. The SERVER-NAME/REPO-NAME
must match what was specified for registry
as part of the installation values for ootb_supply_chain_basic
. See the Full Profile section on Installing Tanzu Application Platform package and profiles. Click NEXT.
If your instance has optional Git repository support enabled, continue with the following sub-steps. If your instance does not support this, skip to step 5, “Verify the provided information.”
Create Git repo?
Host
Git repository provider from the drop-down menu. In this example, select github.com
.Populate the Owner
and Repository
properties.
As you are populating the form, a dialog box appears asking for permission to provision Git repositories. Follow the prompts and continue.
Verify the provided information, and click GENERATE ACCELERATOR.
After the Task Activity processes complete, click DOWNLOAD ZIP FILE.
After downloading the ZIP file, expand it in a workspace directory. If you did not create a Git repository in the preceding steps, follow your preferred procedure for uploading the generated project files to a Git repository for your new project.
Set up environment variables by running:
export GIT_PROJECT_URL=GIT-URL-TO-PROJECT-REPO
export GIT_BRANCH=GIT-PROJECT-BRANCH
export DEVELOPER_NAMESPACE=YOUR-DEVELOPER-NAMESPACE
Where:
GIT-URL-TO-PROJECT-REPO
is the git URL of the repository you uploaded your source code to earlier. e.g. https://github.com/my-org/repository.git
GIT-PROJECT-BRANCH
is the git branch of the project. e.g. main
YOUR-DEVELOPER-NAMESPACE
is the namespace configured earlier.Deploy the Tanzu Java Web App accelerator by running the tanzu apps workload create
command:
tanzu apps workload create tanzu-java-web-app \
--git-repo ${GIT_PROJECT_URL} \
--git-branch ${GIT_BRANCH} \
--type web \
--label apps.tanzu.vmware.com/has-tests=true \
--label app.kubernetes.io/part-of=tanzu-java-web-app \
--yes \
--namespace ${DEVELOPER_NAMESPACE}
For more information, see Tanzu Apps Workload Apply.
NoteThis deployment uses an accelerator source from Git, but in later steps you use the VS Code extension to debug and live-update this application.
View the build and runtime logs for your app by running the tail
command:
tanzu apps workload tail tanzu-java-web-app --since 10m --timestamp --namespace YOUR-DEVELOPER-NAMESPACE
Where YOUR-DEVELOPER-NAMESPACE
is the namespace configured earlier.
After the workload is built and running, you can view the web app in your browser. View the URL of the web app by running the following command and then press ctrl-click on the Workload Knative Services URL at the bottom of the command output.
tanzu apps workload get tanzu-java-web-app --namespace YOUR-DEVELOPER-NAMESPACE
Where YOUR-DEVELOPER-NAMESPACE
is the namespace configured earlier.
Navigate to the home page of Tanzu Application Platform GUI and click Home, located on the left navigation pane. Click REGISTER ENTITY.
Alternatively, you can add a link to the catalog-info.yaml
to the tap-values.yaml
configuration file in the tap_gui.app_config.catalog.locations
section. See Installing the Tanzu Application Platform Package and Profiles.
Register an existing component prompts you to type a repository URL. Type the link to the catalog-info.yaml
file of the tanzu-java-web-app in the Git repository text box. For example, https://github.com/USERNAME/PROJECTNAME/blob/main/catalog-info.yaml
.
Click ANALYZE.
Review the catalog entities to be added and click IMPORT.
Navigate back to the home page. The catalog changes and entries are visible for further inspection.
NoteIf your Tanzu Application Platform GUI instance does not have a PostgreSQL database configured, the
catalog-info.yaml
location must be re-registered after the instance is restarted or upgraded.