Can anyone explain this for me please:
I have a minikube setup running locally and with a VM also running locally. I am running a MySQL server on my VM and exposing it inside the cluster on 192.168.64.13:8501
if I use a pod with mysql installed and run a mysql cli command towards the ip on port 8501 I can receive data from the VM. but when I try to use it as part of exposed service, setting host to local-mysql and try to connect it does not work.
But if I expose the server inside the cluster on port 3306 instead it works. Feels like the port I specify in endpoints doesn’t work?
Here is my setup service / service entry:
apiVersion: v1
kind: Service
metadata:
name: local-mysqldb
spec:
ports:
- name: mysql
port: 8501
protocol: TCP
---
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: local-mysqldb
spec:
hosts:
- local-mysqldb
ports:
- number: 8501
name: mysql
protocol: TCP
resolution: STATIC
endpoints:
- address: 192.168.64.13 # <-- service exposed on this IP
ports:
mysql: 8501 # <-- this seems to have no effect?
So service exposed on 8501
mysql —host 192.168.64.13 --port 8501 <-- works
mysql —host local-mysqldb --port 8501 <-- does not work
Then if I change to expose the service on 3306 instead
mysql --host local-mysqldb --port 8501 <-- works
I can even remove the ports section of the endpoints part and it will work with the service exposed on 3306