Visual map
Skim this page first. Each diagram is one idea. Captions are short on purpose.
Want the repo-by-repo detail? Four repos · Creating things
The three flows to learn first: request · ship · data / CDC. Plus infra change and the cloud tree. Each diagram has a short “when to look” note.
0. Cloud layout
What: One tree of the AWS account as we actually run it. When to look: first hour on the team. Notice: perf is a namespace under develop’s cluster, not a third account. WAF/CloudFront certs are us-east-1; the VPC is eu-west-2.
Interactive: C4 workspace · narrative: Overview
1. The whole system
What: Four Git repos around one region. When to look: after the cloud tree, before diving into a single hop.
Four repos. One AWS region (eu-west-2). Traffic in from the left, code in from the top.
Overview · Provisioning · Compute & deploy
2. A user request
The browser never talks to a Kubernetes pod. DNS for bigbash.site / bigbash.life points at CloudFront. WAF is attached to that distribution (it must live in us-east-1). After WAF, CloudFront either serves a cached file from S3 or forwards into the VPC.
Hop by hop
- DNS — Prod:
bigbash.site(B2C),admin.bigbash.site(B2B),gateway-prod.bigbash.site(APIs). Develop/perf: same three roles onbigbash.lifewith-develop/-perf. ExternalDNS keeps Route53 in sync from HTTPRoute hostnames. - WAF — Rate limits (gateway vs B2C vs B2B, auth vs anonymous, global ceiling), AWS managed rules, optional maintenance kill-switch. COUNT = log only (develop/prod today). BLOCK = enforce (perf). A 403 here never reached Traefik.
- CloudFront — Terminates TLS. Path
/B2C/images/*and/B2B/images/*go to S3 + OAC. Everything else is a VPC origin to an internal NLB (not on the public internet). - Traefik CloudFront — In namespace
traefik-cloudfront. Gateway APIHTTPRoutematches host + path (example:gateway-prod.bigbash.site/frontmarket→ FrontMarket). A second Traefik (traefik-external) is for Grafana and tools, not this public product path. - Pod — ClusterIP Service. Reads Aurora and/or Valkey. Response goes back the same way. There is no service mesh.
If this hop fails, see Networking. Interactive C4: Infra — Request path.
3. A code change
Nobody kubectl applys product apps. The service repo calls reusable workflows. Those workflows push an image and commit a tag in GitOps. Argo CD is the only thing that talks to the Kubernetes API for that deploy.
Hop by hop
- Push —
main→ develop,performance→ perf,release/vX.Y.Z→ prod. Manual deploys also check branch +infra-team. - Qualify —
sonar.yml+trivy-fs-scan.yml(+ lint).quality-gate.ymlsetsproceed. A reusable-workflow crash must not hide other checks — keep extra tests in a sibling workflow. - Build —
extract-version.ymlmakes tagV{run}-{semver}(neverlatest).build-docker-image.ymlBuildx + image scan;push-ecr-image.ymlwrites{service}-{develop|perf|prod}in ECReu-west-2. - GitOps —
update-helm-charts.ymlsetsdeployment.image.taginhelm-overrides/fantasy7-<env>/<service>/custom-values.yaml(rebase retry if two ships collide). - Argo CD — ApplicationSet already points that folder at chart
helm-templates/1.0.0. It syncs the Deployment indevelopment/performance/production. Rollback = revert that GitOps commit, notkubectl rollout undo.
Settlement Lambdas skip this path (build-lambda.yml / SAM). C4: Infra — Ship path.
Compute & deploy · Environments · Creating things
4. Where code runs
Perf is not a third AWS account. It is a namespace on the develop cluster, plus a few overlay stacks.
5. How AWS is built
tf-modules = recipe. rfetech-infra = this environment's sizes. GitOps = what runs on the cluster after the seed exists.
Develop = many small folders. Perf = overlays only. Prod = one core stack + k8s/.
6. Inside the VPC
Public subnet: NAT + SSM bastion only. Data stores have no public IP.
7. Data plane
Synchronous work is SQL + cache. Asynchronous work is Kafka. Three services also write an outbox table in the same Postgres transaction as the business row. Debezium (MSK Connect) copies those rows to Kafka so consumers like DataAggregator never poll OLTP.
Hop by hop
- API — e.g. BettingEngine writes the bet and an
outbox_eventsrow in one transaction on aurora main (database/schema per service). - Debezium — Connector
{env}-{service}-outbox-connectorfor userservice, bettingengine, casinomanagement. Plugin ZIP on env S3. Needsrds.logical_replication=1. - MSK — Topics are Terraform, prefix
develop_*/perf_*on sharedrfe-kafka,prod_*on prod. Families includebet_placed,market_settlement,user_sync, plusfailed_*anddlq_*twins. Apps do not auto-create topics. - Consumer — DataAggregator reads Kafka and writes aurora-da. Other consumers subscribe to domain topics BettingEngine produces directly (not only CDC).
- Cache / bus — Valkey is odds, sessions, pub/sub (cluster-mode). EventBridge
bus_{env}is market-closure style events, not the main bet bus. - Sharing — Perf shares develop Aurora + MSK (different topic prefix + own Debezium + own Valkey). Prod shares nothing.
C4: Infra — Data plane. Detail: Data stores.
8. GitOps on the cluster
Two roots per environment. Left = platform. Right = BigBash services.
9. Secrets
What: How pods get DB/Kafka/Valkey settings. When to look: CrashLoop on mount, or a new env key. Detail: IAM & secrets.
Credentials never live in Helm values. Config Manager builds one Secrets Manager document. CSI mounts it into the pod.
10. Observability
Groundcover is the cloud default. Sentry is errors. Prometheus is HPA CPU/memory. Local is GlitchTip + optional OTel.
11. Local vs cloud
Same services. Different everything else.
12. Where to edit
What: Decision tree for which GitHub repo owns the change. When to look: before you open a PR. Full table: Where to change.
13. An infrastructure change
What: How Terraform or GitOps reaches AWS/the cluster. When to look: you are not shipping an app image. Notice: prod Terraform is the manual github-aws-int.yaml workflow (workflow_dispatch) with infra-team approval. Image-only deploys skip this — they are flow 3.
Infra code → PR → review → CI (plan / helm-validate)
→ develop: apply in the leaf folder, or merge GitOps for Argo
→ prod: github-aws-int.yaml (workflow_dispatch: plan → approval → apply) or GitOps + infra-team
→ Cloud / clusterHop-by-hop: Changes. C4: Infra — Kubernetes compute (nodes) · Infra — Ship path (apps).