Employsure, a leading workplace relations specialist,  empower employers to manage the risks associated with Fair Work and WHS compliance. They required a flexible but stable way of running their websites on the cloud. Servian consultants designed a Google Cloud based system which has provided flexibility, improved deployment processes and lowered costs .

The challenges

A cloud environment challenge

In 2017, Employsure approached Servian to help them migrate 11 existing (production) websites off their old cloud provider onto something that was more maintainable going forward. There were issues with cost, scale, plugin support and general knowledge about how the websites ‘worked’ and the manner in which they were updated.

Freedom within boundaries

WordPress provides an unparalleled eco-system and plugin architecture which can provide significant challenges for maintaining operational stability. Typically content creators have a strong desire for absolute freedom. This contrasts with structured release processes which typically slow the release tempo.

Achieving a balance is a significant challenges for the design, both in terms of technology and methodologies. Existing maintainers of the various websites were initially skeptical and resistant to the new deployment and maintenance methodologies.

Happy stakeholders

The Servian design balanced stakeholder concerns, addressing pain points. The container technology approach with Kubernetes has helped to ensure uptime as well as providing a deployment approach which provides the ability to rapidly update each of the instances.

Our solution

The Platform Design:

All websites are hosted in Google Cloud with Google’s Kubernetes Engine (GKE). There is a single cluster that has two namespaces – staging and production.

All wordpress database data is in a Google Cloud SQL (MySQL) instance. Every 24 hours, backups of both the WordPress filesystem and the Database are executed and sent to Google Cloud Storage, which both Servian Managed Services and Employsure have access to.

Given the container strategy in place, the Docker-First approach allowed Employsure developers to work on environments with minimal fuss and minimal setup time. Spinning up an environment for local development is estimated to take < 5 minutes (down from approximately 1-2 days).

The Platform was designed using the following tools:

  • Docker
  • Kubernetes – Specifically Google’s Kubernetes Engine (GKE)
  • PHP FPM – for running WordPress
  • Nginx
  • NFS (Filesystem persistence)
  • Utilises Persistent Volume Claim using Google Persistent Disks
  • Google Cloud Storage
  • Google Container Registry
  • Google Container Builder
  • Google Source Repositories
  • WordPress
  • DBMigrate (WordPress Plugin)

Deployment pipeline:

A big change for the client was utilisation of a new deployment pipeline. Previously, developers would SCP files across to staging and production ‘boxes’, which led to unpredictable results as files were sometimes out-of-sync between environments.

Servian proposed a vastly different solution, using Source Control (git) in order to ensure that the environments were identical.

Each website has its own dedicated source repository. Each repository has at least 2 branches – develop and master. Any change to develop will trigger a deployment to the appropriate staging environment, while any change to master will trigger a deployment to the appropriate production environment.

The build process is handled by Google Container Builder, which builds Docker images (stored in Google Container Registry), then runs Kubernetes ‘jobs’ in order to deploy the appropriate code to the NFS filesystem.