Skip to content

Instantly share code, notes, and snippets.

@mmartinjoo
Last active May 8, 2024 13:10
Show Gist options
  • Star 16 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmartinjoo/702d085da5ed2a0f162c686073bdf942 to your computer and use it in GitHub Desktop.
Save mmartinjoo/702d085da5ed2a0f162c686073bdf942 to your computer and use it in GitHub Desktop.
DevOps with Laravel Table of Contents

Topics coming in the next edition:

  • ✅ Load balancers from scratch (published on 10th of October)
  • ✅ Terraform (published on 12th of November)
  • HELM

Fundamentals - 208 pages (Basic package)

Building a pipeline

nginx

  • Serving static content
  • CGI, FastCGI, php-fpm
  • CGI
  • FastCGI
  • php-fpm
  • nginx and PHP
  • nginx and Vue
  • Combined nginx config

Deployment

  • Deploy script
  • Deploying from a pipeline
  • Provisioning new servers

Queues and workers

  • supervisor
  • Multiple queues and priorities
  • Deploying workers
  • Optimizing worker processes

Domains and HTTPS with nginx

  • Domain
  • HTTPS

Optimization

  • nginx worker processes and connections
  • fpm processes
  • opcache
  • gzip
  • HTTP2
  • TLS1.3
  • nginx cache
  • Caching static content
  • Caching fastcgi responses

Backups and restore

  • AWS S3
  • spatie/laravel-backup
  • Restore script

Docker

  • The basics in theory
  • The basics in practice
  • Overview of the application
  • Dockerizing a Laravel API
  • Dockerizing a Vue app
  • Dockerizing a scheduler and a worker

docker-compose

  • Frontend

  • API

  • Databases

  • Migrations

  • nginx

  • Reverse proxy

  • Scheduler and worker

  • supervisor

  • Custom built images for MySQL and nginx

  • Building images in a pipeline

  • Optimizing the pipeline

    • Docker layers
    • Back to the pipeline
  • Production-ready docker-compose

    • Docker named volumes vs bind mounts
  • Deployment

    • Deploy script
    • Deploying from a pipeline
    • Provisioning new servers
    • update service
    • Restore
    • Rollback
    • Automatic image updates
  • GitFlow

    • Pushing to develop or main
    • Opening a PR to main
    • Opening a PR to develop (feature branches)
    • Reusing jobs (composite actions)
  • Final touches

    • Frontend, nginx, and proxy
    • Worker & Scheduler
  • Limitations of docker-compose

Docker Swarm - 75 pages (Plus package)

  • State
  • Basic concepts
  • Workers, managers, and leaders
  • Creating a cluster
  • Application-level changes
  • Deploying a stack
  • Service placements
  • Scaling services
    • API and nginx
    • Worker
    • Visualizing the cluster
    • Protecting the databases
    • Protecting user-facing service
    • Ingress routing mesh
  • Health checks
  • Restarting services
  • Updating services
  • Rolling back services
  • Deployment
    • Deploying from a pipeline
    • Update service
    • Provisioning nodes

Monitoring and error tracking

  • Uptime
    • Uptime robot
    • DigitalOcean
  • Health check monitors
    • Health checks in a cluster
  • Server resource alerts
  • Error tracking

Kubernetes - 77 pages (Premium package)

  • Introduction
  • Basic concepts
    • Pod
    • ReplicaSet
    • Deployment
  • Creating a cluster
  • Managed databases
  • Deploying a Laravel API
    • Configuring the deployment
    • Configs and secrets
    • Applying the deployment
    • Shortcuts
    • kubectl apply
  • Deploying nginx
  • Communication between nginx and FPM
  • Deploying a worker
  • Deploying a scheduler
  • Deploying a frontend
  • Running migrations in a cluster
  • Caching configs
  • Liveness and readiness probes
    • API probes
    • nginx probes
    • worker probes
    • frontend probes
    • timeoutSeconds
  • Autoscaling pods
    • Metrics server
  • Rolling update config
    • maxUnavailable
    • maxSurge
  • Resource requests and limits
  • Health check pods
  • Exposing the application
    • Ingress
    • Ingress controller & load balancer
    • Domain & HTTPS
  • Deploying the cluster from a pipeline
    • Secrets
    • Image versions
    • Ship it
    • kubectl & doctl
  • Monitoring the cluster

Serverless - 29 pages (Premium package)

  • Introduction
  • Platform-as-a-service
  • Serverless functions
  • The architecture of a code review tool
    • Overview
    • Webhook
    • Scheduler
    • Adding functions
  • Serverless Laravel on AWS
    • The serverless framework
    • bref

Load balancers from scratch - 18 pages (Premium package)

  • The basics of load balancers
  • nginx as a load balancer
  • Managed load balancers
  • Load balancing with docker-compose
  • Caching with a load balancer

