From 8907927fab9bf122bd4f5ad0928abe6b9faec449 Mon Sep 17 00:00:00 2001 From: Spike Date: Thu, 9 May 2019 15:05:04 +0100 Subject: Adding autoscaling group for worker nodes, and kube config --- terraform/.terraform.tfstate.lock.info | 1 + terraform/ami.tf | 10 + terraform/asg.tf | 52 +++ terraform/config_map_aws_auth.yaml | 15 + terraform/kubeconfig.tf | 58 +++ terraform/terraform.tfstate.backup | 689 ++++++++++++++++++++++++++++++++- 6 files changed, 821 insertions(+), 4 deletions(-) create mode 100644 terraform/.terraform.tfstate.lock.info create mode 100644 terraform/ami.tf create mode 100644 terraform/asg.tf create mode 100644 terraform/config_map_aws_auth.yaml create mode 100644 terraform/kubeconfig.tf diff --git a/terraform/.terraform.tfstate.lock.info b/terraform/.terraform.tfstate.lock.info new file mode 100644 index 0000000..de6813e --- /dev/null +++ b/terraform/.terraform.tfstate.lock.info @@ -0,0 +1 @@ +{"ID":"e347799f-fa96-ed03-5663-aae5487d44e6","Operation":"OperationTypeApply","Info":"","Who":"hen3ry@Hen3ry-Desktop","Version":"0.11.11","Created":"2019-05-09T14:04:09.175346174Z","Path":"terraform.tfstate"} \ No newline at end of file diff --git a/terraform/ami.tf b/terraform/ami.tf new file mode 100644 index 0000000..47dc01f --- /dev/null +++ b/terraform/ami.tf @@ -0,0 +1,10 @@ +data "aws_ami" "eks-worker" { + filter { + name = "name" + values = ["amazon-eks-node-${aws_eks_cluster.sensyne_demo_cluster.version}-v*"] + } + + most_recent = true + owners = ["602401143452"] # Amazon EKS AMI Account ID +} + diff --git a/terraform/asg.tf b/terraform/asg.tf new file mode 100644 index 0000000..8c6e7a0 --- /dev/null +++ b/terraform/asg.tf @@ -0,0 +1,52 @@ +# This data source is included for ease of sample architecture deployment +# and can be swapped out as necessary. +data "aws_region" "current" {} + +# EKS currently documents this required userdata for EKS worker nodes to +# properly configure Kubernetes applications on the EC2 instance. +# We utilize a Terraform local here to simplify Base64 encoding this +# information into the AutoScaling Launch Configuration. +# More information: https://docs.aws.amazon.com/eks/latest/userguide/launch-workers.html +locals { + demo-node-userdata = <