diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 5732306..960a76a 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -37,6 +37,7 @@ - [Kustomize](./templating/kustomize.md) - [Terraform](./templating/terraform.md) - [Crossplane](./templating/crossplane.md) +- [Crossplane Compositions](./templating/crossplane-compositions.md) # Helm diff --git a/src/templating/crossplane-compositions.md b/src/templating/crossplane-compositions.md new file mode 100644 index 0000000..8eaa908 --- /dev/null +++ b/src/templating/crossplane-compositions.md @@ -0,0 +1,161 @@ +# Crossplane Compositions + +## Links + +* [Video By Shahrooz Aghili](https://www.youtube.com/watch?v) +* [Crossplane](https://crossplane.io/) +* [Docs](https://docs.crossplane.io/) + +Highlights and Intro: +> **Crossplane** is an advanced tool for managing infrastructure in the cloud-native ecosystem. +> Just like terraform encourages using modules for bundling related resources, crossplane offers compositions. +> `Platform engineers` can define their compositions and provide the `Devs` a simple claim api. +> `Devs` claim their resources and the composition takes care of the rest. + + +### start minikube +``` +minikube start +``` + +### install crossplane +``` +helm repo add crossplane-stable \ + https://charts.crossplane.io/stable + +helm repo update + +helm upgrade --install \ + crossplane crossplane-stable/crossplane \ + --namespace crossplane-system \ + --create-namespace \ + --wait +``` + + +### create GCP credentials secret for crossplane + +``` + +export SA_NAME="YOUR-SA-NAME" + +export SA="${SA_NAME}@${PROJECT_ID}.iam.gserviceaccount.com" + +gcloud iam service-accounts \ + create $SA_NAME \ + --project $PROJECT_ID + +export ROLE=roles/admin + +gcloud projects add-iam-policy-binding \ + --role $ROLE $PROJECT_ID \ + --member serviceAccount:$SA + +gcloud iam service-accounts keys \ + create gcp-creds.json \ + --project $PROJECT_ID \ + --iam-account $SA + +kubectl --namespace crossplane-system \ + create secret generic gcp-creds \ + --from-file creds=./gcp-creds.json +``` + +### install GCP provider +``` +cat <