This repository contains an Upbound DevEx configuration based on Crossplane v2, tailored for users establishing their initial control plane with Upbound. This configuration deploys fully managed GCP database instances with private networking and service networking connections.
Note: This configuration uses Crossplane v2 with namespace-scoped resources. All resources must be deployed within a namespace (default:
default).
The core components of a custom API in Upbound Project include:
- CompositeResourceDefinition (XRD): Defines the API's structure.
- Composition(s): Configures the Functions Pipeline
- Embedded Function(s): Encapsulates the Composition logic and implementation within a self-contained, reusable unit
In this specific configuration, the API contains:
- a GCP SQL Database custom resource type.
- Composition: Configured in /apis/sqlinstances/composition.yaml
- Embedded Function: The Composition logic is encapsulated within embedded function
This configuration provisions:
- Cloud SQL Database Instance with configurable engine (MySQL/PostgreSQL) and storage
- Private IP networking with VPC peering for secure database access
- Service Networking connection for private service access
- Database user with configurable password via Kubernetes secret
- Default database named "upbound" for application use
- Connection secrets for database connectivity (using Crossplane v2 manual Secret composition)
The configuration can be tested using:
up composition render --xrd=apis/sqlinstances/definition.yaml apis/sqlinstances/composition.yaml examples/mysql-xr.yamlto render the MySQL compositionup test run tests/*to run composition testsup test run tests/* --e2eto run end-to-end tests
- Execute
up project run - Alternatively, install the Configuration from the Upbound Marketplace
- Check examples for example XR (Composite Resource)
This configuration depends on:
- configuration-gcp-network for network resources
- GCP SQL Provider for database management
- GCP Service Networking Provider for private connections
The SQLInstance API supports the following parameters:
engine: Database engine (mysqlorpostgres)engineVersion: Database version (e.g.,8_0for MySQL,13for PostgreSQL)storageGB: Storage size in GBregion: GCP region for deploymentnetworkRef.id: Reference to the network from configuration-gcp-networkpasswordSecretRef: Reference to Kubernetes secret containing database password (namespace inferred from resource namespace in v2)managementPolicies: Resource management policies (default:["*"]which includes all operations; use["Create", "Observe", "Update", "LateInitialize"]to orphan resources)providerConfigName: Crossplane ProviderConfig name
This configuration was migrated to Crossplane v2 on January 21, 2026. Key changes from v1:
- API Version: Updated from
apiextensions.crossplane.io/v1tov2 - Namespace Scope: All resources are now namespace-scoped. You must specify
metadata.namespacein all XR/Claim definitions. - Resource Kind: Changed from
XSQLInstancetoSQLInstance(removed X-prefix) - managementPolicies: Replaced
deletionPolicystring field withmanagementPoliciesarray- v1:
deletionPolicy: Delete - v2:
managementPolicies: ["*"]
- v1:
- Secret References: The
namespacefield is now optional inpasswordSecretRef(inferred from resource namespace) - Connection Secrets: Uses manual Secret composition instead of CompositeConnectionDetails
- Connection secrets are now created as Kubernetes Secret resources with base64-encoded data
- Secret name format:
{xr-name}-connection - Available keys:
host,serverCACertificateCert,username,password
- GCP Providers: Updated to v2 with namespace-scoped managed resources
- provider-gcp-sql: >= v2.0.0
- provider-gcp-servicenetworking: >= v2.0.0
- Network Dependency: Updated configuration-gcp-network to v2.0.0
- Provider API Groups: Now use namespaced APIs (e.g.,
sql.gcp.m.upbound.io/v1beta1)
All examples have been updated to v2 patterns. See examples/ directory for:
- Namespace additions in metadata
managementPoliciesinstead ofdeletionPolicy- Removed
writeConnectionSecretToRef(handled automatically via manual Secret composition)
For more information about Crossplane v2, see the official upgrade guide.
This repository serves as a foundational step. To enhance the configuration, consider:
- create new API definitions in this same repo
- editing the existing API definition to your needs
- adding backup and restore functionality
- implementing high availability configurations
To learn more about how to build APIs for your managed control planes in Upbound, read the guide on Upbound's docs.