Inter-Service communication between Kubernetes for mysql and tomcat

12/14/2017

I have two services running on kubernetes using kubectl. 1. Tomcat 2. MYSQL

Scenario - Tomcat is external world facing. Hosted tomcat using node port. And MySQL service is backend and hence hosted it using cluster IP (default type).

Tomcat is not able to connect to MySQL. War file which I am using, need JDBC URL for connection.

I am able to connect to MySQL from my instance(master node). but tomcat service is not able to do.

enter image description here

-- Arora20
docker
image
kubectl
kubernetes
mysql

1 Answer

12/14/2017

We can do this by providing the service name directly. Here, For MySQL service I can provide MySQL-middleware-service2(NAme of my MySQL service)

-- Arora20
Source: StackOverflow