Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo: Service Discovery database connection failed #28

Open
arslanqadeer opened this issue May 14, 2023 · 0 comments
Open

Demo: Service Discovery database connection failed #28

arslanqadeer opened this issue May 14, 2023 · 0 comments

Comments

@arslanqadeer
Copy link

Hi, I'm following your Udemy DevOps course to learn Kubernetes. I came across the following database connection error while following the service discovery Demo.

ubuntu@DESKTOP$kubectl get pods
NAME                                     READY   STATUS    RESTARTS      AGE
database                                 1/1     Running   0             13m
helloworld-deployment-5848ddb496-62pgw   1/1     Running   0             13m
helloworld-deployment-5848ddb496-kghhz   1/1     Running   0             13m
helloworld-deployment-5848ddb496-qdfwz   1/1     Running   1 (12m ago)   13m


ubuntu@DESKTOP$kubectl logs helloworld-deployment-5848ddb496-62pgw
Example app listening at http://:::3000
Error connecting to db:  { [Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client]
  code: 'ER_NOT_SUPPORTED_AUTH_MODE',
  errno: 1251,
  sqlState: '08004',
  fatal: true }

From the quick google search it looks like there is some DB error. But I tried checking the DNS using busybox image and DNS is also not working:

ubuntu@DESKTOP$kubectl get svc
NAME                    TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
database-service        NodePort    10.104.49.168   <none>        3306:31520/TCP   24m
helloworld-db-service   NodePort    10.103.241.63   <none>        3000:30619/TCP   24m
kubernetes              ClusterIP   10.96.0.1       <none>        443/TCP          42h


/ # nslookup helloworld-db-service
Server:         10.96.0.10
Address:        10.96.0.10:53

Name:   helloworld-db-service.default.svc.cluster.local
Address: 10.103.241.63

** server can't find helloworld-db-service.svc.cluster.local: NXDOMAIN

** server can't find helloworld-db-service.cluster.local: NXDOMAIN

** server can't find helloworld-db-service.cluster.local: NXDOMAIN


** server can't find helloworld-db-service.svc.cluster.local: NXDOMAIN

/ #
/ #
/ # nslookup database-service
Server:         10.96.0.10
Address:        10.96.0.10:53

Name:   database-service.default.svc.cluster.local
Address: 10.104.49.168

** server can't find database-service.cluster.local: NXDOMAIN


** server can't find database-service.cluster.local: NXDOMAIN

** server can't find database-service.svc.cluster.local: NXDOMAIN

** server can't find database-service.svc.cluster.local: NXDOMAIN

/ #
/ # cat /etc/resolv.conf
nameserver 10.96.0.10
search default.svc.cluster.local svc.cluster.local cluster.local
options ndots:5

I enabled the "ingress-dns" addon and recreated the deployment, pod and services, however, still not working.
Could you please look into this and let me know what is going on? Thanks

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

No branches or pull requests

1 participant