Quickstart
Quickstart Installation helps you jump start with the DIGIT basic installation steps with the limited functionalities.
DIGIT is a distributed microservice-based platform that comprises many services which are containerized, depending upon the required features we can run only those services on any container supported orchestration platform like docker compose, Kubernetes, etc.
Here in this Quickstart guide we'll install basic services to get the platform up and running along with the PGR module, before we setup DIGIT, we'll create a lightweight Kubernetes cluster called k3d on a local machine with specified H/W requirement. The H/W requirements are listed below to ensure before we proceed further.

1. Infra Setup

To provision a lightweight Kubernetes cluster, please follow the instructions below in context to your OS and install the k3d on your machine.

H/W or VM Size

  • min 4 vCPUs (recommended 8)
  • min 8GiB of RAM (recommended 16)
  • min 30GiB of HDD (recommended 30+)

Tools

  • Linux distribution running in a VM or bare metal
    • Ubuntu 18.04 or Debian 10 (VM or bare metal)
    • Install Docker
    • Install kubectl on Linux
    • Open terminal and Install k3d on Linux using the below command
    1
    wget -q -O - https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash
    Copied!
  • OSX or Mac
    1
    brew install k3d
    Copied!
  • Windows 10 or above
    1
    choco install k3d
    Copied!

Infra (Kubernetes Cluster) Creation

Once the above prerequisites are met, run the following tasks depending upon your OS.
  • ****login/ssh into the machine, go to terminal/command prompt and run the following commands as an admin user.
  • Create /Kube directory and change permission. To use this directory for persistent data mount. This means all the container logs, data will be stored here.
1
mkdir /kube
2
chmod 777 /kube
3
4
#if you are unable to create the /kube folder in the root
5
# you can create it your user directory and provide the absolue path below
Copied!
  • Create a cluster with a single master node and 2 agents (Worker Nodes) and mount the pre**-**created directory (for data persistence).
1
k3d cluster create --k3s-server-arg "--no-deploy=traefik" --agents 2 -v "/kube:/[email protected][0,1]" -v "/kube:/[email protected][0]" --port "80:[email protected]"
Copied!
  • When cluster creation is successful, Get the kubeconfig file, which will allow you to connect the to the cluster at any time.
1
k3d kubeconfig get k3s-default > k3dconfig
2
kubectl config use-context k3d-k3s-default --kubeconfig=k3dconfig
Copied!
  • Verify the Cluster creation by running the following commands from your local machine where the kubectl is installed. It gives you the sample output as below
1
[email protected]:/# kubectl cluster-info
2
3
OutPut:
4
Kubernetes control plane is running at https://0.0.0.0:33931
5
CoreDNS is running at https://0.0.0.0:33931/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
6
Metrics-server is running at https://0.0.0.0:33931/api/v1/namespaces/kube-system/services/https:metrics-server:/proxy
7
8
9
10
[email protected]:/# k3d cluster list
11
NAME SERVERS AGENTS LOADBALANCER
12
k3s-default 1/1 2/2 true
Copied!
  • You can verify the workers' nodes created by using the following command.
1
kubectl get nodes
2
3
Output:
4
NAME STATUS ROLES AGE VERSION
5
k3d-k3s-default-agent-0 Ready <none> 3d18h v1.21.1+k3s1
6
k3d-k3s-default-agent-1 Ready <none> 3d18h v1.21.1+k3s1
7
k3d-k3s-default-server-0 Ready control-plane,master 3d18h v1.21.1+k3s1
8
9
10
kubectl top nodes
11
12
Output:
13
W0625 07:56:24.588781 12810 top_node.go:119] Using json format to get metrics. Next release will switch to protocol-buffers, switch early by passing --use-protocol-buffers flag
14
NAME CPU(cores) CPU% MEMORY(bytes) MEMORY%
15
k3d-k3s-default-agent-0 547m 6% 1505Mi 9%
16
k3d-k3s-default-agent-1 40m 0% 2175Mi 13%
17
k3d-k3s-default-server-0 59m 0% 2286Mi 14%
18
Copied!
If the above steps are completed successfully, your Cluster is now up and running ready to proceed with the DIGIT Deployment.

2. DIGIT Setup

Now that we have the Infra setup to proceed with the DIGIT Deployment. Following are the tools that need to be installed on the machine before proceeding with the DIGIT Services deployment.
What we'll deploy in Quickstart:
  • DIGIT's core platform services
  • PGR

Prerequisites

  1. 1.
    DIGIT uses golang (required v1.13.3) automated scripts to deploy the builds on to Kubernetes - Linux or Windows or Mac
  2. 2.
    All DIGIT services are packaged using helm charts
    Installing Helm
  3. 3.
    kubectl is a CLI to connect to the kubernetes cluster from your machine
  4. 4.
    Install CURL for making api calls
  5. 5.
    Install Visualstudio IDE Code for better code/configuration editing capabilities
  6. 6.
    All the DIGIT services deployment configurations are in GitRepo which you would need to install git and then git clone it to your local.
  7. 7.
    Install Postman to run some digit bootstrap scripts
