SaFi Bank Space : Deploying new microservices - SRE guideline

This documentation is part of this SM-3695 - Write documentation how to deploy new microservice Done and aim to guide SRE team in adding new microservices in our cicd pipeline for tickets/request such as this ticket SM-3573 - Deploy ticket-manager Done

(blue star) Pre Requisites

  1. Service/api is already implemented in the code/dev level. See this as sample SM-3641 - implement create and query APIs in ticket-manager Done

(blue star) Steps (blue star)

  1. (blue star) Prepare the files in github actions workflow directory along with the files to be added in respective Argocd environments. See this PR for reference.

  2. (plus) Add the microservice in microservices.yaml. See sample commit here.

  3. (blue star) Wait for the terraform plan to finish executing in different workspaces and finally applied.

  4. (plus) For new microservices, manual sync from Argocd is required for the app to be added in Argocd.

  5. (blue star) When it comes to vault secret creation, a manual path with no key/value is going to be created by the safi-env-* tf workspace. For the actual key values to be added, we create that manually using vault command line or HTTP post. Pre-requisite is a working user/root token that has permission to write to vault.

    1. sample commit that included a tf run that auto creates a blank secret path

    2. Provided you have a working token and logged in to the terminal, this is a sample command to create a secret.

    3. You can validate the secrets in the UI.

  6. (blue star) You may need to re-trigger the gha workflow or re-sync argocd for the deployment to proceed once the infra is created from terraform.

  7. (tick) Check ArgoCD logs and sync status for realtime update

  8. (blue star) To deploy to stage, follow this steps Deploy applications to stage environment

  9. (blue star) Once the workflow for stage is completed, you should see your deployment like this in github.

  10. (blue star) For the app to be mapped to Tyk, you need to add it in this file. This one is for Brave env. https://github.com/SafiBank/SaFiMono/pull/9074/commits/ee9859bf3747a409dadf41ac56fe02e5b23baf73

Errors in workflow run checks

  1. Sample error

    1. This is most likely happening because there are pending unapplied terraform runs in terraform cloud

  2. Sample error in build micro service validate

    1. See the commit that fixed it