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:
- Kubernetes – Specifically Google’s Kubernetes Engine (GKE)
- PHP FPM – for running WordPress
- NFS (Filesystem persistence)
- Utilises Persistent Volume Claim using Google Persistent Disks
- Google Cloud Storage
- Google Container Registry
- Google Container Builder
- Google Source Repositories
- DBMigrate (WordPress Plugin)
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.