This topic tells you how to deploy a ready-made Where for Dinner?
example application into a Space on Tanzu Platform for Kubernetes.
In the Create an application environment using Spaces topic, you instantiated a Space from a Profile and selected where the Space should be enabled. The Space is now ready deploy an application.
Before you can deploy an app in a Space, you must:
Follow the steps in Create an application environment using Spaces to create a Space in which to deploy your application.
Set up the Tanzu CLI:
Install the Tanzu CLI app-developer
plug-in group by running:
tanzu plugin install --group vmware-tanzu/app-developer
Log in to Tanzu CLI by running:
tanzu login
Clone the Git repository containing the Where for Dinner?
application:
Clone the the repository by running:
git clone https://github.com/vmware-tanzu/application-accelerator-samples
Go to the repository directory by running:
cd application-accelerator-samples
Check out the wfd-spaces-ga
branch by running:
git checkout wfd-spaces-ga
Go to the directory that contains the application resources by running:
cd where-for-dinner
To deploy the pre-built Where for Dinner
application to the Space:
Set your active project to the project you created in Create a Tanzu CLI context for Tanzu Platform and your project by running:
tanzu project use
Set your active Space to the Space to use for your deployment by running:
tanzu space use
Deploy all of the application’s resources by running:
tanzu deploy --from-build demo-prebuilt
NoteThe
--from-build
flag is used to reference prebuilt container images. If you do not pass the--from-build
flag then you build new container images for each microservice (ContainerApp) in thewhere-for-dinner
repository instead.
Access the Where for Dinner?
example application in a browser:
Where for Dinner?
application.The topology graph for the application uses the service mesh components to generate the topology. This requires traffic to be generated within the application for the full application topology to appear.
To view the Where for Dinner?
example application and information about the application and Space you can use Tanzu Platform hub or the Tanzu CLI.
where-for-dinner-availability
, to open a detailed page with information about the status, application build information, running application instances, environment variables, requested resources, and bound services.List all applications deployed to your Space by running:
tanzu app list
Example output:
NAME CONTENT INSTANCES(RUNNING/REQUESTED) BINDINGS(BOUND/REQUESTED) STATUS
where-for-dinner-search git:f4672da @ 2024-05-10T12:34:21Z 1/(not requested)* 2/2 Running
where-for-dinner-ui git:f4672da @ 2024-05-10T12:34:21Z 1/(not requested)* 0/0 Running
where-for-dinner-notify git:f4672da @ 2024-05-10T12:34:21Z 1/(not requested)* 1/1 Running
where-for-dinner-crawler git:f4672da @ 2024-05-10T12:34:21Z 1/(not requested)* 0/0 Running
where-for-dinner-search-proc git:f4672da @ 2024-05-10T12:34:21Z 1/(not requested)* 1/1 Running
where-for-dinner-availability git:f4672da @ 2024-05-10T12:34:21Z 1/(not requested)* 2/2 Running
Get details about a specific application deployed to your Space by running:
tanzu app get where-for-dinner-crawler
Example output:
Overview
Name: where-for-dinner-crawler
Description: <empty>
Status: Running
Ports: <empty>
App Details
Summary: git:f4672da @ 2024-05-10T12:34:21Z
Built At: 2024-05-10T12:34:21Z
Image: projects.registry.vmware.com/tanzu_application_platform/where-for-dinner/where-for-dinner-crawler@sha256:85cd45991d2319dac4f81df06f1baf4fad30b779cac6377e548e5a5c41db3752
Git: github.com/vmware-tanzu/application-accelerator-samples.git@8f364e93a29eeb9d17e5682119de617b9fde32f0
Version: 20240717.1459.59814
Contact
Resources
RESOURCE PER-APP-INSTANCE TOTAL(CONSUMED)
cpu 300m 600m
memory 1Gi 2Gi
Availability Targets
Name: all-regions.tanzu.vmware.com
App instances
Requested instances: not set (2 running)*
Configuration
Environment Variables: JAVA_TOOL_OPTIONS=-Dmanagement.endpoint.health.probes.add-additional-paths=true -Dmanagement.health.probes.enabled=true -Dserver.port=8080
List all services in your Space by running:
tanzu service list
Example output:
In space:
NAME CONNECTOR BINDING TYPE BOUND TO
MySQLInstance/where-for-dinner-mysql main mysql 2 apps
RabbitmqCluster/where-for-dinner-rabbitmq main rabbitmq 4 apps
Get details about a specific service in your Space by running:
tanzu service get MySQLInstance/where-for-dinner-mysql
Example output:
Name: MySQLInstance/where-for-dinner-mysql
Binding Connectors:
main:
Type: mysql
MySQLInstance type spec:
KEY VALUE
compositeDeletePolicy Background
storageGB 1
Bound Apps:
NAME CONNECTOR ALIAS
ContainerApp/where-for-dinner-search main db
ContainerApp/where-for-dinner-availability main db
You can now:
Learn more about the ContainerApp:
Learn more about the ContainerApp by reading What is a ContainerApp?.
Increase application resilience:
Deploying an application to a single Availability Target and replica doesn’t provide production-level resilience to failures. You can add redundancy to your application by increasing replicas or spanning across regions. For more information, see increasing application resilience.
Clean up the environment:
If you want to stop here, you can clean up the environment by following the steps in Cleaning up the application environment resources.