Skip to content

smart48/deploying-laravel-app-stage5-docker-kubernetes-terraform-deploy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stage 5: Kubernetes and Terraform deploy

Intro

This stage covers how to deploy to kubernetes and set up a local kubernetes development enviroment.

##Demo

Pros

  • Very repeatable
  • Faster from nothing to fully setup
  • Can replicate the entire infrastructure for dev or staging.
  • Everything documented.
  • Simple high availability
  • Quick to set up entire enviroment once setup.

Cons

  • Very complicated.
  • Takes longer to set up initial scripts.
  • Require knowledge for far more application and moving pieces.
  • As everything is automated you have to be far more careful not so break something.

Assumptions

  1. Php code is in git.
  2. You are using PostgreSQL.
  3. If not, replace the PostgreSQL step with your DB of choice.
  4. You have a server.
  5. In this example and future ones, we'll be deploying to DigitalOcean but the steps should mostly work with any servers.
  6. The server is running Ubuntu 20.04 or Kubernetes cluster.
  7. You have SSH key pair.
  8. Needed to log into your server securely.
  9. You have a Domain Name, and you can add entries to point to the server.
  10. We'll be using example.com here. Just replace that with your domain of choice.
  11. For DNS, I'll be using Cloudflare in these examples.
  12. I would recommend using a DNS provider that supports Terraform and LetsEncrypt

Docker Images

Once again for dev we'll be using the following docker image:

For production, we'll be using the same one previously as well:

Deployment

About

deploying-laravel-app-stage4-docker-kubernetes-terraform-deploy

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published