Link between docker container and Minikube

9/18/2018

Is is possible to link a docker container with a service running in minikube? I have a mysql container which I want to access using PMA pod in minikube. I have tried adding PMA_HOST is the yaml file while creating pod but getting an error on the PMA GUI page mentioning -

mysqli_real_connect(): (HY000/2002): Connection refused

-- Kshitij Kumar
docker
kubernetes
minikube

1 Answer

9/19/2018

If I understand you correctly, you want to access a service (mysql) running outside kube cluster (minikube) from that kube cluster.

You have two ways to achieve this:

  1. make sure your networking is configured in a way allowinf traffic passing both ways correctly. Then you should be able to access that mysql service directly by it's address or by creating external service inside kube cluster (create Service with no selector and manualy configure external Endpoints

  2. Use something like ie. telepresence.io to expose localy developed service inside remote kubernetes cluster

-- Radek 'Goblin' Pieczonka
Source: StackOverflow