Deploy a WordPress app using Kubernetes on AWS

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

Our guide will be


git clone

Install kubectl:

brew install kubernetes-cli


Install minikube:

brew cask install minikube


Install virtualbox

brew cask install virtualbox


minikube start

Any problems, use minikube delete.


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

The crucial commands:

kubectl create secret generic mysql-pass --from-literal=password=test
kubectl get secrets
kubectl create -f
kubectl get pvc
kubectl get pods
kubectl create -f
kubectl get pvc

minikube service wordpress --url
curl -L <url>

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

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


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

kubectl get pods
NAME                              READY   STATUS                       RESTARTS   AGE
wordpress-mysql-bcc89f687-hs677   0/1     CreateContainerConfigError   0          4m

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>


See also:

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



k get pods

NAME                             READY   STATUS                       RESTARTS   AGE
wp-1-mariadb-0                   0/1     CreateContainerConfigError   0          30m
wp-1-wordpress-7bff96d46-4bss6   0/1     CrashLoopBackOff             8          30m
k logs wp-1-mariadb-0
Error from server (BadRequest): container "mariadb" in pod "wp-1-mariadb-0" is waiting to start: CreateContainerConfigError


k describe pods wp-1-mariadb-0


  Type     Reason  Age                    From               Message
  ----     ------  ----                   ----               -------
  Warning  Failed  15m (x320 over 3h48m)  kubelet, minikube  Error: failed to prepare subPath for volumeMount "config" of container "mariadb"
  Normal   Pulled  64s (x389 over 3h48m)  kubelet, minikube  Container image "" already present on machine


Leave a Reply

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