1
[email protected]:/# git clone -b quickstart https://github.com/egovernments/DIGIT-DevOps
Copied!
  1. 1.
    After cloning the repo CD into the folder DIGIT-DevOps and type the "code ." command that will open the visual editor and opens all the files from the repo DIGIT-DevOps
1
[email protected]:/# cd DIGIT-DevOps
2
[email protected]:DIGIT-DevOps# code .
Copied!
  1. 1.
    Have look at the sample deployment config file that needs to be configured as per any specific values according to your needs. (For a quick start you can run as it is)
1
https://github.com/egovernments/DIGIT-DevOps/blob/quickstart/deploy-as-code/helm/environments/quickstart-config.yaml
Copied!
  1. 1.
    Add the following entries in your host file /etc/hosts depending on your OS, instructions can be found here.
1
127.0.0.1 quickstart.local.digit
Copied!

Deployment

Once all the prerequisites set up is complete, go to the following repo, run the command and follow the instructions.
1
[email protected]:# cd DIGIT-DevOps/deploy-as-code/egov-deployer
2
3
[email protected]:# go run digit_setup.go
4
5
#Be prepared for the following questions
6
1. Do you have the Kubernetes Setup?
7
2. Provide the path of the intented env kubeconfig file
8
3. Which version of the DIGIT that you want to install - Choose "Quickstart"
9
4. What DIGIT Modules that you choose to install
10
5. All, done, Now do you want to preview the deployment manifests
11
6. Are you good to proceed with the DIGIT Installation
12
13
All Done.
Copied!
You can now test the Digit application status in command prompt/terminal by using the below command.
1
curl -Is http://quickstart.local.digit/employee/login | head -n 1
2
HTTP/2 200
Copied!

3. Post Deployment Steps

Post deployment, now the application will be accessible from the configured domain.
To try out PGR employee login, Lets create a sample tenant, city, user to login and assign LME employee role through the seed script
  1. 1.
    We have to do the kubectl port-forwarding of the egov-user service running from kubernetes cluster to your localhost, this will now give you access to egov-user service directly and interact with the api directly.
1
kubectl port-forward svc/egov-user 8080:8080 -n egov
2
Forwarding from 127.0.0.1:8080 -> 8080
3
Forwarding from [::1]:8080 -> 8080
Copied!
  1. 1.
    Seed the sample data
  • Ensure you have the postman to run the following seed data api, if not Install postman on your local
  • Import the following postman collection into the postman and run it, this will have the seed data that enable sample test users and localisation data.
To test the kubernetes operations through kubectl from you local machine, please execute the below commands.
1
#get the pods running in the cluster
2
kubectl get pods -n egov
3
4
Output:
5
6
NAME READY STATUS RESTARTS AGE
7
citizen-79cf89659c-8glf4 1/1 Running 0 14d
8
egov-accesscontrol-78b78dddb9-tfbkf 1/1 Running 0 21d
9
egov-enc-service-574cd7b5b5-hmhh4 1/1 Running 0 36d
10
egov-idgen-84954b565b-xsnqj 1/1 Running 0 45d
11
egov-indexer-5f5fbb6f4b-58rtm 1/1 Running 0 43d
12
egov-localization-6cc5977bb9-gm7f9 1/1 Running 0 27d
13
egov-mdms-service-65d6d65d8c-t85d9 1/1 Running 0 21d
14
egov-user-6676968d76-8n6t6 1/1 Running 0 29d
15
egov-workflow-v2-5cdb96bcf5-dcgmf 1/1 Running 0 36d
16
employee-749464fbfb-tptlh 1/1 Running 0 14d
17
nginx-ingress-controller-b9678869c-mkslb 1/1 Running 0 49d
18
pgr-services-b9f4ffdbf-5h5kd 1/1 Running 0 38d
19
zuul-788bf8cd8b-9nxfl 1/1 Running 0 41d
20
21
22
#Delete the pods so that it gets restarted automatically
23
24
kubectl delete pods zuul-788bf8cd8b-9nxfl nginx-ingress-controller-b9678869c-mkslb -n egov
25
26
Output:
27
28
pod "zuul-788bf8cd8b-9nxfl" deleted
29
pod "nginx-ingress-controller-b9678869c-mkslb" deleted
Copied!
You have successfully completed the DIGIT application setup. You can now experience the DIGIT platform - PGR module.
You can try experimenting the different DIGIT modules by installing them in your cluster with your H/W or VM complying to higher level machine configuration of increased number of vCPUs. RAM and storage size.
Last modified 3mo ago