Skip to content

Commit

Permalink
[tf][aws] update to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
rustielin committed Aug 16, 2022
1 parent b79ca74 commit 18e030b
Show file tree
Hide file tree
Showing 25 changed files with 182 additions and 1,880 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ terraform/validator/*/*-kube.config
terraform/validator/vault-init/backend.tf
terraform/testnet/*-kubernetes.json
terraform/testnet/*-vault.ca
.terraform.lock.hcl

# Move Build Output
build/
Expand Down
64 changes: 57 additions & 7 deletions terraform/aptos-node-testnet/addons.tf
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,63 @@ resource "helm_release" "chaos-mesh" {
}
}

// service account used for all external AWS-facing services, such as ALB ingress controller and External-DNS
resource "kubernetes_service_account" "k8s-aws-integrations" {
metadata {
name = "k8s-aws-integrations"
namespace = "kube-system"
annotations = {
"eks.amazonaws.com/role-arn" = aws_iam_role.k8s-aws-integrations.arn
}
}
}

# when upgrading the AWS ALB ingress controller, update the CRDs as well using:
# kubectl apply -k "github.com/aws/eks-charts/stable/aws-load-balancer-controller/crds?ref=master"
resource "helm_release" "aws-load-balancer-controller" {
name = "aws-load-balancer-controller"
repository = "https://aws.github.io/eks-charts"
chart = "aws-load-balancer-controller"
version = "1.4.3"
namespace = "kube-system"
max_history = 5
wait = false

values = [
jsonencode({
serviceAccount = {
create = false
name = kubernetes_service_account.k8s-aws-integrations.metadata[0].name
}
clusterName = module.validator.aws_eks_cluster.name
region = var.region
vpcId = module.validator.vpc_id
})
]
}

resource "helm_release" "external-dns" {
count = var.zone_id != "" ? 1 : 0
name = "external-dns"
repository = "https://kubernetes-sigs.github.io/external-dns"
chart = "external-dns"
version = "1.11.0"
namespace = "kube-system"
max_history = 5
wait = false

values = [
jsonencode({
serviceAccount = {
create = false
name = kubernetes_service_account.k8s-aws-integrations.metadata[0].name
}
domainFilters = var.zone_id != "" ? [data.aws_route53_zone.aptos[0].name] : []
txtOwnerId = var.zone_id
})
]
}

resource "helm_release" "testnet-addons" {
name = "testnet-addons"
chart = local.testnet_addons_helm_chart_path
Expand All @@ -165,13 +222,6 @@ resource "helm_release" "testnet-addons" {

values = [
jsonencode({
aws = {
region = var.region
cluster_name = module.validator.aws_eks_cluster.name
vpc_id = module.validator.vpc_id
role_arn = aws_iam_role.k8s-aws-integrations.arn
zone_name = var.zone_id != "" ? data.aws_route53_zone.aptos[0].name : null
}
genesis = {
era = var.era
username_prefix = local.aptos_node_helm_prefix
Expand Down
2 changes: 2 additions & 0 deletions terraform/aptos-node-testnet/auth.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ data "aws_iam_policy_document" "alb-ingress" {
"ec2:DeleteTags",
"ec2:DeleteSecurityGroup",
"ec2:DescribeAccountAttributes",
# https://github.com/kubernetes-sigs/aws-load-balancer-controller/issues/2525
"ec2:DescribeAddresses",
"ec2:DescribeAvailabilityZones",
"ec2:DescribeInstances",
"ec2:DescribeInstanceStatus",
"ec2:DescribeInternetGateways",
Expand Down
2 changes: 0 additions & 2 deletions terraform/aptos-node/aws/aws-calico/.helmignore

This file was deleted.

5 changes: 0 additions & 5 deletions terraform/aptos-node/aws/aws-calico/Chart.yaml

This file was deleted.

214 changes: 0 additions & 214 deletions terraform/aptos-node/aws/aws-calico/crds/calico.yaml

This file was deleted.

Loading

0 comments on commit 18e030b

Please sign in to comment.