How to access MySql hosted with Nginx Ingress+Kubernetes from client

Kubernetes Ingress as a generic concept does not solve the issue of exposing/routing TCP/UDP services, as stated in https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/exposing-tcp-udp-services.md you should use custom configmaps if you want that with ingress. And please mind that it will never use hostname for routing as that is a feature of HTTP, not TCP.


I succeded to access MariaDB/MySQL hosted on Google Kubernetes Engine through ingress-nginx, using the hostname specified in the ingress created for the database Cluster IP.

As per the docs, simply create the config map and expose the port in the Service defined for the Ingress.

This helped me to figure how to set --tcp-services-configmap and --udp-services-configmap flags.