DEV Community

Alex Spinov
Alex Spinov

Posted on

Crossplane Has a Free API — Provision Cloud Infrastructure with Kubernetes

Crossplane turns your Kubernetes cluster into a universal cloud control plane. Provision AWS, GCP, Azure, and 100+ cloud resources using kubectl and Kubernetes-native YAML.

Free, open source, CNCF incubating project. No vendor lock-in.

Why Use Crossplane?

  • Infrastructure as Code — but Kubernetes-native, not Terraform
  • Multi-cloud — single API for AWS, GCP, Azure, and more
  • Self-service — developers request resources via kubectl, platform team controls policies
  • GitOps-ready — manage infrastructure with ArgoCD or Flux

Quick Setup

1. Install Crossplane

helm repo add crossplane-stable https://charts.crossplane.io/stable
helm install crossplane crossplane-stable/crossplane --namespace crossplane-system --create-namespace
Enter fullscreen mode Exit fullscreen mode

2. Install AWS Provider

kubectl apply -f - <<EOF
apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
  name: provider-aws-s3
spec:
  package: xpkg.upbound.io/upbound/provider-aws-s3:v1.1.0
EOF

# Check provider status
kubectl get providers
Enter fullscreen mode Exit fullscreen mode

3. Create an S3 Bucket

kubectl apply -f - <<EOF
apiVersion: s3.aws.upbound.io/v1beta1
kind: Bucket
metadata:
  name: my-crossplane-bucket
spec:
  forProvider:
    region: us-east-1
    tags:
      managed-by: crossplane
  providerConfigRef:
    name: default
EOF

# Check status
kubectl get bucket my-crossplane-bucket -o jsonpath='{.status.conditions}' | jq
Enter fullscreen mode Exit fullscreen mode

4. Create an RDS Instance

kubectl apply -f - <<EOF
apiVersion: rds.aws.upbound.io/v1beta1
kind: Instance
metadata:
  name: my-database
spec:
  forProvider:
    region: us-east-1
    engine: postgres
    engineVersion: "15"
    instanceClass: db.t3.micro
    allocatedStorage: 20
    masterUsername: admin
  writeConnectionSecretToRef:
    name: db-credentials
    namespace: default
EOF
Enter fullscreen mode Exit fullscreen mode

5. Create Compositions (Self-Service Templates)

# Platform team creates a Composition
kubectl apply -f - <<EOF
apiVersion: apiextensions.crossplane.io/v1
kind: Composition
metadata:
  name: app-database
spec:
  compositeTypeRef:
    apiVersion: platform.example.com/v1alpha1
    kind: AppDatabase
  resources:
  - name: rds
    base:
      apiVersion: rds.aws.upbound.io/v1beta1
      kind: Instance
      spec:
        forProvider:
          engine: postgres
          instanceClass: db.t3.micro
EOF

# Developer requests a database
kubectl apply -f - <<EOF
apiVersion: platform.example.com/v1alpha1
kind: AppDatabase
metadata:
  name: my-app-db
spec:
  parameters:
    size: small
EOF
Enter fullscreen mode Exit fullscreen mode

Python Example

from kubernetes import client, config

config.load_kube_config()
api = client.CustomObjectsApi()

# List all Crossplane managed resources
buckets = api.list_cluster_custom_object(
    group="s3.aws.upbound.io", version="v1beta1", plural="buckets")

for b in buckets["items"]:
    name = b["metadata"]["name"]
    ready = any(c["type"]=="Ready" and c["status"]=="True" for c in b.get("status",{}).get("conditions",[]))
    print(f"Bucket: {name} | Ready: {ready}")
Enter fullscreen mode Exit fullscreen mode

Supported Providers

Provider Resources Example
AWS 900+ S3, RDS, EKS, Lambda, SQS
GCP 600+ GCS, CloudSQL, GKE
Azure 700+ Blob, SQL, AKS
Kubernetes Namespaces, RBAC In-cluster resources
Helm Charts Deploy any Helm chart

Need custom data extraction or scraping solution? I build production-grade scrapers for any website. Email: Spinov001@gmail.com | My Apify Actors

Top comments (0)