mGramSeva Quickstart, this is not for a production
Quickstart Installation helps you jump-start with the mGramSeva basic installation with limited functionalities.
mGramSeva is a distributed microservice-based platform that comprises many services that are containerized. Depending upon the required features, the specific services can be run on any container-supported orchestration platform like docker-compose, Kubernetes, etc.
The Quickstart guide covers the installation steps for basic services to get the platform up. Before setting up mGramSeva, create a lightweight Kubernetes cluster called k3d on a local machine with specified H/W requirements. The H/W requirements are listed below to ensure before we proceed further.
To provision a lightweight Kubernetes cluster, please follow the instructions below in context to your OS and install the k3d on your machine.
- min 4 vCPUs (recommended 8)
- min 8GiB of RAM (recommended 16)
- min 30GiB of HDD (recommended 30+)
- Windows 10 or above
choco install k3d
- Open gitbash and Install k3d on Windows using the below command
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 data from all container logs will be stored here.
chmod 777 /kube
#if you are unable to create the /kube folder in the root
# you can create it your user directory and provide the absolue path below
- Create a cluster with a single master node and 2 agents (Worker Nodes) and mount the pre-created directory (for data persistence).
- When cluster creation is successful, get the kubeconfig file, that allows you to connect to the cluster at any time.
k3d kubeconfig get k3s-default > k3dconfig
kubectl config use-context k3d-k3s-default --kubeconfig=k3dconfig
- 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
[email protected]:/# kubectl cluster-info
Kubernetes control plane is running at https://0.0.0.0:33931
CoreDNS is running at https://0.0.0.0:33931/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
Metrics-server is running at https://0.0.0.0:33931/api/v1/namespaces/kube-system/services/https:metrics-server:/proxy
[email protected]:/# k3d cluster list
NAME SERVERS AGENTS LOADBALANCER
k3s-default 1/1 2/2 true
- You can verify the workers' nodes created by using the following command.
kubectl get nodes
NAME STATUS ROLES AGE VERSION
k3d-k3s-default-agent-0 Ready <none> 3d18h v1.21.1+k3s1
k3d-k3s-default-agent-1 Ready <none> 3d18h v1.21.1+k3s1
k3d-k3s-default-server-0 Ready control-plane,master 3d18h v1.21.1+k3s1
kubectl top nodes
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
NAME CPU(cores) CPU% MEMORY(bytes) MEMORY%
k3d-k3s-default-agent-0 547m 6% 1505Mi 9%
k3d-k3s-default-agent-1 40m 0% 2175Mi 13%
k3d-k3s-default-server-0 59m 0% 2286Mi 14%
Once the above steps are completed successfully, your Cluster is now up and running ready to proceed with the DIGIT Deployment.
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:
- mGramSeva core platform services
After cloning the repo CD into the folder iFix-DevOps and type the "code ." command that will open the visual editor and opens all the files from the repo iFix-DevOps
Once the prerequisite setup is complete, go to the following repo, run the command and follow the instructions.
[email protected]:# cd iFix-DevOps/deploy-as-code/egov-deployer
[email protected]:# go run mgramseva_setup.go
#Be prepared for the following questions
1. Do you have the Kubernetes Setup?
2. Provide the path of the intented env kubeconfig file
3. Which version of the DIGIT that you want to install - Choose "Quickstart"
4. What mGremSeva Modules that you choose to install
5. All, done, Now do you want to preview the deployment manifests
6. Are you good to proceed with the DIGIT Installation
You can now test the DIGIT application status in the command prompt/terminal by using the below command.
curl -Is http://quickstart.local.digit/employee/login | head -n 1HTTP/2 20