# Connections to databases, Redis and MQ are converted via NAT to Node's IP?

**URL:** <https://discuss.kubernetes.io/t/connections-to-databases-redis-and-mq-are-converted-via-nat-to-nodes-ip/14730>\
**Category:** General Discussions\
**Created:** [February 7, 2021, 4:01am UTC](https://discuss.kubernetes.io/t/connections-to-databases-redis-and-mq-are-converted-via-nat-to-nodes-ip/14730 "2021-02-07T04:01:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![xuchuan-666](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/xuchuan-666/32/6889_2.png) [@xuchuan-666](https://discuss.kubernetes.io/u/xuchuan-666)\
**Post date:** [February 7, 2021, 4:01am UTC](https://discuss.kubernetes.io/t/connections-to-databases-redis-and-mq-are-converted-via-nat-to-nodes-ip/14730/1 "2021-02-07T04:01:58Z")

</div>

Asking for help? Comment out what you need so we can get more information to help you!

### Cluster information:

Kubernetes version: 1.18.9  
Installation method: kubeadm

## I want to use service in pod to connect Externel Mysql but not use in kubernetes i use calico i want to use service and endpoint to connect a externel mysql like this

apiVersion: v1  
kind: Service  
metadata:  
name: mysql-test  
spec:  
clusterIP: None  
ports:

- port: 3306

* * *

apiVersion: v1  
kind: Endpoints  
metadata:  
name: mysql-test  
subsets:

- addresses:
  - ip: 10.103.34.7  
ports:
  - port: 3306

In hope that i can use clusterIp + port to connect Externel mysql in pod  
Current Behavior  
in cluster node or pod i can telnet clusterIp port this Service ,

# telnet 10.103.34.7 3306

Trying 10.103.34.7…  
Connected to 10.103.34.7.  
Escape character is ‘^]’.  
when I connect to the database, the authentication fails. But If I add the allowed nodeip node link to the database, the authentication is successful  
Connections to databases, Redis and MQ are converted via NAT to Node’s IP?  
Since POD’s node nodes are randomly scheduled, I don’t know how to add permission control to the database
