Search code examples
cloud-foundryswisscomdev

Access CF service without running app


Our CF hosted application (java) has crashed because of a database issue. The database service (mariaDB) is still running but I cannot connect to it using my service key and ssh because the app is down. Is there any way to access a service on cloud foundry directly without having a running app?

I cannot get the app running again, because I cannot access the DB, and I cannot access the DB because the app is down. You see the problem. We are using Swisscom's CF.


Solution

  • My findings coincide with @SandroMathys. We created an "empty" proxy-app borrowing from this guide: https://github.com/swisscom/docs-appcloud-service-offerings/blob/master/migrate-mariadb-to-mariadbent.html.md.erb

    The gist of it is:

    $ git clone https://github.com/swisscom/cf-default-app-staticfile.git
    $ cd cf-default-app-staticfile
    $ cf push proxy-app --no-route
    

    Afterwards:

    • bind "proxy-app" to your service (e.g. database)
    • create a service key
    • use cf ssh as usual to open up a tunnel and access the service