2

I have been exploring Pivotal Cloud Foundry - Public Cloud Version by setting up an Pivotal Web Services account. While exploring the CF CLI I followed the below tutorial. https://pivotal.io/platform/pcf-tutorials/getting-started-with-pivotal-cloud-foundry/introduction

I was able to successfully push the sample spring boot app to PCF Cloud and follow the tutorial.

When I started to play around with it, I tried deleting the app using the below command. cf-spring is my app name.

cf delete cf-spring CF Delete Command

When navigated to my Pivotal Web Service account, I could see the app has been deleted. The route still displays the name of the route which was created when an app was created using the cf push command.

Pivotal DashBoard

So I tried to delete the route using the below command. Delete Route

It does not allow me to delete using CLI ? Does the app delete command should have taken care to remove the related routes associated with the application ?

Baskar Rao
  • 470
  • 4
  • 11

2 Answers2

5

Try cf delete-route -h to see the syntax of the delete-route command.

You probably want to run cf delete-route cfapps.io --hostname cf-spring-rested-platypus.

In recent versions of cf-cli you can also run cf delete-orphaned-routes.

I think the reason CF doesn't completely delete the route when you delete an app is so that it kind of keeps the hostname reserved for your use, ie: someone else can't reuse it in another org or space if you've just taken down your app for a refresh. It's kind of annoying when you actually want to reuse the hostname in another space, but considering the multi-tenancy capabilities it kind of makes sense to keep them intact/reserved.

gokeefe
  • 86
  • 4
0

cf delete APP_NAME will not delete the route bound to the Apps and this should not happen first-of-all. Because the router-concept in Cloud foundry is that

One App can have Multiple Routes and Multiple Routes can be configured to one App.

Its Many-to-One mapping. So there is a possibility that the routes you created would still be mapped to another App and it would be as Orphaned-route, only when there are no apps for that routes..

So its a cautious decision and a wise decision too !!

Arun
  • 3,440
  • 11
  • 60
  • 108