3

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.

Diego A.
  • 85
  • 5

2 Answers2

2

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
Diego A.
  • 85
  • 5
1

Unfortunately, there's no other way. However, you can bind several apps to the same service instance, so you could temporarily push a small dummy app.

Sandro Mathys
  • 474
  • 3
  • 7
  • 1
    I'm not sure you really need to `cf ssh` to the specific failing app, or even an app bound to the service. You might try `cf ssh` to any app you have deployed that's up. That would allow you to set up a tunnel into an app container on the network which should have access to the MySQL service. Through that you should be able to access your MySQL service using your service key credentials. – Daniel Mikusa Jul 12 '18 at 22:16
  • @DanielMikusa That won't work as the security groups will block the access unless the app is bound to the service instance (and restaged afterwards, for the security group change to become effective). – Sandro Mathys Jul 13 '18 at 22:28
  • @SandroMathys wrong! MariaDB uses a global security group. The solution described by Daniel works perfectly fine – Sybil Jul 16 '18 at 05:59