From 1d52043a7e4bd046754b995c87eabf9ce2dd8dfe Mon Sep 17 00:00:00 2001 From: Anthony Zawacki Date: Fri, 1 Sep 2023 17:55:57 -0400 Subject: [PATCH] Initial cut at documentation/example --- README.md | 21 +++++++++++++ examples/simple/eks.tf | 18 +++++++++++ examples/simple/variables.tf | 60 ++++++++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 examples/simple/eks.tf create mode 100644 examples/simple/variables.tf diff --git a/README.md b/README.md index 09e54fb..f5e3327 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,27 @@ Create an EKS cluster given the specification of the cluster. +**NOTE:** At this time, the cluster-admin group is not created in AWS due +to interactions with the ldap provider. + +The module creates an EKS cluster with `eks_ng_desired_size` nodes initially. +The cluster-autoscaler will resize the node group based upon capacity from a +minimum of `eks_ng_min_size` to a maximum of `eks_ng_max_size`. +The `eks_instance_types` is a prioritized list of instance types to use as +the worker nodes. +Note that it is best if the vCPU and Mem sizes of all of the instance types +are the same. + +Addons installed: +- aws-efs-csi-driver +- aws-ebs-csi-driver +- cluster-autoscaler +- coredns +- kube-proxy +- vpc-cni + +Note that at this stage, the csi-drivers are not configured. That takes place in the eks-storage-classes module. + ## Required Inputs **cluster_name** `string` diff --git a/examples/simple/eks.tf b/examples/simple/eks.tf new file mode 100644 index 0000000..1edd80b --- /dev/null +++ b/examples/simple/eks.tf @@ -0,0 +1,18 @@ +module "images" { + source = "git@github.it.census.gov:SOA/tfmod-eks.git//" + #source = "git@github.it.census.gov:SOA/tfmod-eks.git//?ref=v1.0.0" + + region = var.region + + profile = var.profile + vpc_name = var.vpc_name + + cluster_name = var.cluster_name + cluster_version = var.cluster_version + domain = var.domain + eks_instance_disk_size = var.eks_instance_disk_size + eks_instance_types = var.eks_instance_types + eks_ng_desired_size = var.eks_ng_desired_size + eks_ng_max_size = var.eks_ng_max_size + eks_ng_min_size = var.eks_ng_min_size +} diff --git a/examples/simple/variables.tf b/examples/simple/variables.tf new file mode 100644 index 0000000..92f8415 --- /dev/null +++ b/examples/simple/variables.tf @@ -0,0 +1,60 @@ +variable "cluster_name" { + description = "EKS cluster name name component used through out the EKS cluster describing its purpose (ex: dice-dev)" + type = string +} + +variable "cluster_version" { + description = "The Kubernetes version number to use for this EKS cluster. See https://docs.aws.amazon.com/eks/latest/userguide/kubernetes-versions.html" + type = string + default = "1.27" +} + +variable "region" { + description = "AWS region" + type = string +} + +variable "profile" { + description = "AWS Profile under which the scripts are run." + type = string +} + +variable "vpc_name" { + description = "AWS vpc in which the cluster will reside" + type = string +} + +variable "domain" { + description = "The DNS domain name of the cluster." + type = string +} + +variable "eks_instance_disk_size" { + description = "The size of the disk of the worker nodes in gigabytes. 40 is the approximate minimum. Needs to hold the all of the normal operating system files plus every image that will be used in the cluster." + type = number + default = 40 +} + +variable "eks_instance_types" { + description = "EKS worker node instance types" + type = list(string) + default = [ + "t3.xlarge" + ] +} + +variable "eks_ng_min_size" { + description = "Node Group minimum size" + type = number + default = 4 +} +variable "eks_ng_desired_size" { + description = "Node Group desired size" + type = number + default = 4 +} +variable "eks_ng_max_size" { + description = "Node Group maximum size" + type = number + default = 15 +}