Fix the cloud-native control plane paradox!
Start the initial setup of Crossplane from a local Kubernetes cluster
Important
The following instructions require K3d v5.7.0 or above.
Tip
Checkout KubeZero if you want an easy way to build a production-ready out-of-the-box Kubernetes platform IaC with GitOps designed for multi-environment Cloud Native setup.
Crossplane is awesome! It is an open-source Kubernetes add-on that extends Kubernetes to manage and provision cloud infrastructure resources using Kubernetes-style configurations. Arguably I'd say it's the best cloud-native way to do IaC and GitOps for infrastructure!
However, it has one tiny challenge given it only works on Kubernetes ... that it needs a working Kubernetes cluster! That means it needs some manual work at the beginning to start the automation.
Here comes Crossplane Bootstrapper which utilizes K3d capabilities to automate that bootstrapping step.
Using Helm Controller in K3d/K3s you can set up Crossplane automatically in IaC style via a local cluster with minimal manual ad-hoc work which will build your main management cluster on the cloud.
Here is an overview of the flow:
flowchart TB
%% Cluster 1 - Bootstrap.
style k8sBoostrap stroke-dasharray: 2 2
subgraph k8sBoostrap["Kubernetes Cluster - Local"]
%% Initial bootstrap.
K3D["K3d/K3s\nHelm Controller"] --> k8sBoostrap.GitOps
%% Management components.
subgraph k8sBoostrap.GitOps["Bootstrap"]
direction TB
k8sBoostrap.Crossplane[Crossplane]
end
end
%% Cluster 2 - Management.
style k8sManagement stroke-dasharray: 2 2
subgraph k8sManagement["Kubernetes Cluster - Cloud"]
subgraph k8sManagement.InfraManagement[Management]
k8sManagement.InfraManagement.Crossplane[Crossplane]
end
end
%% Bootstrap connections.
k8sBoostrap.Crossplane --"Build Management Cluster"--> k8sManagement
By just running one command, you will have a local cluster with an up-and-running Crossplane which will build your cloud management cluster. You can customize the bootstrapped resources.
- Prerequisites:
- K3d CLI.
- Clone this repo (Crossplane Bootstrapper).
- Edit the config based on your needs manifest-crossplane-bootstrapper.yaml
- Run:
k3d cluster create --config k3d-crossplane-bootstrapper.yaml
- Ensure that everything works as expected:
kubectl get pod -n crossplane-system
- You can customize the bootstrapping process as you like using Crossplane Helm values or any extra Kubernetes objects you need (for example, you will need to deploy the ProviderConfig).
This project is open-source by DevOps Hive and licensed under Apache License 2.0. For more details, please review LICENSE.