We're in the process of migrating our web app to a distributed application model using gcloud/docker/K8. We've got a remote database server that is configured to only accept connections from another remote server i.e. to get to this database you have to first ssh to one server using username and password then connect to the db via MySQL Host name with the usual user and password. Been hitting the google hard to try to find out how we might configure our K8 pods to make this connection and it seems as if there are many different approaches that might work but no documented "sure fire" way yet. Our microservices are written with Lumen and are able to successfully connect to our dev db which is also remote but is not ssh. What might be our best approach? Try to configure the Dockerfile to have the pods ssh out? Or should we try to connect a K8 service to the db and have the pods connect to that?
You have three options: