Getting Started with Crossplane

Picture speaks a thousand words

Image Credits: Crossplane
  1. The base EKS Cluster from which you are going to create resources using crossplane should be created along with VPC,SG etc. If you have the VPC and SG in place, you can use this to create a cluster using the EKSCTL Command or through the console itself: https://eksctl.io/usage/creating-and-managing-clusters/
  2. Kubectl installed.
#Create the namespace and install the components using helm
kubectl create namespace crossplane-system

helm repo add crossplane-stable https://charts.crossplane.io/stable
helm repo update

helm install crossplane --namespace crossplane-system crossplane-stable/crossplane
  1. Provider Manifest(AWS, Terraform etc)
  2. Secrets Manifest(AWS creds and github keys)
  3. ProviderConfig Manifest(Injecting AWS and Github secrets for crossplane to create resource)
  4. Resource Manifest (Template for creating a specific resource)
Kubectl Describe <objectname> <name-of-the-resource>
  • AWS Provider Manifest: This will Install all the CRD’s ( Custom Resources Definitions ) required to create resources on the cloud. Ex: rdsinstances.database.aws.crossplane.io,ec2.aws.crossplane.io/v1alpha1, etc.
    You will have to run the following AWS manifest alone to install AWS and Terraform Modules:
  • Secrets : We should create a secret for the AWS creds and all the required credentials like Github etc through a manifest.
###Generate the configuration files with the AWS Credentials. AWS_PROFILE=default && echo -e "[default]\naws_access_key_id = $(aws configure get aws_access_key_id --profile $AWS_PROFILE)\naws_secret_access_key = $(aws configure get aws_secret_access_key --profile $AWS_PROFILE)" > aws-creds.ini###Create a Kubernetes secret with the configuration file generated. kubectl create secret generic aws-secret-creds -n crossplane-system --from-file=creds=./aws-creds.iniOr Use the manifest for creating the secret : Run the Kubectl apply -f secret.yaml```
---
apiVersion: v1
kind: Secretmetadata:name: aws-credsnamespace: opm-pitype: OpaquestringData:credentials: |[default]aws_access_key_id = <access_key>aws_secret_access_key = <secret_key>---
apiVersion: v1
kind: Secretmetadata:name: git-credentialsnamespace: opm-pitype: OpaquestringData:creds: |https://<username>:<password>@github.com```
  • ProviderConfig Manifest: This will inject secret required for the Crossplane to create resources in the Cloud.
###Once the secret is created let us now create the Provider config.kubectl apply -f providerconfig.yaml
  • Resource Manifest : For creating the S3 resource in the Cloud using Crossplane.
  • By Injecting the Terraform s3 resource module as an Inline to the Crossplane Manifest.
Kubectl apply -f <filename> command.
Kubectl get workspace <workspace name> -n namespace-name
kubectl port-forward svc/argo-cd-argocd-server 8080:443We can then visit http://localhost:8080 to access it.
kubectl get pods -l app.kubernetes.io/name=argocd-server -o name | cut -d’/’ -f 2
https://github.com/arun12cool/tf/blob/main/crossplane-argocd/argo.yaml
Argocd-UI

--

--

--

follow me @ https://www.linkedin.com/in/arunkrish29/

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

JWT authentication in Rails applications using Devise

Create CloudFormation Template from Existing AWS Infra | Fit-DevOps

AUTODESK AUTOCAD: BASIC TOOLS AND TECHNIQUES FOR BEGINNER FreeUseCourses

Importance of Chain of Responsibility Design Pattern

Running Ansible from Gitlab CI

Making a Messenger: a Look At How to Build an Online Communions Tool

PHP Developer Guide For Modern Web Development Workflow Setup

Infomatix Business Update: 12th April to 6th May 2022

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
ArunKumar

ArunKumar

follow me @ https://www.linkedin.com/in/arunkrish29/

More from Medium

Testing IaC — Introducing t2d2

Manage security in Kubernetes with audit2rbac

Demystifying Vault’s Secrets Management Solutions in Kubernetes

How to Create a YAML Manifest Template in Monokle — Kubeshop