Multisite Wordpress on kubernetes with kustomize

Well, Wordpress is not my favourite Content Management System, but some customers and some project managers just like it. At fairkom we had been hosting Wordpress instances at a dedicated virtual machine with an extra database VM, all configurable via ISPconfig. But as all are asking for cloud native and high availability solutions, we have been looking into deploying Wordpress on our kubernetes cluster.

When it comes to the deploymnet of a Wordpress multisite instance, you need to do that in three steps.

First run gives you access to the Tools - > Network menu to configure multisite.

WORDPRESS_CONFIG_EXTRA: |
     define('WP_ALLOW_MULTISITE', true );

You then login as admin and configure your multisite nework (I prefer subdomain based).

WORDPRESS_CONFIG_EXTRA: |
  define('WP_ALLOW_MULTISITE', true );
  define( 'MULTISITE', true ); 
  define( 'SUBDOMAIN_INSTALL', true ); 
  define( 'DOMAIN_CURRENT_SITE', 'mydomain.org' ); 
  define( 'PATH_CURRENT_SITE', '/' ); 
  define( 'SITE_ID_CURRENT_SITE', 1 ); 
  define( 'BLOG_ID_CURRENT_SITE', 1 ); 

If you want to be able to host any other domain as well (not just same or subdomains), then you can insatll the Domain Mapping System plugin. There you have to copy a file and activate it:

1000@portal-6d9dfbd85c-rwh8c:/var/www/html$ cp wp-content/plugins/domain-mapping-system/sunrise.php wp-content/
define( 'SUNRISE', true);

When following these three steps, you can host any domain on one multisite wordpress instance. For mapping all pages of any other domain, you would need the pro version of the Domain Mapping System plugin, else you can map only a few pages that you configure manually (may be sufficient for a wordpress landing page site).

Umfeld: