Deploy a scalable WordPress implementation on Kubernetes  

Deploy a scalable WordPress implementation on a Kubernetes cluster

Last updated | By Animesh Singh, Tommy Li

Description

WordPress is the world’s most popular website management and blogging system, supporting more than 60 million websites. At its core, WordPress is built on one of the most common web programming languages, PHP, and uses MySQL as its back-end database. Kubernetes, the open-source container management system, is one of the top 10 GitHub projects based on number of unique developers contributing code. The challenge for developers is how to bring these two giant open source projects together to provide maximum benefits.

Overview

You as a developer are looking to create best-of-class applications, and to do that you need to use the leading tools and platforms. This journey shows you how to harness the full power of Kubernetes clusters and demonstrates how easy it is to deploy the world’s most popular website framework on top of world’s most popular container orchestration platform.

You’ll find step-by-step instructions, including a full roadmap for hosting WordPress on a Kubernetes Cluster from IBM Bluemix Container Service. Each component runs in a separate container or group of containers.

WordPress represents a typical multi-tier app and each component will have its own containers. The WordPress containers are the front-end tier and the MySQL container is the database/back-end tier for WordPress. The WordPress front-end tier can use MySQL as a service from Bluemix.

Flow

  1. The user interacts with WordPress via the web interface.Each WordPress container will respond to its users via HTTP/HTTPS.
  2. When a user posts to any WordPress container, WordPress will typically post the changes to the MySQL database. The MySQL database stores the post data into persistent disks to maintain security. In addition to a MySQL container, you can also use the Compose MySQL service from Bluemix. After authentication and authorization are complete, WordPress user information such as password (encrypted with MD5) and email address are created and stored in MySQL. Website, blogs, tags, categories, and other data are also stored in MySQL.
  3. The user can also upload themes, plugins, images, and documents. Non-textual data such as PDFs,videos, and MP3s, can also be uploaded.
  4. Themes, plugins, PDFs, videos, MP3s, etc. are stored in a persistent volume attached to the WordPress pods.
  5. The user accesses the WordPress website or blog. The WordPress core (that is, the WordPress “brain”) calls the required PHP scripts, starting with index.php.
  6. WordPress reaches out to the MySQL database to retrieve the website, blogs, tags, categories, and so on.
  7. TheWordPress core then retrieves the themes, documents, images, etc. from the persistent volume, combines it with data retrieved from the database, and presents the page to the user.

Related Blogs

Newsletters: The Curious Developer’s Best Friend

The great thing about software development is that there is always something new to learn! The terrible thing about software development is that there is always something new to learn! Luckily, there are tons of wonderful people sharing their knowledge every week in helpful and entertaining newsletters ... and unfortunately, it can be really easy...

Continue reading Newsletters: The Curious Developer’s Best Friend

Related Links