In order to make sure that everything goes well you need to check, check and double-check. The aim is to make your deploys as controllable as possible, so we can limit the number of things that could go wrong. That’s exactly why we’ll be going over this checklist that you could use when it comes to deploying code to production.
The checklist on a high-level looks like this:
- 1.Know what is going to get deployed
- 2.Excessive testing; preferably using a pipeline with automated tests
- 3.Know when is going to get deployed
- 4.Create backups
- 5.Deploy to production
- 6.Test on the live server
- It is extremely important to know exactly what you put in version control. Make sure you mask passwords, or better put them in your file with environment variables, like a .env file that contains all environments variables.
- What’s less impactful, but definitely not what we want in .env, is to put in config files and version control.
- Before any piece of code gets deployed it should be tested thoroughly. Testing the code comes in different degrees.
- Code reviews should be part of the routine of every team just to have an extra pair of eyes look at what is being deployed.
- In the best-case scenario writing code should go hand-in-hand with writing automated tests for that same piece of code.
- Pipelines are flexible in a way that you could configure them however the most common components of a pipeline are build automation, test automation, and deployment automation.
- Ensure that every change to the code is releasable and as easy pushing a button.
Apps are independent
Configuration and secrets
Pod security policies
Role-Based Access Control (RBAC) policies
Approved Kubernetes configuration