This stage covers how to deploy to kubernetes and set up a local kubernetes development enviroment.
- 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.
- 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.
- Php code is in git.
- You are using PostgreSQL.
- If not, replace the PostgreSQL step with your DB of choice.
- You have a server.
- In this example and future ones, we'll be deploying to DigitalOcean but the steps should mostly work with any servers.
- The server is running Ubuntu 20.04 or Kubernetes cluster.
- You have SSH key pair.
- Needed to log into your server securely.
- You have a Domain Name, and you can add entries to point to the server.
- We'll be using example.com here. Just replace that with your domain of choice.
- For DNS, I'll be using Cloudflare in these examples.
- I would recommend using a DNS provider that supports Terraform and LetsEncrypt
Once again for dev we'll be using the following docker image:
For production, we'll be using the same one previously as well: