1 of 17

Charm WordPress-k8s Introduction

Hands-on community workshop

2 of 17

Agenda

  1. Overview
  2. Architecture
  3. Profile
  4. Charm Maturity

3 of 17

Overview

Section 1

4 of 17

About WordPress

Charm Functionality

Application

  • PHP based website builder
  • Hosted through Apache
  • Able to build and host different websites
    • Blogs
    • Ecommerce
    • Small business applications
  • Facilitates connections to
    • Database
    • The COS
    • Ingress
    • Openstack Object Storage (S3)
  • Manages configurations
    • Plugins
    • Themes
    • Akismet, Nginx ModSecurity
    • OpenID Authentication
  • Scaling in cluster
  • And much more!

5 of 17

WordPress-k8s Demo

Steps

  • Microk8s installation
  • Juju installation
  • Microk8s & Juju bootstrapping
  • Deploy MySQL k8s database
  • Deploy Wordpress k8s
  • Relate WordPress k8s and MySQL k8s
  • Visit WordPress instance

6 of 17

Architecture

Section 2

7 of 17

WordPress-k8s Workload Architecture

Technical Architecture

  • The main charm controller container
  • A look into the main workload sidecar
    • Pebble
    • WP-CLI
    • Promtail
  • A look into prometheus metrics exporter
    • Pebble�

WordPress Charm(Pod)

Prometheus-exporter container

Pebble

WordPress container

Pebble

Charm container

Juju Controller

OpenStack Swift

8 of 17

Sidecar vs podspec pattern

WordPress Charm(Pod)

Prometheus-exporter container

Pebble

WordPress container

Pebble

Charm container

Juju Controller

OpenStack Swift

Sidecar: prometheus-exporter

Workload: wordpress

Operator : wordpress-operator

WordPress-�operator

WordPress

WordPress Operator

WordPress workload

Podspec yaml

9 of 17

WordPress-k8s Integrations

Provided Integrations

Required Integrations

  • grafana-dashboard: grafana_dashboard
  • metrics-endpoint: prometheus_scrape
  • logging: loki_push_api
  • nginx-route: nginx-route�
  • database: mysql_client
  • db: mysql (deprecated)

* <Integration-name>: <interface>

10 of 17

WordPress-k8s Integrations Demo

Steps

  • Prometheus-k8s deployment
  • Loki-k8s deployment
  • Grafana-k8s deployment
  • Loki-k8s <-> Prometheus-k8s integration
  • Grafana-k8s <-> Prometheus-k8s integration
  • WordPress <-> Prometheus-k8s integration
  • Visiting Grafana dashboard

11 of 17

Profile

Section 3

12 of 17

WordPress-k8s Profile

Important links

Link to Charmhub

Link to repository

Usage documentation

Contribution guidelines

Licensing statement

Publisher

@canonical/is-charms

13 of 17

WordPress-k8s CI Automation

Referring to CI Implementations: Operator-workflows

Code linting or-style checks

✅Inclusive naming, Shell script lint, Dockerfile lint, Metadata lint, Trivy scanning

Unit test implementation

✅Pytest unit tests

Unit test results

✅100% coverage

Integration test implementation

✅Juju integration tests with all features provided

Integration test results

✅100% passing

Release automation

✅Release to edge, Publish to stable

14 of 17

Section 4

15 of 17

Charm Maturity: Stage 1

Important Qualities

Reliability

✅Unit testing, Integration testing, Upgrade testing

Reference to operator-workflows

Collaboration Ready

✅Consistent naming, Icon, Documentation

Readable Code (PEP 8 for general code style, PEP 257 for in-code documentation style, Charm style guide)

Compliance

✅Copyright, trademark usage

Up-to-date

✅Automated updates of dependencies

Reachability

✅Maintained by IS-DevOps team at Canonical

16 of 17

Charm Maturity: Stage 2

Important capabilities

Sensible defaults

✅Default enabled WAF and Openstack Object Storage plugins on integration

Ecosystem compatibility

✅Compatible with many other juju charms!

Safe upgrades

✅Tested upgrades during integration tests before releases

Scalability

✅Scaling support with OpenStack plugin

Observability

✅Full compatibility with COS

17 of 17

Thank you. Questions?