Build and push a project
This guide explains how to build your control plane project into a versioned artifact and push it to the Upbound Marketplace for deployment.
Control plane projects are source-level representations of your control plane. Like any other software project, control plane projects require a build stage to assemble all parts of your project into a versioned artifact.
Before you start
Before you build and push your control plane project, ensure:
- You have the up CLI installed
- You have a complete control plane project with an
upbound.yaml
file - You have login credentials for Upbound
Build your control plane project
Build the dependencies and metadata in your Upbound project as a single OCI image.
-
Run the build command in your control plane project directory.
up project build
This command builds functions, generates language-specific schemas, and packages everything into a single
.uppkg
file. New builds update the control plane project dependency cache in the same way running theup dependency update-cache
command does.The command builds the image in your control plane project directory in
_output/<userProject>.uppkg
.
How the build process works
The up project build
command builds and packages your configuration and
embedded functions through several steps:
-
Build embedded function packages - Each function in the project
functions/
directory builds into a Crossplane function package by adding your code to a base image and generating metadata. -
Generate Configuration Package Metadata - The up CLI creates Crossplane configuration package metadata based on your project, including dependencies on the embedded functions.
-
Build the Configuration Package - All relevant YAML files (XRDs and compositions) bundle into a Crossplane configuration package using the generated metadata.
-
Write the Packages to Disk - Embedded function and configuration packages save to a single
.uppkg
file, whichup project push
can use to push packages to the Upbound Marketplace.
Push your project to the Upbound Marketplace
Upload your built project to make it available for deployment to control planes.
-
Login to Upbound.
up login
-
Push your package to the Upbound Marketplace.
up project push
If you don't have a Marketplace repository, the
up project push
command automatically creates the repository based on thespec.repository
field in yourupbound.yaml
file. When you push a project with embedded functions, Upbound automatically creates sub-repositories for these functions.
How the push process works
The up project push
command uploads your configuration and its embedded
functions to the Upbound Marketplace:
- The
.uppkg
file generated byup project build
contains the packages that need to be pushed - The packages push to sub-repositories within your configuration repository
- Each sub-repository name follows this naming convention:
[organization-name]/[project-name]_[function-name]
- The configuration package, which includes dependencies on embedded functions, also pushes
- Once uploaded, your configuration is ready for deployment to control planes like any other configuration
Use embedded functions in compositions
Reference your embedded functions in compositions to make use of the custom logic you've built.
-
Understand the function reference format. The
functionRef
name follows this format:[organization-name]-[project-name][function-name]
. -
Add the function reference to your composition pipeline.
apiVersion: apiextensions.crossplane.io/v1
kind: Composition
metadata:
name: xexample.myorg.com
spec:
mode: Pipeline
pipeline:
- step: compose
functionRef:
name: my-org-my-confcompose-xexample
- step: propagate-status
functionRef:
name: my-org-my-confpropagate-statusFor example, if your organization is
my-org
and your project ismy-conf
, use the naming pattern shown above.
When you create functions with up function generate
, the up CLI automatically
adds them to the specified composition. For manually created functions or those
shared across multiple compositions, reference them manually in the
functionRef
parameter.
Note: Embedded functions require Crossplane 1.18 or later.
See also
- up CLI Reference - Complete command documentation
- Control plane project concepts - Understanding project structure
- Embedded functions guide - Creating and managing functions