2. Deployment
Steps to deploy DIGIT services post infra setup
Now that the Infra setup is complete, the next step is the deployment of DIGIT services. The pre-requisites for deployment are listed here.
What we'll deploy in Quickstart:
- DIGIT's core platform services
- Gov Service/s
DIGIT uses golang scripts to simplify the deployment process - an automated way by leveraging helm package manager to deploy the containerized services onto Kubernetes. Ensure that the below prerequisites are met before you proceed.
- 2.
- 3.
- 4.
- 5.
- 6.
- 1.Clone the following DIGIT Devops GitRepo. You may have to install git and then run git clone on your machine.
- git clone -b quickstart https://github.com/egovernments/DIGIT-DevOps
- 2.After cloning the repo CD into the folder DIGIT-DevOps, type the "code" command. This opens the visual editor and the DIGIT-DevOps repo files.
- cd DIGIT-DevOpscode .
- 3.Create a deployment config file. Use the following template to update any custom values to be changed (if you know the impact). Run it as is for the quickstart. Navigate to the following file in your local repo:DIGIT-DevOps/deploy-as-code/helm/environments
global:
domain: quickstart.local.digit ## Add your Domain Name
cluster-configs:
namespaces:
create: true #set this flag true for 1st time deployment, will create the respective namespaces.
values: [ backbone, cert-manager, egov, kafka-cluster, monitoring, playground, zookeeper-cluster ]
root-ingress:
cert-issuer: letsencrypt-prod
serviceName: digit-ui
appRoot: digit-ui
configmaps:
egov-config:
data:
db-host: postgres.egov ## Add db-host name
db-name: egov_ms ## Add db-name
db-url: "jdbc:postgresql://postgres.egov:5432/egov_ms" ## example: jdbc:postgresql://egov-demo.postgres.database.azure.com:5432/egov_demo
domain: "quickstart.local.digit" ## Add your Domain Name
egov-services-fqdn-name: "http://quickstart.local.digit/" ## Add your Domain Name
egov-state-level-tenant-id: "pg" ##Add tenant id example: pb
es-host: "elasticsearch-client-v1.es-cluster"
es-indexer-host: "http://elasticsearch-client-v1.es-cluster:9200/"
flyway-locations: "filesystem:/flyway/sql,filesystem:/flyway/seed,filesystem:/flyway/qa"
kafka-brokers: "kafka.kafka-cluster:9092"
kafka-infra-brokers: kafka-v2-infra.kafka-cluster:9092
logging-level-jdbc: "DEBUG"
mobile-validation-workaround: "true"
s3-assets-bucket: "(pg-egov-assets|egov-uat-assets)" ## Add s3-assets-bucket name
serializers-timezone-in-ist: "true"
server-tomcat-max-connections: "500"
server-tomcat-max-threads: "10"
sms-enabled: "true"
spring-datasource-tomcat-initialSize: "1"
spring-datasource-tomcat-max-active: "2"
spring-jpa-show-sql: "true"
timezone: Asia/Kolkata
tracer-errors-provideexceptionindetails: "true"
egov-service-host:
data:
billing-service: http://billing-service.egov:8080/
collection-services: http://collection-services.egov:8080/
collection-search-indexer: http://collection-search-indexer.egov:8080/
dashboard-analytics: http://dashboard-analytics.egov:8080/
dashboard-ingest: http://dashboard-ingest.egov:8080/
egov-common-masters: http://egov-common-masters.egov:8080/
egov-apportion-service: http://egov-apportion-service.egov:8080/
egf-master: http://egf-master.egov:8080/
egf-instrument: http://egf-instrument.egov:8080/
egov-accesscontrol: http://egov-accesscontrol.egov:8080/
egov-user: http://egov-user.egov:8080/
egov-location: http://egov-location.egov:8080/
egov-filestore: http://egov-filestore.egov:8080/
egov-localization: http://egov-localization.egov:8080/
egov-idgen: http://egov-idgen.egov:8080/
egov-otp: http://egov-otp.egov:8080/
egov-mdms-service: http://egov-mdms-service.egov:8080/
egov-mdms-create: http://egov-mdms-create.egov:8080/
egov-enc-service: http://egov-enc-service.egov:8080/
egov-workflow-v2: http://egov-workflow-v2.egov:8080/
egov-searcher: http://egov-searcher.egov:8080/
egov-data-uploader: http://egov-data-uploader.egov:8080/
egov-indexer: http://egov-indexer.egov:8080/
egov-hrms: http://egov-hrms.egov:8080/
es-client: http://elasticsearch-client-v1.es-cluster:9200
location: http://location.egov:8080/
property-services: http://property-services.egov:8080/
pt-calculator-v2: http://pt-calculator-v2.egov:8080/
pt-services-v2: http://pt-services-v2.egov:8080/
pdf-service: http://pdf-service.egov:8080/
report: http://report.egov:8080/
tl-services: http://tl-services.egov:8080/
tl-workflow: http://tl-workflow.egov:8080/
tl-calculator: http://tl-calculator.egov:8080/
user-otp: http://user-otp.egov:8080/
ws-calculator: http://ws-calculator.egov:8080/
ws-services: http://ws-services.egov:8080/
firenoc-services: http://firenoc-services.egov:8080/
firenoc-calculator: http://firenoc-calculator.egov:8080/
egov-user-event: http://egov-user-event.egov:8080/
sw-services: "http://sw-services.egov:8080/"
sw-calculator: "http://sw-calculator.egov:8080/"
bpa-services: "http://bpa-services.egov:8080/"
bpa-calculator: "http://bpa-calculator.egov:8080/"
rainmaker-pgr: "http://rainmaker-pgr:8080/"
egov-user-chatbot: "http://egov-user-chatbot:8080/"
zuul: "http://zuul:8080/"
nginx-ingress:
replicas: 1
controller:
image:
repository: egovio/nginx-ingress-controller
tag: "0.26.1"
default-backend-service: "egov/nginx"
namespace: egov
employee:
dashboard-url: "https://dashboard-pbuat.egovernments.org/s/w---s/app/kibana#/dashboard/4e687470-f3c7-11e8-8d09-b151e2b1cf8e?embed=true&_g=(refreshInterval%3A(pause%3A!f%2Cvalue%3A300000)%2Ctime%3A(from%3Anow-15m%2Cmode%3Aquick%2Cto%3Anow))"
custom-js-injection: |
sub_filter.conf: "
sub_filter '<head>' '<head>
<script src=https://s3.ap-south-1.amazonaws.com/egov-uat-assets/globalConfigs.js type=text/javascript></script>
';"
digit-ui:
custom-js-injection: |
sub_filter.conf: "
sub_filter '<head>' '<head>
<script src=https://s3.ap-south-1.amazonaws.com/egov-uat-assets/globalConfigs.js type=text/javascript></script>
';"
egov-persister:
replicas: 1
images:
- egovio/egov-persister
persist-yml-path: "file:///work-dir/configs/egov-persister/pt-mutation-calculator-persister.yml,file:///work-dir/configs/egov-persister/apportion-persister.yml,file:///work-dir/configs/egov-persister/billing-services-persist.yml,file:///work-dir/configs/egov-persister/egf-bill.yaml,file:///work-dir/configs/egov-persister/egov-user-event-persister.yml,file:///work-dir/configs/egov-persister/egov-workflow-v2-persister.yml,file:///work-dir/configs/egov-persister/firenoc_persiter.yaml,file:///work-dir/configs/egov-persister/hrms-employee-persister.yml,file:///work-dir/configs/egov-persister/pdf-generator.yml,file:///work-dir/configs/egov-persister/pg-service-persister.yml,file:///work-dir/configs/egov-persister/pgr.v3.yml,file:///work-dir/configs/egov-persister/property-services.yml,file:///work-dir/configs/egov-persister/pt-calculator-v2-persister.yml,file:///work-dir/configs/egov-persister/pt-drafts.yml,file:///work-dir/configs/egov-persister/pt-persist.yml,file:///work-dir/configs/egov-persister/tl-billing-slab-persister.yml,file:///work-dir/configs/egov-persister/tl-calculation-persister.yml,file:///work-dir/configs/egov-persister/uploader-persister.yml,file:///work-dir/configs/egov-persister/collection-migration-persister.yml,file:///work-dir/configs/egov-persister/property-services-registry.yml,file:///work-dir/configs/egov-persister/tradelicense.yml,file:///work-dir/configs/egov-persister/sewerage-persist.yml,file:///work-dir/configs/egov-persister/water-persist.yml,file:///work-dir/configs/egov-persister/water-meter.yml,file:///work-dir/configs/egov-persister/bpa-persister.yml,file:///work-dir/configs/egov-persister/assessment-persister.yml,file:///work-dir/configs/egov-persister/chatbot.yml,file:///work-dir/configs/egov-persister/land-persister.yml,file:///work-dir/configs/egov-persister/noc-persister.yml,file:///work-dir/configs/egov-persister/pgr-services-persister.yml,file:///work-dir/configs/egov-persister/pgr-migration-batch.yml, file:///work-dir/configs/egov-persister/vehicle-persister.yaml,file:///work-dir/configs/egov-persister/vendor-persister.yaml,file:///work-dir/configs/egov-persister/fsm-calculator-persister.yaml, file:///work-dir/configs/egov-persister/fsm-persister.yaml, file:///work-dir/configs/egov-persister/echallan.yml"
initContainers:
gitSync:
repo: "[email protected]:egovernments/configs"
branch: "quickstart"
zuul:
replicas: 1
memory_limits: "512Mi"
custom-filter-property: "false"
tracing-enabled: "true"
heap: "-Xmx256m -Xms256m"
server-tomcat-max-threads: "350"
server-tomcat-max-connections: "1500"
egov-open-endpoints-whitelist: "/user/oauth/token,/user-otp/v1/_send,/otp/v1/_validate,/user/citizen/_create,/localization/messages,/localization/messages/v1/_search,/user/password/nologin/_update,/pgr/servicedefinition/v1/_search,/pgr/servicecategories/v1/_search,/pgr/v1/otp/_send,/pgr-master/receivingmode/v1/_search,/tenant/v1/tenant/_search,/egov-location/boundarys,/egov-location/boundarys/boundariesByBndryTypeNameAndHierarchyTypeName,/pgr-master/service/v1/_search,/egov-location/boundarys/getLocationByLocationName,/pgr-master/OTPConfig/_search,/pgr-master/serviceGroup/v1/_search,/egov-location/boundarys/isshapefileexist,/pgr/services/v1/_search,/hr-masters/hrconfigurations/_search,/collection-services/receipts/_view,/pgr-master/service/v2/_search,/pgr-master/servicedefinition/v1/_search,/citizen-services,/citizen-services/v1/requests/receipt/_create,/citizen-services/v1/pgresponse,/citizen-services/v1/requests/anonymous/_search,/egov-mdms-service/v1/_search,/egov-mdms-service/v1/_get,/egov-mdms-service/v1/_reload,/egov-mdms-service/v1/_reloadobj,/egov-location/boundarys/getshapefile,/egov-indexer/index-operations/_index,/egov-indexer/index-operations/_reload,/egov-mdms-service-test/v1/_search,/egov-mdms-create/v1/_update,/egov-mdms-create/v1/_create,/egov-mdms-service-test/v1/_reload,/filestore/v1/files/url,/egov-url-shortening,/whatsapp-webhook/messages,/edcr/rest/dcr/downloadfile,/dashboard-ingest/ingest/upload"
egov-mixed-mode-endpoints-whitelist: "/pgr/seva/v1/_create,/pgr/seva/v1/_search,/pgr/seva/v1/_count,/workflow/history/v1/_search,/filestore/v1/files/id,/filestore/v1/files,/filestore/v1/files/tag,/egov-common-masters/departments/_search,/pt-property/property/propertytypes/_search,/pt-property/properties/_search,/pt-property/property/usages/_search,/egov-idgen/id/_generate,/egf-masters/financialyears/_search,/egov-common-workflows/process/_start,/egov-common-workflows/process/_search,/egov-common-workflows/tasks,/egov-common-workflows/tasks/{id}/_update,/user/_search,/billing-service/demand/_dues,/billing-service/bill/_generate,/billing-service/demand/_create,/wcms/masters/waterchargesconfig/_search,/wcms/masters/usagetypes/_search,/wcms/masters/pipesizes/_search,/wcms-connection/connection/_getbillingtypes,/wcms-connection/connection/_getconnectiontypes,/wcms/masters/sourcetypes/_search,/wcms/masters/supplytypes/_search,/wcms/masters/storagereservoirs/_search,/wcms/masters/treatmentplants/_search,/wcms/masters/documenttypes-applicationtypes/_search,/wcms/masters/donations/_search,/wcms/masters/nonmeterwaterrates/_search,/wcms-connection/connection/_create,/egov-common-masters/genders/_search,/egov-common-workflows/designations/_search,/access/v1/actions/mdms/_get,/tl-services/v1/BPAREG/_create,/tl-services/v1/BPAREG/_update,/tl-calculator/v1/BPAREG/_getbill,/property-services/property/_search,/billing-service/bill/v2/_search,/egov-location/location/v11/boundarys/_search,/pg-service/transaction/v1/_create,/collection-services/payments/_search,/pdf-service/v1/_create,/billing-service/bill/v2/_fetchbill,/pg-service/transaction/v1/_update,/ws-services/wc/_search,/sw-services/swc/_search,/edcr/rest/dcr/scrutinydetails,/edcr/rest/dcr/occomparison,/egov-pdf/download/PAYMENT/consolidatedreceipt"
4. Add the following entries in your host file /etc/hosts depending on your OS, instructions can be found below.
Add the following lines to the host file in your local machine. Save and close the file.
127.0.0.1 quickstart.local.digit
Those who are using Cloud VM/Instance - add the below entry to the host file in your local machine/laptop. Replace <Public_IP> with your VM/Instance Public IP.
- <Public_IP>
quickstart.local.digit
Once the deployment config is ready run the following command. Provide the necessary details and the interactive installer will take care of the rest.
- 1.Run the deployer go script from the following directory:
export KUBECONFIG=<path-to-your-kube_config>
cd DIGIT-DevOps/deploy-as-code/egov-deployer
sudo go run digit_setup.go
#Be prepared for the following questions
1. Are you good to proceed?
2. Please enter the fully qualified path of the kubeconfig file
3. Which DIGIT Version You would like to install, Select below
4. Select the DIGIT modules that you want to install, choose Exit to complete selection
5. Choose the target env files that are identified from your local configs
6. Are we good to proceed with the actual deployment?
All Done.
2. Check all the pods are running and ready using the below command
kubectl get pods -A
Note: If Kafka and zookeeper pods go into crashloopbackoff state due to a permission issue, use the below commands.
- For windows
- 1.cd D:\wsl chmod -R 777 kubekubectl delete pod kafka-0 -n kafka-cluster --kubeconfig=<your_kubeconfig_path>kubectl delete pod zookeeper-0 -n zookeeper-cluster --kubeconfig=<your_kubeconfig_path>
- For Linux/Mac
- 1.cd ~sudo chmod -R 777 kubekubectl delete pod kafka-0 -n kafka-cluster --kubeconfig=<your_kubeconfig_path>kubectl delete pod zookeeper-0 -n zookeeper-cluster --kubeconfig=<your_kubeconfig_path>
3. Test the Digit application status in the command prompt/terminal using the command below:
curl -Is http://quickstart.local.digit/employee/login | head -n 1
OutPut:
HTTP/2 200
Note: Initially the pgr-services are in crashloopbackoff state. After performing the Post Deployment steps below the pgr-services starts running.
Post-deployment the application is now accessible from the configured domain.
For initiating PGR employee login, create a sample tenant, city, user to login and assign LME employee role through the seed script.
- 1.Perform the kubectl port-forwarding of the egov-user service running from Kubernetes cluster to your localhost. This provides access to the egov-user service directly and allows the service to interact with the API.
kubectl port-forward svc/egov-user 8080:8080 -n egov
Output:
Forwarding from 127.0.0.1:8080 -> 8080
Forwarding from [::1]:8080 -> 8080
2. Seed the sample data
- Ensure you have the postman to run the following seed data API. If not, run the Install postman on your local machine.
- Import the following postman collection into the postman and run it. This has the seed data that enable sample test users and localisation data.


