Continuous Integration & Delivery: From Dev Team Perspective
Step1: Developer starts working on a code fix/enhancement.
- Developer commits code to development branch
- Build process get kicked off along with unit tests are executed.
- Result of Step 2 is a docker image.
- Container image gets uploaded to container registry such as GCR (google cloud registry).
- This latest image needs to be deployed on Dev env.. This can be done with Kubernetes engine by following:
- Manually - Update the pod configuration.yaml file with the latest docker version.This will create a new POD with latest image.
- Automation - Write a serverless function which will have a cronjob polling the container registry to check for latest image. If found will update the pod config & result will be a new POD with latest image.
- Perform tests on dev env. deployed with latest image.
- Here integration tests can be triggered manually or by automated way (using jenkins/spiannker).
- As well as perform manual tests
Step 2 - Developer find an issue while testing the code fix (performed in Step 1)
- Developer finds an issue while testing the image generated in Step 1.
- Might be the integration tests got failed. Or,
- Issues with image deployment. Or,
- Issue caught while manual testing.
- Etc.
- Fix the code again, & commits code in dev branch.
- Build gets triggered, unit tests are performed. And a new image gets generated.
- This image gets uploaded on container registry.
- New image having code fix needs to be deployed in dev. env.
- Developer retest the code fixes,
Step 3 - Testing Completed, now merge the changes in master branch
- Now its time to commit the code in master branch. As all tests are passed with recent fix made.
- Same steps will be followed as described above.
- Just one change will be here that the container registry will now have a public release.
- Initially it was for testing purpose & scope of that image was internal use only.
- Now as the changes are finalized, it has to be available for public use.
- Public use may or may not be be restricted as per the management decision.
Continuous Deployment:
- With continuous deployment - comes continuous challenges of;
- How an update is rolled out?
- Does this update needs to be rolled out completely or partially? This brings the concept of Canary Deployment.
- How to switch the traffic from old version to new version? This will bring in the Blue-Green Deployment.
- Below is the basic possible deployment flowchart, briefly describing how the update rollout happens?
- 5(a) Container image is now ready to be deployed to canary deployment.
- Container image promoted to canary.
- Once a set of users verify that latest deployment on canary is working fine, it needs to be deployed on production.
- Container image promoted to production.
References:
Enjoy :-)
No comments:
Post a Comment