I have a K3S cluster installed on a baremetal and I have mysql db up and running. I am trying to launch a ghost application but I get the Error: connect ETIMEDOUT . I could log into the mysql and confirm that the db is up and running.
Currently there are no networkpolicies implemented I tried logging in from a temp pod and tried "telnet mysql-service 3306" . It returned no output. I could ping other nodes from the busybox and it works fine.
The service endpoint matches the msql pod IP. I dont know wheres else I should look for further troubleshooting. ANy guidance is welcome
kubectl logs ghost-7bdfc667b4-vmgmn -n ghost
[2023-10-13 13:34:05] INFO Ghost is running in production...
[2023-10-13 13:34:05] INFO Your site is now available on https://blog.mysite.io/
[2023-10-13 13:34:05] INFO Ctrl+C to shut down
[2023-10-13 13:34:05] INFO Ghost server started in 0.449s
[2023-10-13 13:34:15] ERROR Invalid database host.
Invalid database host.
"Please double check your database config."
Error ID:
500
Error Code:
ETIMEDOUT
----------------------------------------
Error: connect ETIMEDOUT
at /var/lib/ghost/versions/5.69.0/node_modules/knex-migrator/lib/database.js:50:23
at Connection._handleTimeoutError (/var/lib/ghost/versions/5.69.0/node_modules/mysql2/lib/connection.js:205:17)
at listOnTimeout (node:internal/timers:569:17)
at process.processTimers (node:internal/timers:512:7)
[2023-10-13 13:34:15] WARN Ghost is shutting down
[2023-10-13 13:34:15] WARN Ghost has shut down
[2023-10-13 13:34:15] WARN Your site is now offline
[2023-10-13 13:34:15] WARN Ghost was running for a few seconds
cat ghost-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: ghost
namespace: ghost
spec:
replicas: 3
selector:
matchLabels:
app: ghost
template:
metadata:
labels:
app: ghost
spec:
containers:
- name: ghost
image: ghost:latest
ports:
- containerPort: 2368
env:
- name: database__client
value: "mysql"
- name: database__connection__host
value: "mysql-service"
- name: database__connection__user
value: "ghost"
- name: database__connection__password
value: "password"
- name: database__connection__database
value: "ghost"
- name: url
value: "https://blog.mysite.io"
volumeMounts:
- mountPath: /var/lib/ghost/content
name: ghost-content
volumes:
- name: ghost-content
persistentVolumeClaim:
claimName: ghost-pvc
kubectl get pods -n ghost -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
mysql-779ddf6774-dm4c7 1/1 Running 0 82m 10.42.1.67 intelnuc-ubuntu <none> <none>
ghost-7bdfc667b4-nz7mk 0/1 CrashLoopBackOff 12 (3m42s ago) 44m 10.42.1.71 intelnuc-ubuntu <none> <none>
ghost-7bdfc667b4-qxrsx 0/1 CrashLoopBackOff 12 (101s ago) 44m 10.42.3.25 rpi-wn-mon <none> <none>
ghost-7bdfc667b4-vmgmn 0/1 CrashLoopBackOff 13 (31s ago) 44m 10.42.0.71 amd-deb <none> <none>
kubectl describe service mysql-service -n ghost
Name: mysql-service
Namespace: ghost
Labels: <none>
Annotations: <none>
Selector: app=mysql
Type: ClusterIP
IP Family Policy: SingleStack
IP Families: IPv4
IP: 10.43.199.78
IPs: 10.43.199.78
Port: <unset> 3306/TCP
TargetPort: 3306/TCP
Endpoints: 10.42.1.67:3306
Session Affinity: None
Events: <none>