0

I can't connect with local mysql server that placed on host machine.

microk8s 2.0.1 multipass 1.6.1 windows 10 windows defender disabled :)

All commands are work fine: apply, get pods, get nodes, get events, secrets, services... inspect not found warnings. Addons enabled: dns, host-access, storage - all running.

For my cluster the default ip given by the host-access is "10.0.0.1".

I see that adapter is exists with :

multipass shell microk8s-vm 
ifconfig

...
lo:microk8s: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 10.0.1.1  netmask 255.0.0.0
        loop  txqueuelen 1000  (Local Loopback)
...

I put ip addr 10.0.1.1 to secrets And my spring boot application can't connect (refused) with mysql uses this ip.

Mysql is running locally, i can connect with mysql-client, all dbs are exists, all grants are full priveleged...

Other example:

microk8s kubectl apply -f https://k8s.io/examples/application/shell-demo.yaml
microk8s kubectl exec --stdin --tty shell-demo -- /bin/bash
curl 10.0.1.1:3306 (or 10.0.1.1:8080 )

curl says: "connection refused"

Please, help! And tnx!!

Programmer
  • 77
  • 1
  • 6
  • 2
    What about your **MySQL** configuration ? Is it listening also on `10.0.1.1` ? In other words is it bound to this address ? You can set its `bind-address` to `0.0.0.0` ( all network interfaces ). Maybe it is currently set to `127.0.0.1` ? – mario Jul 08 '21 at 19:41
  • Hello. Mysql allows all connections. Yes, bind-address = 0.0.0.0 (all) – Programmer Jul 09 '21 at 11:53

1 Answers1

0

After few days i dont know how to resolve this problem. Windows & kubernetes (maybe other product) is not a good couple... My microk8s stop working after rebooting system... "microk8s start" - working, but "microk8s kubectl get nodes " - are not. I just moved to linux and all works fine! Sad

Programmer
  • 77
  • 1
  • 6