MYSQL Pod connection

157 views
Skip to first unread message

Montassar Dridi

unread,
Nov 29, 2016, 9:13:56 PM11/29/16
to Kubernetes developer/contributor discussion
Usually I create one mysql pod and connect it to my java application pod buy getting the sql pod ip address and replace my db_uri as follow jdbc:mysql://MYSQL-POD-IP:3306/ THEN THE CONNECTION WILL BE RUNNING FINE WITH NO ISSUE. but then I tried to create MYSQL pod using Deployments and replica sets following the link bellow and then when I tried to replace the db_uri as follow jdbc:mysql://SERVICE-CLUSTER-IP:3306/ NO CONNECTION WAS ACCOMPLISHED.


How am I suppose to connect to the sql pod through the deployment service.

sebgoa

unread,
Nov 30, 2016, 3:38:56 AM11/30/16
to Montassar Dridi, Kubernetes developer/contributor discussion
Hi,

Usually, the kubernetes-users list is better for this:

https://groups.google.com/forum/#!forum/kubernetes-users

In the case below, make sure you expose your deployment with a service, then assuming you have a DNS add-on properly running, reach your mysql with its DNS name (not the cluster IP).

Happy to follow up on the users list or slack.

-sebastien
> --
> You received this message because you are subscribed to the Google Groups "Kubernetes developer/contributor discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-de...@googlegroups.com.
> To post to this group, send email to kuberne...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/kubernetes-dev/cb416284-9bd1-4537-b5cf-8f175b3ec589%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Montassar Dridi

unread,
Nov 30, 2016, 10:03:29 AM11/30/16
to Kubernetes developer/contributor discussion, montass...@gmail.com
thank you for listing the group I already joined it

I exposed my deployment with a service and used the following address and none of them worked
 jdbc:mysql://SERVICE-NAME:3306/
 jdbc:mysql://SERVICE-NAME-default.svc.cluster.local:3306/

what am i missing ?

Montassar Dridi

unread,
Nov 30, 2016, 11:11:14 AM11/30/16
to Kubernetes developer/contributor discussion, montass...@gmail.com
sorry for your trouble
I already solved it, it was a mysql privilege error preventing the connection and fix it 
thanks
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages