Connecting to MySQL db in microk8s cluster using workbench

35 Views Asked by At

Can you help me with accessing MySQL db that I deployed in microk8s cluster using MySQL workbench.

I tried to create ingress and access it using the hostname and I couldn't access the db in that way.

How can I do this. Please help me

1

There are 1 best solutions below

0
larsks On

In general, Ingress services are used to expose HTTP/HTTPS traffic and won't be useful for exposing your MySQL database. The simplest solution is probably to expose MySQL as a NodePort service, which would open a port on all the worker nodes.

When using a NodePort service, you can select a specific port (from the NodePort range, typically 30000-32767) to use for the service (otherwise you'll get a random port which probably isn't all that useful).