← Back to team overview

wordpress-charmers team mailing list archive

[Merge] ~mthaddon/charm-k8s-wordpress/+git/charm-k8s-wordpress:five-six into charm-k8s-wordpress:master

 

Tom Haddon has proposed merging ~mthaddon/charm-k8s-wordpress/+git/charm-k8s-wordpress:five-six into charm-k8s-wordpress:master.

Commit message:
Switch to version 5.6 as the default image, make the deployment process easier by setting some config defaults

Requested reviews:
  Canonical IS Reviewers (canonical-is-reviewers)
  Wordpress Charmers (wordpress-charmers)

For more details, see:
https://code.launchpad.net/~mthaddon/charm-k8s-wordpress/+git/charm-k8s-wordpress/+merge/395944

Switch to version 5.6 as the default image, make the deployment process easier by setting some config defaults.

This has been tested locally.
-- 
Your team Wordpress Charmers is requested to review the proposed merge of ~mthaddon/charm-k8s-wordpress/+git/charm-k8s-wordpress:five-six into charm-k8s-wordpress:master.
diff --git a/README.md b/README.md
index 771c9b4..886c92a 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
-# Wordpress k8s charm
+# Wordpress Operator
 
-A Juju charm for a Kubernetes deployment of Wordpress, using the
-official Dockerhub Wordpress image or an image built from this base.
+A Juju charm for a Kubernetes deployment of Wordpress, configurable to use a
+MySQL backend.
 
 ## Overview
 
@@ -9,8 +9,9 @@ This is a k8s charm and can only be deployed to to a Juju k8s cloud,
 attached to a controller using `juju add-k8s`.
 
 The image to spin up is specified in the `image` charm configuration
-option using standard docker notation (eg. 'localhost:32000/mywork-rev42').
-The default image is Dockerhub's `wordpresscharmers/wordpress:bionic-stable` image,
+option using standard docker notation (e.g. 'localhost:32000/mywork-rev42').
+The default image is built using an OCI Recipe on Launchpad and pushed to
+[the 'wordpresscharmers/wordpress' namespace on Dockerhub](https://hub.docker.com/r/wordpresscharmers/wordpress),
 but you can also use private images by specifying `image_user` and `image_pass` charm
 configuration.
 
@@ -41,10 +42,6 @@ Initialise the database as follows:
     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):
@@ -52,20 +49,18 @@ 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:
+Deploy the charm into your Kubernetes Juju model:
 
     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: devnull@xxxxxxxxxxx
-            weblog_title: Test Blog
-            blog_public: False"
+    juju deploy cs:~wordpress-charmers/wordpress \
+        --config db_host=$DB_HOST \
+        --config tls_secret_name=tls-wordpress
 
 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 
+    App        Version        Status   Scale  Charm      Store  Rev  OS          Address         Message
+    wordpress  wordpress:5.6  waiting      1  wordpress  local    0  kubernetes  10.152.183.140
     
     echo '10.152.183.140 myblog.example.com' | sudo tee -a /etc/hosts
 
diff --git a/config.yaml b/config.yaml
index b360520..4a4604e 100644
--- a/config.yaml
+++ b/config.yaml
@@ -1,8 +1,8 @@
 options:
   image:
     type: string
-    description: "The docker image to install. Required. Defaults to Dockerhub wordpresscharmers/wordpress:bionic-stable"
-    default: "wordpresscharmers/wordpress:bionic-stable"
+    description: "The docker image to install. Required."
+    default: "wordpresscharmers/wordpress:5.6"
   image_user:
     type: string
     description: "Username to use for the configured image registry, if required"
@@ -36,7 +36,7 @@ options:
   db_password:
     type: string
     description: "MySQL database user's password"
-    default: ""
+    default: "wordpress"
   container_config:
     type: string
     description: >
@@ -54,7 +54,7 @@ options:
   initial_settings:
       type: string
       description: >
-        Optional, YAML formatted, Wordpress configuration. It is used only
+        YAML formatted Wordpress configuration. It is used only
         during initial deployment. Changing it at later stage has no effect.
         If set to non empty string required keys are:
 
@@ -68,8 +68,10 @@ options:
             blog_public: False        # by default blogs are public
 
         If admin_password is not provided it will be automatically generated
-        and stored on the operator pod in the /root directory
-      default: ""
+        and stored on the operator pod in the /root directory.
+      default: |
+        user_name: admin
+        admin_email: devnull@xxxxxxxxxxx
   blog_hostname:
     type: string
     description: Blog hostname

Follow ups