The Simplest Way to Make Crossplane and Firestore Work Like They Should
Using crossplane and firestore together lets teams manage cloud document databases from Kubernetes. This pair turns database setup into plain files that live in version control. App teams ask for a new database by writing a short request file. The cluster reads that file and builds the database in Google Cloud. Developers get the storage they need without clicking through cloud menus. How crossplane and firestore handle keys and data flow Crossplane runs inside your Kubernetes cluster as a s
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
Using crossplane and firestore together lets teams manage cloud document databases from Kubernetes. This pair turns database setup into plain files that live in version control.
App teams ask for a new database by writing a short request file. The cluster reads that file and builds the database in Google Cloud. Developers get the storage they need without clicking through cloud menus.
How crossplane and firestore handle keys and data flow
Crossplane runs inside your Kubernetes cluster as a set of control loops. It watches for custom resource files that describe the cloud tools you want. When it sees a request for Firestore, it talks to the Google Cloud API.
To make this call, the cluster controller needs a Google Cloud identity. Most teams link a Kubernetes service account to a Google Cloud service account. Workload identity federation lets the cluster log in without saving static key files.
Once the controller logs in, it checks the current state of the database. If the database does not exist yet, the controller sends a build request. It sets the region, the mode, and the security rules from your file.
Data for your apps does not flow through the Crossplane controller itself. Instead, the controller creates the database and sets up the right access roles. Your app pods then talk directly to the Google Cloud endpoints to read and write documents.
Common failure modes and how to scope roles
Many teams start by giving the cluster controller a broad project owner role. That choice makes early testing fast, but it creates a huge security risk. Anyone who can write a resource file in the cluster can now change anything in the cloud project.
Shared service accounts cause a second big problem for platform teams. When ten apps use the same cloud identity, audit logs become useless. You cannot tell which team or pod ran a bad query or deleted a collection.
Crossplane Composition Security + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Unlogged queries from local laptops add even more risk during daily work. Engineers often pull down service account keys to debug live document data. Those keys sit on laptops and give wide access to customer records like emails and phone numbers.
To fix this, split the build role from the runtime app role. Give the Crossplane controller only the permission to create and update Firestore instances. Never let the controller identity read or write the actual documents inside the database.
Next, create a separate cloud identity for each app that uses the database. Use Crossplane compositions to build both the database and a dedicated role for that one app. Lock down network paths with private Google access so traffic stays off the public internet.
Managing day two data checks and schema updates
Building the database is only the first step for a platform team. Once the app goes live, engineers still need to check document structures and fix bad records. Crossplane handles the cloud resource, but it does not manage human queries inside the collections.
Teams should avoid giving developers permanent cloud console roles for production projects. Instead, keep all resource changes in Git so the cluster controller applies them. For direct data checks, require named user logins and mask fields like card numbers or national IDs in results.
This split keeps your setup clean and stops config drift over time. The cluster owns the cloud setup, and strict access rules govern human data checks.
Add runtime guardrails and masking beside your databases and APIs
Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.
Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.
Frequently asked questions
Does Crossplane store my Firestore documents inside Kubernetes?
No, it only stores the setup files that describe your database instance. Your actual documents stay inside Google Cloud storage at all times.
How should my cluster controller log in to Google Cloud?
Use workload identity federation to link your cluster service account to a Google Cloud identity. This method avoids long-lived JSON key files that can leak.
What happens if someone changes a Firestore setting in the cloud console?
The Crossplane controller checks the cloud state on a regular loop. It will spot the manual change and overwrite it to match your Git file.
Related guides
In this post