Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

pods scheduled on different node can not communicate with each other #21

Open
k19810703 opened this issue Oct 12, 2017 · 1 comment
Open
Labels

Comments

@k19810703
Copy link

k19810703 commented Oct 12, 2017

I created my cluster(k8s 1.8) by kubeadm on 2 physical server( os:ubuntu 16.04)

$ kubectl get nodes
NAME      STATUS    AGE       VERSION
digital   Ready     21m       v1.8.0
next      Ready     22m       v1.8.0
$ kubectl get pods
NAME                               READY     STATUS    RESTARTS   AGE
wordpress-76b66d5644-76rtc         1/1       Running   4          7m
wordpress-mysql-5cdbc78858-vxnmn   1/1       Running   0          7m

By following this guide , I tried to deploy it on my cluster. WordPress pod was deployed on master node , and mysql pod was deployed on another worker node.

But wordpress pod can not connect mysql.

$ kubectl logs -f wordpress-76b66d5644-76rtc 

MySQL Connection Error: (2002) No route to host

Warning: mysqli::mysqli(): (HY000/2002): No route to host in - on line 22

Warning: mysqli::mysqli(): (HY000/2002): No route to host in - on line 22
@Karthick-kumaravel
Copy link

I had the same error, Then I made changes in the MySQL service file and it worked for me. Below is my MySQL_service.yaml file

=================
apiVersion: v1
kind: Service
metadata:
name: wordpress-mysql
labels:
app: wordpress
spec:
ports:
- port: 3306
selector:
app: wordpress
tier: mysql

=================

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants