Files
devops-lib-gcp/docs/wiki/pages/policy/multi-tenancy.md
T
2026-08-26 02:02:24 +05:30

51 lines
2.3 KiB
Markdown

<!-- m-wiki: type=concept slug=multi-tenancy topic=policy base-sha=28f54cf7bef9 generated-at=2026-05-12T00:00:00+00:00 sources=[] -->
> Generated 2026-05-12 at base-sha 28f54cf7bef9. Type: concept. 0 sources.
# Multi-Tenancy: BU and Team Mapping
Meesho's CI/CD pipeline partitions services by business unit (BU) and team. `buTeamMapping.groovy` translates full BU/team names to short initials used in Helm chart paths, Docker image paths, and ArgoCD namespaces.
## Where it applies in this repo
`src/com/meesho/utilities/buTeamMapping.groovy`
**`get_bu_initials(bu)`** maps full BU names to short abbreviations:
- `supply``su`, `demand``de`, `central``ce`, `dataengg``da`, `datascience``ds`, `mcache``mc`, `infra``in`
**`get_team_initials(team)`** maps team slug to a short initial (typically first 2-4 chars of the slug).
These initials are used to construct:
- Helm chart paths: `devops-helm-charts/<helmChartsPath>/<buIni>/<teamIni>/<app_name>/`
- ArgoCD app names: `<env>-<teamIni>-<app_name>` (or similar)
- ArgoCD namespace: `argocd-<bu>-prd` (GCP prd)
- GCPProject: `meesho-<bu>-prd-0622` (from `constructParam.run()`)
**`config.yaml` fields:**
- `bu`: must be one of the valid BU values (`supply`, `demand`, `central`, `dataengg`, `datascience`, `mcache`, `infra`).
- `team`: must match a known team slug in `buTeamMapping`.
- `validateBuTeam.groovy` in `src/com/meesho/stages/` validates the BU/team combination before deployment.
## Why this design
Multi-tenancy isolation is enforced structurally — a `supply` service's Helm values live in a separate directory from `demand`. If a service mis-declares its BU, its Helm charts and ArgoCD apps land in the wrong directory hierarchy, which causes the deploy to fail or overwrite another team's app. The initials mapping abstracts this from individual service owners.
## Related
- [Config policy](../06-CONFIG-POLICY.md) — bu/team are required fields in config.yaml
- [Deploy ArgoCD](../04-DEPLOY-ARGOCD.md) — buini/teamini used in helm path construction
## Sources
(no raw/ sources at bootstrap)
## Notes
<!-- Anything below is human-owned. wiki-init never reads or modifies content under this heading. -->
---
[← Wiki index](../../index.md)
<!-- atomic: keep this page ≤600 words. New scope → new concept page that builds on this one. Do not append paragraphs here. -->