This example deploys the following components
- Creates a new sample VPC, Two Private Subnets and Two Public Subnets
- Creates Internet gateway for Public Subnets and NAT Gateway for Private Subnets
- Creates EKS Cluster Control plane with one managed node group
- Crossplane Add-on to EKS Cluster
- AWS Provider for Crossplane
- Terrajet AWS Provider for Crossplane
graph TD;
subgraph AWS Cloud
id1(VPC)-->Private-Subnet1;
id1(VPC)-->Private-Subnet2;
id1(VPC)-->Public-Subnet1;
id1(VPC)-->Public-Subnet2;
Public-Subnet1-->InternetGateway
Public-Subnet2-->InternetGateway
Public-Subnet3-->InternetGateway
Public-Subnet3-->Single-NATGateway
Private-Subnet1-->EKS{{"EKS #9829;"}}
Private-Subnet2-->EKS
Private-Subnet3-->EKS
EKS==>ManagedNodeGroup;
ManagedNodeGroup-->|enable_crossplane=true|id2([Crossplane]);
subgraph Kubernetes Add-ons
id2([Crossplane])-.->|crossplane_aws_provider.enable=true|id3([AWS-Provider]);
id2([Crossplane])-.->|crossplane_jet_aws_provider.enable=true|id4([Terrajet-AWS-Provider]);
end
end
Ensure that you have installed the following tools in your Mac or Windows Laptop before start working with this module and run Terraform Plan and Apply
git clone https://github.com/aws-samples/crossplane-aws-blueprints.git
Initialize a working directory with configuration files
cd bootstrap/terraform/
terraform init
Verify the resources created by this execution
export AWS_REGION=<ENTER YOUR REGION> # Select your own region
terraform plan
to create resources
terraform apply
Enter yes
to apply
EKS Cluster details can be extracted from terraform output or from AWS Console to get the name of cluster.
This following command used to update the kubeconfig
in your local machine where you run kubectl commands to interact with your EKS Cluster.
~/.kube/config
file gets updated with cluster details and certificate from the below command
aws eks --region <enter-your-region> update-kubeconfig --name <cluster-name>
kubectl get nodes
kubectl get pods -n crossplane-system
The following command destroys the resources created by terraform apply
Step1: Delete resources created by Crossplane
Step2: Terraform Destroy
cd bootstrap/terraform/
terraform destroy --auto-approve