Azure-Samples/aks-platform-engineering

Deploy Crossplane Mangement Cluster with ArgoCD

Closed this issue · 7 comments

dtzar commented
Deploy Crossplane Mangement Cluster with ArgoCD

I created a sample to show how to deploy Crossplane using a helm_release resource from the Helm Terraform provider: Deploy an Azure Kubernetes Service cluster with Crossplane using Terraform

I successfully built an example that deploys an AKS cluster using a composition, a composite resource definition (XRD), a composite resource, and the managed resources from the azure-provider.

dtzar commented

You can take the learnings from how to deploy Crossplane using Helm to have ArgoCD deploy it using App of Apps pattern.

You can take the learnings from how to deploy Crossplane using Helm to have ArgoCD deploy it using App of Apps pattern.

Hi @dtzar deploying Crossplane is a piece of cake no matter if you deploy it via Terraform or ArgoCD. What is way more tricky is to create a good quality Composite Resource Definition (XRD) and Composition to deploy an AKS cluster in a flexible way using a Composite Resource (XR) or Claim. For example, you can use the following Application to deploy Crossplane:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
 name: crossplane-app
 namespace: argocd
spec:
 destination:
   server: https://kubernetes.default.svc
   namespace: crossplane-system
 source:
   repoURL: https://charts.crossplane.io/stable
   targetRevision: 1.5.0
   chart: crossplane
   helm:
     parameters:
       - name: installCRDs
         value: "true"
 project: default

I created a sample that shows how to author a Composite Resource Definition (XRD) and Composition to deploy an AKS cluster in a flexible way using a Composite Resource (XR) or Claim:

dtzar commented

Yes, let's get the Crossplane install merged as a PR and then a separate PR to merge in the AKS deployment for worker clusters

@dtzar sounds good. Once the baseline deployment is ready, I can easily extend it with the above ArgoCD Application to install Crossplane. We also need to create a service principal for Crossplane if we decide not to use the AKS kublet user-defined managed identity. And we need to assign the Owner role to the service principal over the subscription or management group containing more subscriptions.

Today, I significantly extended my sample that shows how to author a Composite Resource Definition (XRD) and Composition to deploy an AKS cluster in a flexible way using a Composite Resource (XR) or Claim:

The artifacts now deploy a worker AKS cluster with a system-mode node pool and user-mode node pool. The XRD is very flexible and allows to define a lot of properties of the AKS cluster and user node pool.

This is complete with #11 and #19