To test the Kubernetes operations through kubectl from the local machine, execute the below commands.
#get the pods running in the cluster
kubectl get pods -n egov
Output:
NAME READY STATUS RESTARTS AGE
citizen-79cf89659c-8glf4 1/1 Running 0 14d
egov-accesscontrol-78b78dddb9-tfbkf 1/1 Running 0 21d
egov-enc-service-574cd7b5b5-hmhh4 1/1 Running 0 36d
egov-idgen-84954b565b-xsnqj 1/1 Running 0 45d
egov-indexer-5f5fbb6f4b-58rtm 1/1 Running 0 43d
egov-localization-6cc5977bb9-gm7f9 1/1 Running 0 27d
egov-mdms-service-65d6d65d8c-t85d9 1/1 Running 0 21d
egov-user-6676968d76-8n6t6 1/1 Running 0 29d
egov-workflow-v2-5cdb96bcf5-dcgmf 1/1 Running 0 36d
employee-749464fbfb-tptlh 1/1 Running 0 14d
nginx-ingress-controller-b9678869c-mkslb 1/1 Running 0 49d
pgr-services-b9f4ffdbf-5h5kd 1/1 Running 0 38d
zuul-788bf8cd8b-9nxfl 1/1 Running 0 41d
#Delete the pods so that it gets restarted automatically
kubectl delete pods zuul-788bf8cd8b-9nxfl egov-workflow-v2-5cdb96bcf5-dcgmf pgr-services-b9f4ffdbf-5h5kd -n egov
Output:
pod "zuul-788bf8cd8b-9nxfl" deleted
pod "egov-workflow-v2-5cdb96bcf5-dcgmf" deleted
pod "pgr-services-b9f4ffdbf-5h5kd" deleted
This completes the setup of DIGIT Infra, deployment and installation of the DIGIT-PGR module.
Paste the below link in the browser.
quickstart.local.digit/employee
Use the below credentials to login into the complaint section:
Username: GRO
Password: eGov@4321
City: CITYA
Use the instructions below to destroy the setup once you are done exploring or experiencing the DIGIT platform using the quickstart approach.
k3d cluster list
OutPut
NAME SERVERS AGENTS LOADBALANCER
k3s-default 1/1 2/2 true
k3d cluster delete k3s-default
Deleting the cluster automatically deletes all the DIGIT deployment components and frees up the system resources.
Last modified 5mo ago