How mosip/mosip-infra works
This repository is a deployment/infrastructure repository for MOSIP – the open-source platform for identity management – that provides the scripts, playbooks, Helm charts, and utilities to deploy, configure, and manage MOSIP in both sandbox and production environments. In other words, it is not the application’s business logic per se but rather the “glue” that automates and coordinates the deployment of various MOSIP microservices and external dependencies.
Main Components
• Deployment Orchestration: This includes the Ansible playbooks (in the “deployment/sandbox‑v2” directory and various “roles” sub‑directories), Terraform scripts (in the “deployment/terraform” folder), and pre‑/post‑install scripts.
• Helm Charts and Kubernetes Manifests: There are thousands of Helm charts under directories like “deployment/sandbox‑v2/helm/charts”, “deployment/v3” (which cover specific components like config‑server, keycloak, identity modules, and many microservices such as admin, artifactory, ida, idrepo, print, etc.), all of which deploy the MOSIP microservices into K8s clusters.
• External Services Integration: There is a clear separation of “external” subdirectories (e.g., “deployment/v3/external”) that provide deployment scripts and Helm configurations for systems such as keycloak (for IAM), elasticsearch, Kafka, hsm/softhsm, Minio/object-store, and others.
• Utility and Management Tools: The “utils” directory holds several helper scripts (from interacting with master data to managing on‑boarding and secrets) demonstrating support functions that link deployment actions with monitoring, logging, and configuration management.
• Environment-specific Profiles: There are directories for different environment setups (sandbox and production), which show that the deployment pipeline supports multiple profiles, thereby influencing availability and resilience patterns.
Relationships and Interactions
• Kubernetes layer where Helm charts are used to deploy the required MOSIP microservices – each microservice (for instance, “mosip/config‑server”, “mosip/idrepo”, “mosip/ida”, etc.) becomes a separate deployment unit within the cluster.
• External dependencies that get integrated during deployment. For example, external systems like Kafka, keycloak, and object storage are deployed/configured by additional scripts and charts in the “deployment/v3/external” folder.
• Out interactions such as:
○ Playbooks triggering helm chart installations.
○ Helm charts interacting with the Kubernetes API.
○ Utility scripts (in the “utils” folder) that extract, compare, or update configuration properties.
○ Terraform scripts provisioning underlying infrastructure (e.g., AWS in “deployment/terraform/aws”).
Architectural Patterns and Design Principles
• Microservices Architecture: Each MOSIP component is deployed as a separate microservice, coordinated by Helm charts.
• Infrastructure as Code (IaC): The presence of Terraform along with Ansible and Helm emphasizes a full “declarative” approach to provisioning and configuration.
• Environment Segregation: There are distinct directories for sandbox vs. production profiles, highlighting best practices in isolation and configuration management.
• Extensibility and Modularity: With components separated into discrete Helm charts and Ansible roles, the design strongly adheres to modular design principles.