Skip to content

Latest commit

 

History

History
88 lines (66 loc) · 3.06 KB

File metadata and controls

88 lines (66 loc) · 3.06 KB

WordPress

WordPress is a commonly used Blog and CMS engine that serves as an excellent introduction to a multi-tier application.

The WordPress example has two major components: A MySQL database to serve as the backing datastore and the WordPress container itself that combines the Apache webserver along with PHP and the needed application dependencies to run an instance of the blog engine.

The manifests used in this example function as the bare minimum to provision an instance and should not be used in a production deployment. For a more production ready deployment, see the WordPress Helm Chart.


Installation

  1. Create the Secret used for the MySQL root account:
$ kubectl create -f manifests/secret-mysql.yaml 
  1. Create the MySQL StatefulSet and its associated service.
$ kubectl create \
  -f manifests/sts-mysql.yaml \
  -f manifests/svc-mysql.yaml

NOTE: The MySQL StatefulSet does not require a PVC to be created ahead of time for its storage. Instead, it uses the volumeClaimTemplates StatefulSet feature in combination with the default StorageClass provided by Kind to dynamically provision a volume.

  1. Wait for the Pod to be up and running:
$ kubectl get pods --watch
  1. With MySQL up and running, WordPress can now be provisioned. Start by Creating the PVC used to store WordPress's internal data.
$ kubectl create -f manifests/pvc-wordpress.yaml
  1. Now create the WordPress deployment and its associated Service.
$ kubectl create \
    -f manifests/dep-wordpress.yaml \
    -f manifests/svc-wordpress.yaml
  1. Wait for the Pods to be up and running:
$ kubectl get pods --watch
  1. With both MySQL and WordPress up and running, visit the IP:Port combo from the command below in a browser to access the WordPress deployment.
$ echo $(docker inspect -f '{{.NetworkSettings.Networks.kind.IPAddress}}' kind-control-plane):80

At this point, you should see the WordPress default installation and configuration page. You can configure it and give it a go!


Clean Up

$ kubectl delete -f manifests/
$ kubectl delete pvc mysql-data-mysql-0