Creates and EKS Cluster in the given Region.
User can choose:
- Name of the cluster
- Number of AZ's to use and therefore desired number of nodes.
- Minimum number of nodes.
- Instance type of the nodes.
- SSH Key to be added to the nodes.
Template uses the new (re:Invent 2019) aws_eks_node_group
resource to automate node deployment and cluster join.
Template can be run as follows:
- Locally
- Scalr Next-gen as the remote backend
- Scalr Next-Gen Service Catalog Offering
- Pull the repo
- Set variable values in
terraform.tvars.(json)
- Add your AWS access and secret keys to
terraform.tfvars(.json)
, or enter them at the run time prompts. (scalr_aws_access_key, scalr_aws_secret_key) - Run
terraform init;terraform apply
and watch the magic happen.
- Pull the repo
- Create a CLI workspace in Scalr Next-Gen and configure the backend to match in main.tf.
- Create an TF API token in Scalr Next-Gen and add it to ~/.terraformrc.
- In Scalr Workspace add Terraform variables and values as follows (note that terraform.tfvars(.json) in the template is not used with a remote backend).
- region
- cluster_name
- instance_type
- number_of_azs
- minimum_nodes
- Run
terraform init;terraform apply
and watch the magic happen.
In general follow the example here https://scalr-athena.readthedocs-hosted.com/en/latest/next-gen/service_catalog.html#service-catalog
- Create Policies (scalr-module.hcl shows the policy bindings that are required)
- cloud.locations - Policy to limit the cloud locations (note this can be all locations but the policy must exist)
- cloud.instance_types - Restrict the instance types that are allowed. Minimum 4GB of ram.
- Create a Global Variable
name_fmt
with REGEX^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
- Create a Global Variable
numeric_fmt
with REGEX^[0-9][0-9]*$
- Fork or clone the Source repo (https://github.com/scalr-eap/aws_eks_cluster)
- Create the Service Catalog offering pointing to your copy repo
- Request the offering. It can take 10-15 minutes to deploy the cluster.