Kubernetes pods installed on linux server can't access any API's or ips from local corporate network but can communicate with each other and internet

We have installed kubernetes server which I installed by this guide → How to Install Kubernetes on Ubuntu | Cherry Servers . Everything worked quite fine for like a year, but that was until moment when it became required to connect from pod to MySQL server within the corporate local network(not inside any cluster of kubernetes).

This API on a any other computer within this local network can easily send requests to this database, but when this API is deployed to kubernetes as Pod it just can’t access it. The same happens when we try connecting from kubernetes pods to other API’s or services deployed in docker on other PCs in the same corporate local network. The thing is that if we ping our PCs or that MySQL from server machine where kubernetes is installed, it pings it without any problem. But when we try to ping our PCs or that MySQL from pods within kubernetes - it just can’t reach it.

So far we thought that pods were looking for IP of MySQL server within the cluster and if they can’t find it they just time out, but at this point I don’t even know what to try. So far we tried creating some sort of Service of ClusterIp type and Endpoint for it in kubernetes. We found some “solutions” and they were pointing to creating such yaml config in k8s:

apiVersion: v1
kind: Endpoints
metadata:
  name: MySql-server
subsets:
  - addresses:
      - ip: "MySQlServerIp"
    ports:
      - port: "MySQLServer port"

---

apiVersion: v1
kind: Service
metadata:
  name: MySql-server
spec:
  clusterIp: None
  ports:
    - name: MySql-server
      protocol: TCP
      port: "MySQLServer port"
      targetPort: "MySQLServer port"
      nodePort: 0

After that I tried to connect to this service with endpoint which should have redirected me to MySQL server using “MySql-server” name in depolyment where connection string is defined, but it didn’t work. Even tried to allow cluster ip to define some local ip for this service and use it in connection string - still no use.

We even tried to define some network policy within kubernetes, so it could allow any traffic, which looks like this:

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: internet-access
spec:
  podSelector: {}
  ingress:
    - {}
  egress:
    - {}
  policyTypes:
    - Egress
    - Ingress

Still no progress.

At the end i suggest that maybe there are some problems in the installation of kubernetes or some sort of networking problems on the server itself, but as I said before - server itself can ping anything from local network. Anything within Kubernetes on the server, however, can’t ping it.

We will appreciate any help.