Skip to content

upbound/configuration-getting-started

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

configuration-getting-started

An introductory example to Crossplane and Compositions using provider-nop. This will enable provisioning of several different fake resource types.

This repository contains a reference configuration for Crossplane v2. This configuration is built with provider-nop, a Crossplane provider that simulates the creation of external resources. All composite resources are namespaced — claims are not used (they don't exist in Crossplane v2).

Overview

This platform offers APIs for setting up a variety of basic resources that mirror what you'd find in a Cloud Service Provider such as AWS, Azure, or GCP. The resource types include:

  • Cluster, a resource that loosely represents a Kubernetes cluster.
  • NodePool, a resource that loosely represents a Nodepool in a Kubernetes cluster.
  • Database, a resource that loosely represents a cloud database.
  • Network, a resource that loosely represents a cloud network resource.
  • Subnetwork, a resource that loosely represents a subnetwork resource within a cloud network.
  • ServiceAccount, a resource that loosely represents a service account in the cloud.

This configuration also demonstrates the power of Crossplane to build abstractions called "compositions", which assemble multiple basic resources into a more complex resource. These are demonstrated with:

  • CompositeCluster, a resource abstraction that composes a cluster, nodepool, network, subnetwork, and service account.
  • AccountScaffold, a resource abstraction that composes a service account, network, and subnetwork.

Learn more about Composite Resources in the Crossplane Docs.

Quickstart

Prerequisites

You need a running Crossplane v2 control plane. You can create a managed control plane on Upbound, or run upstream Crossplane locally with kind.

Install the up CLI:

curl -sL https://cli.upbound.io | sh

See up docs for more install options.

Alternatively, install the Crossplane CLI:

curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh

Install the Getting Started configuration

Install the configuration package:

kubectl apply -f - <<EOF
apiVersion: pkg.crossplane.io/v1
kind: Configuration
metadata:
  name: configuration-getting-started
spec:
  package: xpkg.upbound.io/upbound/configuration-getting-started:v1.0.0
EOF

Wait for the configuration and all dependencies to become healthy:

kubectl get configurations,providers,functions

Verify all XRDs are established:

kubectl get xrd

You should see 8 XRDs, all with ESTABLISHED=True and an empty OFFERED column (no claims in v2).

Using the Getting Started configuration

All resources are namespaced in Crossplane v2 — you apply XRs directly to a namespace instead of creating claims.

Create a custom defined cluster:

kubectl apply -f examples/cluster/xr.yaml

Create a custom defined database:

kubectl apply -f examples/database/xr.yaml

Create a composite cluster (composes 5 nested XRs):

kubectl apply -f examples/compositecluster/xr.yaml

You can verify the status by inspecting the composite and managed resources:

kubectl get managed,composite -n default

To delete the provisioned resources:

kubectl delete -f examples/cluster/xr.yaml
kubectl delete -f examples/database/xr.yaml
kubectl delete -f examples/compositecluster/xr.yaml

To uninstall the configuration:

kubectl delete configurations.pkg.crossplane.io configuration-getting-started

Local development

Render compositions locally:

make render

Run end-to-end tests:

make e2e

Note: The render target uses the crossplane CLI under the hood (crossplane render), which has no up equivalent for classic configuration packages.

Next Steps

We recommend you check out one of Upbound's platform reference architectures to learn how to use Crossplane to provision real external resources:

Questions?

For any questions, thoughts and comments don't hesitate to reach out or drop by slack.crossplane.io, and say hi!

About

An introductory example to Crossplane and Compositions using provider-nop. This will enable provisioning of several different fake resource types.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors