This Terraform module provisions a fully-configured Amazon Elastic Kubernetes Service (EKS) cluster with supporting infrastructure, ready for deploying USD Search API.
EKS Cluster: Provisions an EKS cluster with managed node groups.
VPC Configuration: Creates a custom VPC with public and private subnets, NAT gateways, and necessary routing.
Deploys Essential Kubernetes Applications and resources:
Generate your NGC helm and container registry API Key. See onboarding guide here. This step could be skipped if the API Key was generated before.
Fetch the latest resource from the NGC registry by using the Download
button in the top right corner of the page and selecting the preferred download method. Below you can find a sample command that uses NGC CLI for downloading:
ngc registry resource download-version "nvidia/usdsearch/usdsearch_terraform:1.0.0"
main.tf
in the root of your project and add the following content:terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
// Use S3 as a backend for storing Terraform state.
// For local development, you can comment out this block and use the default local backend.
backend "s3" {
bucket = "my-usd-search-tfstate"
key = "usdsearch"
region = "us-east-1"
}
}
provider "aws" {
region = "us-east-2"
}
module "usdsearch_cluster" {
source = "./usdsearch_terraform"
cluster_name = "my-usd-search-cluster"
environment = "dev"
azs = ["us-east-2a", "us-east-2b", "us-east-2c"]
default_node_group_capacity_type = "SPOT"
// Set the number of GPUs available on the cluster
renderer_node_pool_gpu_limit = 4
// Optional: Create DNS record for the ingress controller. By default it creates a wildcard record for `route53_record_name` to later make USD Search API accessible on subdomains (via ingress, configured in the helm chart). If such functionality is not desired, please set ``create_route53_record`` to ``false``.
create_route53_record = true
route53_zone_id = "your-route53-zone-id"
route53_record_name = "my-usd-search-cluster.example.com"
// Optional: Enable Grafana Ingress. Note that it uses default grafana credentials. For production deployments, it is required to restrict access to Grafana.
enable_grafana_ingress = true
grafana_ingress_host = "grafana.my-usd-search-cluster.example.com"
}
Update the configuration according to your desired settings. Please refer to usdsearch_terraform/variables.tf
for more information about the variables.
Initialize terraform modules by running:
terraform init
terraform apply
aws eks update-kubeconfig --region us-east-2 --name my-usd-search-cluster