CrossPlane: Working with Providers in CrossPlane — Episode 2

Walaa Elgenidy
4 min readJul 5, 2024

--

At the heart of Cross-Plane’s functionality are the providers, which serve as the gateways to your cloud resources.

In this article, we’ll dive deep into the world of Cross-Plane providers and explore how to leverage them .

Understanding Cross-Plane Providers:

Cross-Plane providers are responsible for managing the communication between Cross-Plane and the underlying cloud platforms, such as AWS, Azure, Google Cloud, and more.

These providers abstract away the complexity of interacting with diverse cloud APIs, allowing you to define and manage your resources in a consistent and unified manner.

Each provider in Cross-Plane is designed to support a specific cloud platform, and they come pre-packaged with a set of resources that you can use to provision and manage your infrastructure. For example, the AWS provider includes resources for EC2 instances, S3 buckets, RDS databases, and more.

Building a School with Cross-Plane (non-tech explanation)

Imagine you want to build a school in your community. This school will need different components, much like how a cloud infrastructure needs various resources to function properly.

Components of the School:

  1. Classrooms: These are the basic rooms where students learn.
  2. Library: This is a resource center filled with books and materials for students.
  3. Cafeteria: A place where students can eat and gather.
  4. Sports Field: An outdoor area for physical activities and sports.

Using Cross-Plane providers:

  1. Different Providers: Think of each component of the school as coming from a different supplier:
  • Classrooms could be built by a local contractor.
  • Library resources might come from a bookstore.
  • Cafeteria equipment could be supplied by a restaurant supplier.
  • Sports field could be installed by a landscaping company.

Cross-Plane allows you to gather all these components seamlessly, regardless of their supplier.

2. Planning the Layout: Before you start building, you need a plan. Cross-Plane helps you create a blueprint of what the school should look like:

  • How many classrooms will you have?
  • Where will the library be located?
  • How big will the cafeteria be?

3. Putting It Together: Once you have your plan, Cross-Plane helps you manage the construction process. You tell it, “I need three classrooms, a library, a cafeteria, and a sports field,” and it coordinates with all the different suppliers to get those components built.

4. Maintenance and Updates: After the school is built, you might want to add new features or update existing ones, like introducing a tech lab or renovating the break room. Cross-Plane makes it easy to manage these changes too. If you want to expand your cafeteria, you can just communicate that, and it coordinates with the right supplier again.

Configuring Providers in Cross-Plane:

To start working with providers in Cross-Plane, you need to configure them within your Cross-Plane environment. This typically involves providing the necessary credentials and authentication details to grant Cross-Plane access to your cloud resources.

Here’s an example of how you might configure the AWS provider in Cross-Plane:

apiVersion: aws.upbound.io/v1beta1
kind: ProviderConfig
metadata:
name: default
spec:
credentials:
source: Secret
secretRef:
namespace: upbound-system
name: aws-secret
key: creds

In this example, we’re defining a ProviderConfig resource that specifies the AWS provider configuration. The credentials section tells Cross-Plane to fetch the necessary AWS credentials from a Kubernetes secret.

Once you’ve configured your providers, you can start working with the various resources they offer. Each provider comes with a set of custom resource definitions (CRDs) that represent the cloud resources you can manage through Cross-Plane.

For example, the AWS provider includes S3Bucket:

To create this resource, you’ll need to define Kubernetes custom resources that map to the provider’s CRDs.

Here’s an example of creating an S3 bucket using the AWS provider:

apiVersion: s3.aws.upbound.io/v1beta1
kind: Bucket
metadata:
name: bucket-name
spec:
forProvider:
region: us-west-1

By defining your infrastructure as code using these provider-specific resources, you can achieve a high degree of portability and consistency across your cloud environments.

Extending Provider Functionality:

While the pre-packaged providers in Cross-Plane cover a wide range of cloud resources, you may occasionally need to extend their functionality to suit your specific requirements. Cross-Plane allows you to do this by creating your own provider packages.

Provider packages are self-contained units that can be distributed and shared, enabling you to customize the provider capabilities or even integrate with completely new cloud platforms. By creating your own provider packages, you can expand the capabilities of Cross-Plane to match the evolving needs of your cloud-native ecosystem.

Conclusion:

Mastering Cross-Plane providers is a crucial step in unlocking the full potential of the cloud-native landscape. By understanding how to configure, manage, and extend providers, you can create a unified and consistent infrastructure management experience across multiple cloud platforms.

In this article, we’ve explored the fundamentals of Cross-Plane providers, from configuration to resource management. As you continue your journey with Cross-Plane, keep these provider-related concepts in mind, and you’ll be well on your way to becoming a cloud infrastructure virtuoso.

--

--