Installing Crossplane on Tanzu Kubernetes Cluster

What is Tanzu Kubernetes Cluster?

A Tanzu Kubernetes cluster is an opinionated installation of Kubernetes open-source software that is built and supported by VMware.

What is Crossplane?

Crossplane is an open source Kubernetes add-on that enables platform teams to assemble infrastructure from multiple vendors, and expose higher level self-service APIs for application teams to consume, without having to write any code. 
There are two flavors of Crossplane available. In this post, i will be talking about Self-Hosted Crossplane on Tanzu Kubernetes Cluster.

https://crossplane.io/docs/v1.3/getting-started/install-configure.html

Some of the benefits of setting up Crossplane on Tanzu Kubernetes Cluster?
1. Easily provision public cloud resources using Crossplane CRDs running on TKG Clusters in an on-prem environment
2. Hybrid multicloud Infrastructure as Code
3. GitOps will become much more easier and many more


Install Crossplane on Tanzu Kubernetes Cluster

Technically this should work on TKG clusters running on vSphere or pubilc cloud, but i have done this on vSphere.

  1. First set the cluster context where you want to install Crossplane
kubectx
demotkgcluster-admin@demotkgcluster
crossplanecluster-admin@crossplanecluster
kubectx crossplanecluster-admin@crossplanecluster
Switched to context "crossplanecluster-admin@crossplanecluster".

If you are new to kubectx, you can find the detail here https://github.com/ahmetb/kubectx

2. Create the namespace

kubectl create namespace crossplane-system
namespace/crossplane-system created

3. Add and update helm repo

helm repo add crossplane-stable https://charts.crossplane.io/stable
"crossplane-stable" has been added to your repositories
helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "crossplane-stable" chart repository
Update Complete. ⎈Happy Helming!⎈

4. Install the chart

helm install crossplane --namespace crossplane-system crossplane-stable/crossplane --version 1.3.0
NAME: crossplane
LAST DEPLOYED: Sun Jul 18 05:23:55 2021
NAMESPACE: crossplane-system
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
Release: crossplane
Chart Name: crossplane
Chart Description: Crossplane is an open source Kubernetes add-on that enables platform teams to assemble infrastructure from multiple vendors, and expose higher level self-service APIs for application teams to consume.
Chart Version: 1.3.0
Chart Application Version: 1.3.0
Kube Version: v1.20.4+vmware.1

5. List the deployed helm chart

helm list -n crossplane-system
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
crossplane crossplane-system 1 2021-07-18 05:23:55.415294226 +0000 UTC deployed crossplane-1.3.0 1.3.0

6. See all the resources deployed in crossplane-system namespac

kubectl get all -n crossplane-system
NAME READY STATUS RESTARTS AGE
pod/crossplane-69475c45c-rc7x8 0/1 Pending 0 75m
pod/crossplane-rbac-manager-7c6ff4fd6f-8hpvg 0/1 Pending 0 75m
NAME                                      READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/crossplane 0/1 1 0 75m
deployment.apps/crossplane-rbac-manager 0/1 1 0 75m
NAME                                                 DESIRED   CURRENT   READY   AGE
replicaset.apps/crossplane-69475c45c 1 1 0 75m
replicaset.apps/crossplane-rbac-manager-7c6ff4fd6f 1 1 0 75m

Now, you can create the resources. You can find more detail in Crossplane official document here.

In my next post, i will talk about how to provision resources using Crossplane.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s