zxcvbnius/k8s-30-day-sharing

Issue in day13

Opened this issue · 0 comments

I tried to follow your steps in day13. However I found an issue during my first deploy. When we creating the Pod, it started wordpress first, then started mysql. After the deploy competed, the wordpress one shows

wordpress:

Container ID:   docker://8cc5543acbb8b15fde01e32428456a2af2010cb15234e8ffe373775b8f99736d
Image:          wordpress:4-php7.0
Image ID:       docker-pullable://wordpress@sha256:c24c534fa99c17f7b0923d6ffa791b0f7fb43a821de5bc09564e46ae09d9966a
Port:           80/TCP
Host Port:      0/TCP
State:          Running
  Started:      Sun, 03 Feb 2019 23:06:19 -0500
Last State:     Terminated
  Reason:       Error
  Exit Code:    1
  Started:      Sun, 03 Feb 2019 23:05:25 -0500
  Finished:     Sun, 03 Feb 2019 23:05:55 -0500
Ready:          True
Restart Count:  1
Environment:
  WORDPRESS_DB_PASSWORD:  <set to the key 'db-password' in secret 'wordpress-secret'>  Optional: false
  WORDPRESS_DB_HOST:      127.0.0.1
Mounts:
  /var/run/secrets/kubernetes.io/serviceaccount from default-token-mktkm (ro)

It was because the MySQL is not ready when wordpress tried to connect database.

Do we have any approach to order the container start up sequence when define the deployment file like depends_on in docker compose file?