I am new to Kubernetes, and try to learn hands-on by setting up a Wordpress with this tutorial: https://github.com/kubernetes/kubernetes/tree/master/examples/mysql-wordpress-pd
My Kubernetes cluster runs on Amazon EC2, set up via kops. I ended up with a little cluster (1 master, 2 nodes). Then I started with the tutorial, but I use Amazon EBS volumes for persistent storage.
In the first attempt, I created the EBS volumes manually, and then wondered why Kubernetes created new ones, until I learned about StorageClasses and Dynamic Perstistent Volumes. Indeed I seem to have a default StorageClass using aws-ebs (surely set up by kops).
The tutorial consists of two pods: One for a MySQL database, and one for Wordpress. The first pod (MySQL) starts fine.
But the second (Wordpress) pod ends up in the state "CrashLoopBackOff". Using "kubectl describe", I found this:
Events:
FirstSeen LastSeen Count From SubObjectPath Type Reason Message
--------- -------- ----- ---- ------------- -------- ------ -------
10s 10s 2 default-scheduler Warning FailedScheduling [SchedulerPredicates failed due to PersistentVolumeClaim is not bound: "wp-pv-claim", which is unexpected., SchedulerPredicates failed due to PersistentVolumeClaim is not bound: "wp-pv-claim", which is unexpected., SchedulerPredicates failed due to PersistentVolumeClaim is not bound: "wp-pv-claim", which is unexpected.]
9s 9s 1 default-scheduler Normal Scheduled Successfully assigned wordpress-4130225953-hgn4h to ip-172-20-58-86.eu-west-1.compute.internal
9s 8s 2 controller-manager Warning FailedMount Failed to attach volume "pvc-b859ae60-358c-11e7-b405-02bae99411f4" on node "ip-172-20-58-86.eu-west-1.compute.internal" with: Error attaching EBS volume "vol-07bb1f4adb5fb9a96" to instance "i-0d12a00064527321a": IncorrectState: vol-07bb1f4adb5fb9a96 is not 'available'.
status code: 400, request id:
Apparently, it fails to mount the automatically provisioned volume to the node. But I checked the node via the AWS Console, and the volume is already attached.
Any ideas what went wrong?
Thanks
Martin