Tom Haddon has proposed merging ~mthaddon/charm-k8s-wordpress/+git/charm-k8s-wordpress:readme into charm-k8s-wordpress:master.
Commit message: Update README to be more end-user focused, showing initial deployment steps up front Requested reviews: Wordpress Charmers (wordpress-charmers) For more details, see: https://code.launchpad.net/~mthaddon/charm-k8s-wordpress/+git/charm-k8s-wordpress/+merge/394940 Update README to be more end-user focused, showing initial deployment steps up front -- Your team Wordpress Charmers is requested to review the proposed merge of ~mthaddon/charm-k8s-wordpress/+git/charm-k8s-wordpress:readme into charm-k8s-wordpress:master.
diff --git a/README.md b/README.md index 9255bbf..771c9b4 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,59 @@ Wordpress images. ## Details -See config option descriptions in config.yaml. +To deploy in a test environment, first of all deploy MySQL into a IaaS model: + + juju deploy cs:mysql + +Initialise the database as follows: + + CREATE DATABASE wordpress CHARACTER SET utf8 COLLATE utf8_unicode_ci; + CREATE USER 'wordpress'@'%' IDENTIFIED BY 'wordpress'; + GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'%'; + FLUSH PRIVILEGES; + +Deploy the charm into your Kubernetes Juju model: + + juju deploy cs:~wordpress-charmers/wordpress + +The Wordpress k8s charm requires TLS secrets to be pre-configured to ensure +logins are kept secure. Create a self-signed certificate and upload it as a +Kubernetes secret (assuming you're using MicroK8s): + + openssl req -new -newkey rsa:2048 -days 365 -nodes -x509 -keyout server.key -out server.crt + microk8s.kubectl create secret tls -n wordpress tls-wordpress --cert=server.crt --key=server.key + +Tell the charm where the database is and provide some initial setup: + + DB_HOST=$IP_OF_YOUR_MYSQL_DATABASE + juju config wordpress db_host=$DB_HOST db_user=wordpress db_password=wordpress tls_secret_name=tls-wordpress \ + initial_settings="user_name: admin + admin_email: devn...@example.com + weblog_title: Test Blog + blog_public: False" + +From there you can test the site by updating your `/etc/hosts` file and creating +a static entry for the IP address of the Kubernetes ingress gateway: + + App Version Status Scale Charm Store Rev OS Address Message + wordpress wordpress:bionic-stable waiting 1 wordpress local 0 kubernetes 10.152.183.140 + + echo '10.152.183.140 myblog.example.com' | sudo tee -a /etc/hosts + +It will take about 5 to 10 minutes for Juju hooks to discover the site is live +and perform the initial setup for you. Look for this line in the output of +`juju debug-log` to confirm: + + unit.wordpress/0.juju-log Wordpress configured and initialised + +This is due to [issue #166](https://github.com/canonical/operator/issues/166) and will be fixed once Juju supports a Kubernetes +pod ready hook. + +To retrieve the random admin password, run the following (until [LP#1907063](https://bugs.launchpad.net/charm-k8s-wordpress/+bug/1907063) is addressed): + + microk8s.kubectl exec -ti -n wordpress wordpress-operator-0 -- cat /root/initial.passwd + +You should now be able to browse to https://myblog.example.com/wp-admin. ## Quickstart
-- Mailing list: https://launchpad.net/~wordpress-charmers Post to : wordpress-charmers@lists.launchpad.net Unsubscribe : https://launchpad.net/~wordpress-charmers More help : https://help.launchpad.net/ListHelp