Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Steps involved in eGov Deployment - Starter Kit

  1. Create Kubernetes Cluster

    1. Local Development K8S Cluster: Use development support environment for creating Kubernetes Cluster. Eg : Minikube.

    2. Cloud Native K8S Cluster Services: Use Cloud Services to create Kubernetes Cluster. Eg : AWS EKS Service.

    3. On-Premise K8S Cluster: Create your own Kubernetes Cluster with the help of master and worker nodes.

    4. K8s Cluster Requirement

      1. Cloud native kubernetes engine like AKS,

...

      1. or EKS or GKE from AWS or Azure or GCP respectively

        • 6 k8s Nodes- m4large with each 16GB RAM and 4 vCore CPUs
      1. On-Prem/Data Center or custom 

        • 1 Bastion- t2micro (Gateway) 2GB RAM 1vCore CPU

        • 3 k8s Master- t2medium 4 GB RAM 2 vCore CPU

        • 6 k8s Nodes with each 16GB RAM and 4 vCore CPUs

  1. DB Setup

    1. Use managed RDS Service with PostGres if you are using AWS, Azure or GCP

    2. Else provision a VM with PostGres DB and attach external volumes

  2. Create Production ready Application

...

eGov Platform Services 

...

  1. Services Lists

    1. Infra Services - Dashboard, Kibana, Telemetry, Logging

    2. Backbone
      1. Infra: Elastic Search HA Cluster, Kafka HA Cluster, Zookeeper HA Cluster, Redis, Kafka Connect, Kibana, ES Curator
      2. Business: Elastic Search HA Cluster, Kafka HA Cluster, Zookeeper HA Cluster, Kafka Connect, Kibana, ES Curator
    3. eGov Platform Services

      1.  

    1. Municipal Services
      1. Public Grievance Redressal System
      2. Property Tax System
      3. Trade License System
      4. Accounting System
      5. Water & Sewerage Management
      6. Dashboards
      7. Fire No Objection Certificate (NoC)
    2. Frontend

      1. Web Citizen, Employee, etc

...

Infra Services - Dashboard, Kibana, Telemetry, Logging

...

DB Setup

  • Use managed RDS Service with PostGres if you are using AWS, Azure or GCP

  • Else provision a VM with PostGres DB

...

  1. Keep data on volumes, Create persistant volums
    1. In care of Kubernetes volume, when a pod is deleted, all the data is lost too.
    2. Thus, we use Persistent Volumes, which will keep the data even if a pod is spawned.
    3. It stores the data on our local storage.
    4. eg: There is a Persistent Volume for elastic searchl. So, if the data inside the database will increase, the size of the local storage will also be needed to be increased.
    5. Thus, it is a best practice to keep database outside the kubernetes cluster.
  2. Setup Registry for build libraries & docker images

    1. Create central container registry such as AWS EKS or Gitlab Registry or DockerHub or Artifactory.

    2. CI Tools will push the container image to the central container registry.

    3. Here we are using Nexus, DockerHub as shared repositories.

  3. Setup CI

    1. Create and configure shared repository for Continuous Push, Commit, etc.

...

    1. Setup CI like Jenkins and create the Job that creates a pipeline from the JenkinsFile.
    2. Platform services can be referred and forked from https://github.com/egovernments/egov-services

Setup CD Tool

    1. Install and configure continuous deployment tools for automatic build and test.

    2. Builds are created from the Build management scripts, written inside InfraOps GitHub Repo

...

    1. (Private).

    2. With every deployment, a new container is deployed which saves the overhead of doing manual configurations.
    3. We can run pre-built and configured components in containers as a part of every release. 
    4. We provide all the kubernetes cluster configurations through .yaml files, which is usually called as the desired state of the cluster.
    5. Kubernetes offers autoscaling of workload based on CPU utilisation and memory consumption.
    6. Kubernetes allows vertical scaling-increasing the no. Of CPU’s for pods and horizontal scaling-increasing the no. of pods.
  1. Setup CI/CD Pipeline

    1. We are using Jenkins/Spinnaker as CI/CD Tool.

...

Create central container registry such as AWS EKS or Gitlab Registry or DockerHub or Artifactory. CD Tools will push the container image to the central container registry.

    1.                      


Http Traffic/Routing:


  

Kubernetes Cluster Provisioning 

...

  1. Choose your cloud provider (Azure, AWS, GCP or your private)

  2. Choose to go with the cloud provider specific Kubernetes Managed Engine like AKS, EKS, GKE

  3. Follow the Cloud provider specific instruction to create a Kubernetes Cluster (stable version 1.11 and Beyond) with 5 to 6 worker nodes with 16GB RAM and 4 vCore CPU (m4.xlarge)

  4. PostGres DB (Incase of AWS, Azure, GCP use the RDS) and have the DB server and the DB Credentials details.

  5. Provision the disk volumes for Kafka, ES-Cluster and ZooKeeper as per the below baselines and gather the volume ID details.

  6. Install Kubectl on DevOps local machine to interact with the cluster, setup kubeconfig with the allowed user credentials.

AKS on Azure

...

    1. Sample volumes to be provisioned

Image Modified

      

      2. Private Cloud - Manually setup Kubernetes Cluster:

  • Create a VPC or Virtual Private Network with multi availability zones 
  • Provision the Linux VMs with any Container Optimised OS (CoreOS, RHEL, Ubuntu, Debian, etc) within the VPC Subnet.

  • Provision 1 Bastion Host that acts as proxy server to Kubernetes cluster Nodes.

  • 3 Master Nodes with 4 GB RAM 2 vCore CPU

  • 6 worker nodes with 16GB RAM and 4 vCore CPU

  • PostGres DB (Linux VM)

  • Provision the disk volumes for Kafka, ES-Cluster and ZooKeeper as per the below baselines and gather the volume ID details.

  • Create LoadBalancer or Ingress to talk to Kube API server that routes the external traffic to the services deployed on cluster.
  • Setup AuthN & AuthZ. 
  • Install Kubectl on DevOps local machine to interact with the cluster, setup kubeconfig with the allowed user credentials


       Useful Step-By-Step Links:    




            




Deployment Architecture:

...

  • Python based Deployment script that reads the value from the Jinja 2 template and deploys into the cluster.       

  • Each env will have one Jinja Template that will have the definition of services to be deployed, their dependancies like Config, Env, Secrets, DB Credentials, Persistent Volumes, Manifest, Routing Rules, etc..

 

      




Cluster/Service Monitoring 

...