Crossplane Concepts TODEPLETE: Difference between revisions
Line 78: | Line 78: | ||
==<span id='XR'></span>Composite Resource (XR)== | ==<span id='XR'></span>Composite Resource (XR)== | ||
A composite resource can be used to represent a VPC network or an SQL instance. | A composite resource can be used to represent a VPC network or an SQL instance. A composite resource is cluster-scoped, it exists outside a namespace. | ||
A composite resource is cluster-scoped, it exists outside a namespace. | |||
<syntaxhighlight lang='bash'> | <syntaxhighlight lang='bash'> | ||
kubectl get composite | kubectl get composite | ||
</syntaxhighlight> | </syntaxhighlight> | ||
The composite resource is the Crossplane equivalent of a [[Terraform_Concepts#Module|Terraform module]]. | |||
===<span id='XRD'></span>Composite Resource Definition (XRD)=== | ===<span id='XRD'></span>Composite Resource Definition (XRD)=== | ||
Revision as of 16:16, 11 October 2022
Internal
Organizatorium
- https://blog.upbound.io/introducing-crossplane-open-source-multicloud-control-plane/
- https://docs.google.com/document/d/1whncqdUeU2cATGEJhHvzXWC9xdK29Er45NJeoemxebo/edit
- https://blog.crossplane.io/crossplane-vs-terraform/
Overview
Crossplane is an open source Kubernetes add-on that transforms the Kubernetes cluster into a universal control plane. Crossplane enables platform teams to assemble infrastructure from multiple vendors, and expose higher level self-service APIs for application teams to consume. Crossplane enables applications and infrastructure configuration to co-exist in the same control plane. Control planes built with Crossplane integrate with CI/CD pipelines, so team can create, track and approve changes using GitOps best practices. Crossplane offers separation of concerns: allows implementing organizational concepts and policy at the API level.
Crossplane is a Cloud Native Compute Foundation project.
Crossplane Distributions
Upstream
Upstream - the Open Source, GitHub-hosted.
Downstream
Universal Crossplane (UXP)
Downstream - Upbound's free and open source downstream distribution, called Universal Crossplane (UXP). UXP connects to Upbound's hosted management console and registry.
Control Plane
What is a control plane?
Control planes are self-healing, they automatically correct drift.
Control planes offer a single point of control for policy and permissions.
Control planes integrate easily with other systems because they expose an API, not just a command line.
A control plane orchestrates any infrastructure or managed services.
Crossplane can be used to design ad implement a control plane that expose declarative APIs tailored to your unique orchestration needs.
A control plane is made up of several controllers, which are responsible for the life cycle of a resource. Each resource is responsible for provisioning, health, scaling, failover and actively responding to external changes that deviate from the desired configuration.
Provisioning Infrastructure
TO PROCESS: provision https://crossplane.io/docs/v1.9/getting-started/provision-infrastructure.html#claim-your-infrastructure and consume https://crossplane.io/docs/v1.9/getting-started/provision-infrastructure.html#consume-your-infrastructure infrastructure
Configuration
A configuration extends Crossplane to expose new APIs.
A configuration package includes, for example, a PostgreSQLInsstance
type and a Composition
of managed resources that mapped to it. Crossplane allows defining composite resources (XRs) and compositions and packaging them up to be distributed as OCI images.
A configuration need not contain one XRD and one composition. It could include only an XRD, only a composition, several compositions, or any combination thereof.
Also see:
Configuration Directory
A configuration directory contains at its root a crossplane.yaml
file, and one or more XR definitions (XRD) and composition definitions.
crossplane.yaml
The crossplane.yaml
metadata file sits in the root of a configuration directory. It contains metadata about the configuration.
apiVersion: meta.pkg.crossplane.io/v1
kind: Configuration
metadata:
name: getting-started-with-aws
annotations:
guide: quickstart
provider: aws
vpc: default
spec:
crossplane:
version: ">=v1.4.0-0"
dependsOn:
- provider: crossplane/provider-aws
version: ">=v0.18.2"
Building a Configuration
kubectl crossplane build configuration
Resource
Crossplane resources can be composed into higher level abstractions, that can be versioned, managed, deployed and consumed using your favorite tools and existing processes.
Composite Resource (XR)
A composite resource can be used to represent a VPC network or an SQL instance. A composite resource is cluster-scoped, it exists outside a namespace.
kubectl get composite
The composite resource is the Crossplane equivalent of a Terraform module.
Composite Resource Definition (XRD)
definition.yaml
TO PROCESS: https://crossplane.io/docs/v1.9/getting-started/create-configuration.html#create-compositeresourcedefinition
Composite Resource Claim (XRC)
An XRC is a namespaced proxy for an XR. The schema of an XRC is identical to that of the corresponding XR. When an application operator creates an XRC, the corresponding backing XR is created automatically. The model has similarities with the Persistent Volume (PV) and Persistent Volume Claim (PVC) mechanism in Kubernetes.
kubectl get claim
Managed Resource
A resource that represents a unit of external infrastructure.
kubectl get managed
Composition
composition.yaml
TO PROCESS: https://crossplane.io/docs/v1.9/getting-started/create-configuration.html#create-compositions. Specifies how to provision a public PostrgreSQL instance on a chosen provider.
Provider
A provider extends Crossplane to orchestrate new kinds of applications and infrastructure.
kubectl get <name-of-provider>
Operator
Infrastructure Operator
The infrastructure operator offers their application operators a composite resource claim (XRC).
Application Operator
An application operator is restricted to their team's namespace.
Crossplane Resource Model (XRM)
What is it? Definition? XRM promotes loose coupling and eventual consistency. In Crossplane, every pieced of infrastructure is an API endpoint that supports CRUD operations. Crossplane does not need to calculate a graph of dependencies to make a change.