The Simplest Way to Make Crossplane and Drone Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Crossplane and Drone work together to automate cloud resource builds from your code pipelines. Drone runs tests and sends resource manifests to Kubernetes, where Crossplane builds the cloud services. This workflow lets product teams ask for databases, buckets, and queues through Git commits. Platform teams set the rules, and the pipeline runs the changes after a code review. How crossplane and drone share keys and data In this setup, Drone acts as the trigger and Crossplane acts as the build

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.

Crossplane and Drone work together to automate cloud resource builds from your code pipelines. Drone runs tests and sends resource manifests to Kubernetes, where Crossplane builds the cloud services.

This workflow lets product teams ask for databases, buckets, and queues through Git commits. Platform teams set the rules, and the pipeline runs the changes after a code review.

How crossplane and drone share keys and data

In this setup, Drone acts as the trigger and Crossplane acts as the builder. A developer pushes a manifest file to a Git repo to start the process.

Drone reads this commit and starts a new pipeline run inside a runner pod. To talk to the cluster, the runner needs a valid Kubernetes service account key.

Teams store this key in the Drone secret store or fetch it during the run. The pipeline step then sends the manifest to the Kubernetes API server.

Crossplane watches the cluster API for these custom resource requests. When a new request arrives, Crossplane reads its own cloud provider keys to build the service.

Data flows back into the cluster as Crossplane writes new database passwords into Kubernetes secrets. Your app pods then read those secrets to log in to the new cloud resource.

Common failure modes and how to scope roles

Many teams fail by giving the Drone runner a single cluster admin token. If a bad actor compromises a pipeline script, they gain full control over every cloud account.

Shared service accounts also ruin your audit logs. When ten pipelines use one key, you cannot tell which commit changed a production database.

Crossplane Composition Security + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Another common issue is unlogged queries and secret sprawl across build steps. If a pipeline prints cluster secrets to build logs, sensitive data leaks to anyone reading the UI.

To fix this, give each repo its own scoped Kubernetes role. That role should only allow writing specific Crossplane claims in one namespace.

Never let the CI runner read back the raw cloud secrets that Crossplane creates. Lock down network paths so only trusted runners can reach your Kubernetes API server.

Managing state and drift across pipeline runs

Pipeline tools like Drone run a job once and then stop. Crossplane runs all the time inside your cluster and checks cloud state every few minutes.

This split can confuse teams when a build passes in CI but fails in the cloud. Drone only checks that the Kubernetes API accepted the YAML file.

It does not wait twenty minutes for a cloud database to finish booting up. To handle this, add a check step in your pipeline that polls the resource status.

Keep your timeout limits reasonable so hung builds do not block other team members. Also, make sure developers never edit cloud settings by hand in the web console.

Crossplane will overwrite manual changes right away to match the state stored in your cluster. If a team needs to change a resource size, they must push a new commit through Drone.

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

Should Drone apply Crossplane compositions or claims?

App pipelines should only apply scoped claims for their own namespace. Platform teams can use a separate pipeline to update cluster-wide compositions.

How do we stop pipelines from deleting production databases?

Set deletion rules on your Crossplane resources so they orphan cloud assets instead of destroying them. You can also remove delete permissions from the Drone runner role in Kubernetes.

Where should we store the cloud provider keys?

Keep cloud provider keys inside the cluster where only Crossplane can read them. Drone only needs a limited key to talk to the Kubernetes API, not the cloud provider.

The query runs. The emails stay hidden.