Skip to content

Latest commit

 

History

History
150 lines (98 loc) · 3.18 KB

File metadata and controls

150 lines (98 loc) · 3.18 KB

Deploying Travel Advisor to Tanzu Platform for Cloud Foundry

This document provides detailed instructions for deploying the Travel Advisor application to Tanzu Platform for Cloud Foundry.

Prerequisites

  • .NET 9 SDK installed on your local machine
  • CF CLI installed on your local machine
  • Access to a Tanzu Platform for Cloud Foundry environment
  • Proper permissions to create and bind services
  • Access to the GenAI tile in your Tanzu Platform environment
  • Google Maps API key

Building for Deployment

  1. Build the application in Release mode:
dotnet publish -c Release -r linux-x64 --self-contained false

Creating Required Services in Tanzu Platform

  1. Log in to your Tanzu Platform for Cloud Foundry environment:
cf login -a <API_ENDPOINT> -u <USERNAME> -p <PASSWORD> -o <ORG> -s <SPACE>
  1. Create a service instance for the LLM from the GenAI tile:
# List GenAI tile service offering plans
cf marketplace -e genai

# Create a service instance from one of the available plans
cf create-service genai PLAN_NAME travel-advisor-llm

Important

Replace PLAN_NAME above with an available plan from the GenAI tile service offering

Deployment Steps

  1. Push the application to Cloud Foundry:
cf push --no-start
  1. Bind the application to the service instance:
cf bind-service travel-advisor travel-advisor-llm
  1. You'll need to set an environment variable for the Google Maps API key:
cf set-env travel-advisor GOOGLEMAPS_APIKEY your_google_maps_api_key

Important

Replace your_google_maps_api_key above with a valid Google Maps API key with appropriate permissions.

  1. Start the application:
cf start travel-advisor

Verifying Deployment

  1. After deployment, verify the application is running:
cf apps
  1. Find the route where the application is deployed:
cf app travel-advisor
  1. Open the application URL in a browser to test it.

Troubleshooting

Service Binding Issues

If there are issues with service bindings, check the logs:

cf logs travel-advisor --recent

Viewing Application Health

To view the health of the application using Steeltoe actuators:

curl https://<APP_URL>/health

Restarting the Application

If you need to restart the application:

cf restart travel-advisor

Updating the Application

  1. Make your changes to the application
  2. Rebuild in Release mode
  3. Push the updated application:
cf push

Scaling the Application

To scale the application vertically (change memory):

cf scale travel-advisor -m 1G

To scale the application horizontally (change instance count):

cf scale travel-advisor -i 3

Rollback

If a deployment goes wrong, you can rollback to the previous state:

cf rollback travel-advisor

Additional Resources