0

I have a database running in local machine which i can access it using 127.0.0.1 or localhost, I need to access this database from my spring boot application which is deployed in local minikube kubernetes cluster.

how can i do that.

RAJESHPODDER007
  • 733
  • 1
  • 8
  • 14
  • Why not deploy this database to local minikube? If you concern about data loss you can either migrate it through migration script/file or configure your db deployment storage to local file on your machine where localhost db data files are stored – Nick Feb 07 '22 at 13:28
  • I know this option , i am doing some POC stuf, the database right now it is a local , but it could be a static dns name for production and it should be outside of kubernetes cluster for now. – RAJESHPODDER007 Feb 07 '22 at 13:37
  • Might help [minikube docs](https://minikube.sigs.k8s.io/docs/handbook/host-access/) – Nick Feb 07 '22 at 13:41
  • solutions from [Minikube. How to allow access to local mySQL database from container](https://serverfault.com/questions/1007878/minikube-how-to-allow-access-to-local-mysql-database-from-container) and [Connect to local database from inside minikube cluster](https://stackoverflow.com/questions/50952240/connect-to-local-database-from-inside-minikube-cluster) dont help? – Vit Feb 07 '22 at 22:06

1 Answers1

0

Use the external IP of your machine (f.e. wifi or ethernet) and connect to that. Be aware that you need to expose your database externally in that case.

Thomas
  • 11,272
  • 2
  • 24
  • 40