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
Pre Requisites
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
Steps
Prepare the files in github actions workflow directory along with the files to be added in respective Argocd environments. See this PR for reference.
Add the microservice in
microservices.yaml
. See sample commit here.Wait for the terraform plan to finish executing in different workspaces and finally applied.
For new microservices, manual sync from Argocd is required for the app to be added in Argocd.
When it comes to vault secret creation, a
manual
path with no key/value is going to be created by thesafi-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.sample commit that included a tf run that auto creates a blank secret path
Provided you have a working token and logged in to the terminal, this is a sample command to create a secret.
You can validate the secrets in the UI.
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.
Check ArgoCD logs and sync status for realtime update
To deploy to stage, follow this steps Deploy applications to stage environment
Once the workflow for stage is completed, you should see your deployment like this in github.
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
Attachments:
image-20220825-030644.png (image/png)
image-20220825-030715.png (image/png)
image-20220825-031644.png (image/png)