So I’ve been trying to figure out how I can simply have my MiniKube cluster use my localhost port 3306 to access my database pod with MySql Workbench. It seems unnecessarily difficult and I don’t know why I can’t find anything on how to do this.
kubectl port-forward service/mysql-svc 3306:3306– to hook up to the db’s ClusterIP works but I have to run this in my terminal explicitly, I want to just be able to define this in my yml file
- ClusterIP – inter cluster access only, at least I can hook up to it with port-forward I guess
- NodePort yml config – won’t let you set a NodePort under 30000
- LoadBalancer yml config – same issue again, can’t set a NodePort under 30000
- Ingress – a smarter LoadBalancer with some pathing options
I’m probably missing an obvious solution here or this is deliberately disallowed for a good reason, but I’ve had no luck searching the web. And it seems very inconvenient to have to port-forward manually every time. What’s the normal method of developing Kubernetes/distributed applications locally?
I’d also like to do the same thing with my “interface” pod(s) on port 80 and 443 but I presume I’ll run into the same problem there.