This topic tells you how to use the web
workload type in Tanzu Application Platform (commonly known as TAP).
The web
workload type allows you to deploy web applications on Tanzu Application Platform. Using an application workload specification, you can turn source code into a scalable, stateless application that runs in a container with an automatically-assigned URL. This type of application is often called serverless, and is deployed using Knative.
The web
workload type is suitable for modern stateless web applications that follow the twelve-factor app methodology and have the following characteristics:
Applications using the web
workload type have the following features:
When creating a workload with the tanzu apps workload create
command, you can use the --type=web
argument to select the web
workload type. For more information, see Use the web Workload Type later in this topic.
You can also use the apps.tanzu.vmware.com/workload-type:web
label in the YAML workload description to support this deployment type.
web
workload typeThe tanzu-java-web-app
workload mentioned in Deploy an app on Tanzu Application Platform is a good match for the web
workload type. It is a good match because it serves HTTP requests and does not perform any background processing.
You can experiment with the differences between the web
and server
workload types by changing the workload type. To change the workload type run:
tanzu apps workload apply tanzu-java-web-app --type=server
After changing the workload type to server
, the application does not auto-scale or expose an external URL. For more information about the server workload type, see Use Server workloads.
Switch back to the web
workload by running:
tanzu apps workload apply tanzu-java-web-app --type=web
Use this to test which applications can function well as serverless web applications, and which are more suited to the server
application style.