Groww's platform team built a single Crossplane Composition called xIdpLoadBalancer to abstract GCP load balancer provisioning. Since GCP load balancers are composed of many discrete resources (forwarding rules, target proxies, URL maps, backend services, health checks), teams previously had to manually stitch together the right combination. The Composition uses Go templating with boolean flags derived from user-specified dimensions (type, access, distribution, classic) to dynamically generate the correct GCP resource graph. A key lesson shared is the 'array index trap': using loop indices as Crossplane composition resource names causes silent configuration drift when array entries are removed. The fix is requiring a stable user-provided nameOverride field with a fail guard at render time. Additional features include an observe-only mode for zero-downtime migration of existing load balancers, per-backend management policies for cross-team ownership, and Helm-based validation that surfaces errors during local dry runs rather than at cluster reconciliation time.

6m read timeFrom tech.groww.in
Post cover image
Table of contents
Crossplane in 60 SecondsThe Problem with Raw Managed ResourcesThe Composition: Dynamic Resource GenerationThe Array Index Trap: A Hard Lesson LearnedGet Groww Engineering Team’s stories in your inboxThe Fix: Stable IdentifiersDynamic Backend Service GenerationAdvanced Features Built for ScaleConclusion
5.8K Impressions