Other ideas for future editions

  • ✅ Load balancers from scratch
  • Terraform
  • HELM
  • Implementing an autoscaler from sratch
  • How to choose a cluster size
  • Grafana Cloud
  • System design of an uptime service
@leonelunderscore
Copy link

Kubernetes > Deploying a frontendű, I think there is a typo

@mmartinjoo
Copy link
Author

Just fixed it, thanks!

@geanruca
Copy link

geanruca commented Sep 5, 2023

I'm super interested in Terraform!

@mmartinjoo
Copy link
Author

That's great to hear! I'm going to write about Terraform, that's 100% sure. I'm going to cover how to create/manage simple servers and databases, and also Kubernetes clusters.

@indigoram89
Copy link

Great! Laravel Octane, PostgreSQL, Prometeus, Grafana.

@fernandokbs
Copy link

Nginx!

@mmartinjoo
Copy link
Author

@fernandokbs the first 70 pages or so focus exclusively on "standard" deployments with nginx, pipelines, and shell scripts. No containers, no docker just a bare-bone nginx server.

@HelgeSverre
Copy link

Running multi-regional databases where near-realtime collaboration is required (think live production tools using websockets and where request latency over 500ms is unacceptable).

@indigoram89
Copy link

Caddy web server

@elmarzouguidev
Copy link

Is Premium Package contain all of this ??

@sitnikovalex
Copy link

It was very interesting to read about Terraform and HELM. I’m already working with both, but I think I’m not doing it optimally, and it’s not easy to find information in the context of Laravel.

@valence-fred
Copy link

Hello @mmartinjoo can I get a package with basic + swarm + Kubernetes without serverless?

@valence-fred
Copy link

Can I buy the plus package and top up later to the premium package?

@Andre-ADPC
Copy link

Thanks for a great resource, Martin. I'm personally going to hold off from buying for now, but it's on my "to-get" list.
I'm working on Larvel + Nuxt + Vue + Ionic Capacitor/AppFlow at the moment which brings in the two main Mobile app stores and CI/CD functionality as well. (Flutter+Dart is also an option which I'm sure some devs would prefer to apply.) Once I have come to grips with that, your DevOps with Laravel guidance will be next.

I'm also interested in learning how we could extend the content you have here in the ToC in terms of applying Octane, WAFs and CDNs like Cloudflare for example, and also tying in with distributed cloud DB platforms; PlanetScale SingleStore, Clickhouse, etc. Maybe for those who are users of Forge, some comparisons between your approach and it could be a good consideration to include in your future work.

Answering "Whys, Whens, Wheres" etc. is often more important knowledge to have than the "Hows".

It is an ever-evolving topic/field and I'm sure there are a variety of others who would all love to see how the Laravel-based tech & its peripheral tools + tech can be applied as a "flexible, holistic scalable" implementations from a DevOps perspective.

May it grow as you envisage it should be!

@artemnl
Copy link

artemnl commented Sep 29, 2023

I want to request Traefik and optimizing FE pipelines with Bun\Vite.

@rodrigolabs
Copy link

Octane in production, please :)

@mmartinjoo
Copy link
Author

Can I buy the plus package and top up later to the premium package?

Yes, anytime! Just send me a mail.

@mmartinjoo
Copy link
Author

Is Premium Package contain all of this ??

Yes!

@mmartinjoo
Copy link
Author

Hey Everyone!

Tomorrow (10th of October) a new update is going to be available! I added a new 18-page chapter called "Load balancers from scratch"

@fernandokbs
Copy link

Just curious, why keep writing nginx like this, shouldn't be Nginx ??

@indigoram89
Copy link

Hey Everyone!

Tomorrow (10th of October) a new update is going to be available! I added a new 18-page chapter called "Load balancers from scratch"

Wow! Thank you so much!

@aeq-dev
Copy link

aeq-dev commented Jan 17, 2024

May be the new Frankenphp tool

@indigoram89
Copy link

+1 for FrankenPHP (Octane)

@santiagopereyramarchetti
Copy link

santiagopereyramarchetti commented Jan 23, 2024

Hi! i want to know if:
1 - Do you plan to add helm soon?
2 - Do you plan add dockerize an Inertia with Vue and Laravel app, not Vue and Laravel API ?

@cAstraea
Copy link

Does it touch on the alternatives runners like swoole / frankenphp / roadrunner etc
Though I think it's a bit out of scope.

@ds-hoanganh-pham
Copy link

I'm extremely interested in Terraform! Have you completed it yet?

@mmartinjoo
Copy link
Author

I'm extremely interested in Terraform! Have you completed it yet?

Yes, Terraform is included!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment