You push a commit. FluxCD syncs it to your cluster. But when that deployment touches Google Cloud Spanner, permissions suddenly matter. Who’s allowed to migrate schemas or update credentials? If your infrastructure drifts from your access policies, you’re one bad merge away from a production headache.
FluxCD is GitOps for Kubernetes. It keeps your clusters aligned with the state defined in Git. Spanner is Google’s globally distributed relational database that never sleeps and rarely forgives mistakes. Pair them right and your database updates flow automatically, safely, and with steady confidence. Pair them wrong and you’ll spend Friday night rolling back IAM bindings.
The main challenge of using FluxCD with Spanner is that they live in separate control planes. Spanner operations require precise IAM roles and token lifetimes, while FluxCD expects continuous reconciliation. The trick is to bridge these worlds with identity-aware automation, not static service accounts that rot unseen.
In a solid FluxCD Spanner setup, each deployment operation should acquire credentials at runtime through OIDC federation or workload identity. FluxCD uses those credentials to apply database migrations or configuration updates only when policy allows it. No long-lived secrets. No guessing who last touched prod.
This pattern also keeps audit trails intact. Every change that FluxCD applies is versioned in Git and logged through Spanner’s audit records. Your compliance team gets traceability by default, not after the fact.
A quick answer:
You connect FluxCD and Spanner via identity federation. FluxCD runs under a Kubernetes service account bound to a Google IAM workload identity. That identity gets short-lived access to Spanner using OIDC, executes approved tasks, then expires cleanly. No permanent keys, no side channels.