Skip to main content

4. Deploy your resources to a control plane

In the previous guide, you created a test for your composition logic.

In this guide, you'll create a ClusterProviderConfig and authenticate to your cloud provider to deploy your resources.

Prerequisites

Make sure you've completed the previous guide and have:

If you missed any of the previous steps, go to the project foundations guide to get started.

Create your control plane

Now that you have your project built, create a new local control plane:

up project run --local

The run command installs your project functions and dependencies to a control plane.

Authenticate with your cloud provider

Your project configuration requires an authentication method.

A ClusterProviderConfig is a custom resource that defines how your control plane authenticates and connects with cloud providers like AWS. It acts as a configuration bridge between your control plane's managed resources and the cloud provider's API.

Create a secret

Create a ClusterProviderConfig

Next, apply your provider configuration:

kubectl apply -f provider-config.yaml

When you create a composition and deploy with the control plane, Upbound uses the ClusterProviderConfig to locate and retrieve the credentials in the secret store.

Deploy your resources to your control plane

Now that you have a control plane, use the kubectl apply command in the root of your project to deploy your resources:

kubectl apply --filename examples/storagebucket/example.yaml

Return the resource state with the up CLI.

kubectl get f examples/storagebucket/example.yaml -o yaml
NAME SYNCED READY COMPOSITION AGE
webapp True True app-yaml 56s

kubectl get deploy,service -l crossplane.io/composite=webapp
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/webapp-2r2rk 2/2 2 2 11m

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/webapp-xfkzg ClusterIP 10.96.148.56 <none> 8080/TCP 11m

Now, you can validate your results through the Upbound Console, and make any changes to test your resources required.

Clean up

Be sure to destroy your resources to avoid cloud costs:

kubectl delete --filename examples/storagebucket/example.yaml

Destroy your control plane:

up project stop

Next steps

You just created an Upbound project from scratch with an embedded function and a resource claim.

Continue the workshop with Build and push your first Configuration to package and share your control plane.

For more information on projects and how to build control planes, checkout the CLI Build manuals.