Learn Together: Crossplane

Kerem Demirtürk
4 min readSep 13, 2023

Hey Folks,

Today I want to start to write about somethings unfamiliar to me and aiming to expand my knowledge and gain more experience with Kubernetes (k8s). I’ll be documenting my learning process, allowing you to join me in this adventure from the start, and I welcome any feedback that can help me enhance my efficiency.

PS => As I continue to learn, I want to emphasise that the information I’ve shared here may evolve over time, and I’m committed to updating the content to reflect the latest insights and knowledge.

Before I dive into the specifics, I want to note that Crossplane has its own blogs and resources, accessible through this link.

Now, let’s talk about why I’ve chosen Crossplane as my focus. While I had heard of Crossplane before, I had never had the chance to explore it or learn about it in detail. Therefore, I decided to dedicate my vacation time to discovering something new, and Crossplane turned out to be the perfect choice.

Crossplane

Crossplane, in their own words, is an open-source control plane framework supported by the cloud-native community. In simpler terms, it allows you to build control planes without the need to write code. Crossplane boasts a highly extensible backend, enabling you to orchestrate applications and infrastructure across various environments. Its frontend is also highly configurable, allowing you to define the declarative API it offers.

In my own words, Crossplane is a control plane framework designed for cloud-native environments. It’s open-source, multi-cloud, and serves as a Kubernetes add-on, extending the capabilities of Kubernetes clusters.

According to various sources, Crossplane is developed as a Kubernetes add-on and empowers any Kubernetes cluster to provision and manage cloud infrastructure, services, and applications seamlessly.

Now, you might be wondering, what exactly are control planes? Control planes are the mechanisms responsible for making changes to a system, whether it involves adding, deleting, or modifying resources. These changes are propagated to the necessary components to ensure they take effect. For instance, this could involve updating a network configuration for an Application Load Balancer (ALB) or creating an AWS Lambda function. (As per the AWS WhitePaper definition)

Initially, when I encountered these definitions and details, I must admit, I felt a bit overwhelmed and confused, I wasn’t entirely sure how or where to apply or use this knowledge. However, with time, practice, and a fair amount of effort, I began to gain a deeper understanding. So, let’s get started by installing Crossplane and dependencies. For this journey, I’ll be using tools like Minikube and Helm.

Here’s a quick guide to the installation process:

  1. Install kubectl with brew install kubectl.
  2. Install Minikube with brew install minikube.
  3. Install Helm with brew install helm.
  4. Install Docker with brew install docker.

Once you have these tools installed, you can interact with our cluster as follows:

  1. Start Minikube with minikube start.
  2. Access the Minikube dashboard by running minikube dashboard. This will open a web UI for you to explore. (Optional)

Certainly, let’s continue with the installation of Crossplane:

  1. Create a Kubernetes namespace for Crossplane:
kubectl create namespace crossplane

2. Add the Crossplane Helm repository:

helm repo add crossplane-stable https://charts.crossplane.io/stable

3. Update the Helm repositories to ensure you have the latest chart information:

helm repo update

4. Install Crossplane into the “crossplane” namespace:

helm install crossplane -n crossplane crossplane-stable/crossplane

To check the status of Crossplane resources, you can use the following command:

kubectl get all -n crossplane

This will provide you with information about the resources and their current status in the “crossplane” namespace.

Before to continue on practise side, I want to explain Crossplane state management:

Crossplane state management

Crossplane introduces a powerful concept called “Infrastructure as Code (IaC) State Management”, which simplifies the management of infrastructure and cloud resources directly from within Kubernetes. It leverages the concept of “Infrastructure Composition” to allow you to define, manage, and control infrastructure resources as if they were native Kubernetes objects.

Here’s how it works:

  1. Resource Definitions (XRDs): Crossplane introduces a new resource type called “Composite Resource Definitions (XRDs)”. These XRDs act as templates for defining infrastructure resources like databases, virtual machines, or cloud storage.
  2. Composition Controller: Crossplane includes a Composition Controller, which is responsible for creating and managing these composite resources based on the XRDs. When you create a composite resource (known as a CompositionInstance), the Composition Controller interprets the associated XRD and orchestrates the provisioning and management of the underlying infrastructure resource.
  3. Providers: Crossplane relies on Providers to interact with various infrastructure and cloud providers (e.g., AWS, Azure, GCP). Each provider implements the logic necessary to create, update, delete, and query resources in the corresponding cloud or infrastructure service.
  4. Kubernetes API: With Crossplane, you interact with infrastructure resources using Kubernetes’ familiar declarative API. You define your desired infrastructure resources in YAML manifests, just like you would with standard Kubernetes objects.

Stay tuned for more tutorials, tips, and insights as we continue our journey with Crossplane. If you have any questions or specific topics you’d like to explore, feel free to let me know. Happy learning!

Kerem Demirturk

--

--