Deploy a WordPress app using Kubernetes on AWS

We’ll start off locally with minikubethen deploy to AWS.

Our guide will be https://github.com/kubernetes/examples/tree/master/mysql-wordpress-pd

Locally

git clone git@github.com:kubernetes/examples.git

Install kubectl:

brew install kubernetes-cli

https://kubernetes.io/docs/tasks/tools/install-kubectl/

 

Install minikube:

brew cask install minikube

https://github.com/kubernetes/minikube/releases

 

Install virtualbox

brew cask install virtualbox

 

minikube start

Any problems, use minikube delete.

https://github.com/kubernetes/minikube/issues/459

 

And here’s an Asciinema Asciicast of deploying WordPress on Kubernetes via minikube

The crucial commands:

Note if you’re using a namespace then you’ll need to do:

minikube service -n <your namespace> wordpress --url

https://stackoverflow.com/questions/53283657/kubernetes-could-not-find-finalized-endpoint-being-pointed-to-error-validating/53283783#53283783

 

Note: if we’d forgotten to configure the secrets then we’d have seen:

which we’d need to debug further with:

kubectl describe pods wordpress-mysql

and at the end you’d see (under Events:

Warning Failed 8s (x10 over 104s) kubelet, minikube Error: secrets "mysql-pass" not found

 

How to decode secrets

 

To list deployments use:

kubectl get deployment

or, for a specific deployment:

kubectl get deployment <your dep>

https://kubernetes.io/docs/reference/kubectl/cheatsheet/

 

See also: https://kubernetes.io/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume/#deploy-wordpress

Production-ready (also local)

Use Helm.

brew install kubernetes-helm

helm init

(otherwise you’ll get Error: could not find tiller)

helm install stable/wordpress

 

Check on progress with:

kubectl get pods

 

Issues:

https://stackoverflow.com/questions/53286172/error-from-server-badrequest-container-mariadb-in-pod-is-waiting-to-start

k get pods

Debugging:

k describe pods wp-1-mariadb-0

revealed:

 

Leave a Reply

Your email address will not be published. Required fields are marked *