Microservice architectures and containerization are regularly talked about, but how do we put this all together in a container-focused infrastructure?
PHP systems need to stay up, running and be smoothly linked from developer to deployment. Kubernetes has risen to be the industry-leader in container orchestration, providing a consistent means of deploying, scaling, updating and interrogating your web-based systems. Being container-driven from the ground-up, it helps realize the gains containerization offers right through your lifecycle: reproducibility, cloud-independence, immutable environments, managed self-service access.
This tutorial will be framed as a stepped deployment using open source profiles for deploying a Laravel system, termed Buckram. This will involve:
- setting up a generic Kubernetes system
- deploying Laravel onto it using Helm charts (versionable infrastructure description), with Postgres, Redis and workers
- employing a Gitlab repository for CI/CD for building container images
- managing per-deployment configuration and environment variables
- process health, logging and scaling
- using the artisan CLI tool for scheduled and one-off jobs on the cluster (as time permits)