Prerequisite:
1. Prepare helm charts:-
We use helm charts to manage and generate the Kubernetes manifest files and use them for further deployment to the respective Kubernetes cluster. Each service is created as charts which will have the below-mentioned files in it.
For Eg: billing-service/ # Directory – the name of the service/app
Chart.yaml # A YAML file containing information about the chart
LICENSE # OPTIONAL: A plain text file containing the license for the chart
README.md # OPTIONAL: A human-readable README file
values.yaml # Important: The default configuration values for this chart
templates/ # A directory of templates that, when combined with values, will generate valid Kubernetes manifest files.
templates/deployment.yaml
templates/service.yaml
templates/ingress.yaml
To deploy a new service, you need to create a new helm chart for it( refer to the above example). The chart should be created under the charts/helm directory in the DIGIT-DevOps repository. If you are going to introduce a new module with the help of multiple services, we suggest you create a new Directory with your module name.
Eg.:-
charts/helm/<new_module_name>/<new_service_chart_name-1>
charts/helm/<new_module_name>/<new_service_chart_name-2>
You can refer to the existing helm chart structure here
2. Build Image with below Formate:-
Make sure you follow the correct formatting while building your image for new services.
image name format <docker_reponame>/<new_service_chart_name-1>:<image_tag>
Here new service image name ie. <new_service_chart_name-1>
should be similar to your service chart name (charts/helm/<new_module_name>/<new_service_chart_name-1>)
eg. egovio/billing-service:v1.3.4-72f8a8f87b-39
3. Deploy new services into the environment:-
To deploy a new service into the cluster using the below command under egov-deployer folder.
go run main.go deploy -e <environment_name> -c '<docker_reponame>/<new_service_chart_name-1>:<image_tag>,<docker_reponame>/<new_service_chart_name-2>:<image_tag>'