How to access mysql outside my kubernetes cluster? How to access mysql outside my kubernetes cluster? docker docker

How to access mysql outside my kubernetes cluster?


You don't need a service for things outside the cluster. Depending on the networking model you're using, the docker container (ie kubernetes pod) should be able to connect to the MySQL container normally via the bridge that Docker sets up. Check the host has connectivity on port 3306, and it does, simply put in the DNS name (your kube-dns pod should forward any non kubernetes based requests on to the hosts resolv.conf of the host it was scheduled on)


pls try this:

kubectl delete svc databasekubectl create service nodeport database --tcp=13080:13080

then use cmd below to get right ip and port

kubectl get svc database