Skip to content

Commit

Permalink
⬆️ Bump EKS version
Browse files Browse the repository at this point in the history
  • Loading branch information
joyliu-q committed Mar 18, 2023
1 parent d4eeec0 commit 80a1702
Show file tree
Hide file tree
Showing 5 changed files with 151 additions and 121 deletions.
206 changes: 114 additions & 92 deletions terraform/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 22 additions & 16 deletions terraform/eks.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
module "eks" {
source = "terraform-aws-modules/eks/aws"
version = "15.0.0"
version = "~> 19.0"
cluster_name = local.k8s_cluster_name
cluster_version = "1.23"
subnets = module.vpc.private_subnets
subnet_ids = module.vpc.private_subnets
vpc_id = module.vpc.vpc_id
write_kubeconfig = false
enable_irsa = true
map_roles = concat([
aws_auth_roles = concat([
for student, _ in var.students : {
rolearn = module.aws_accounts[student].role-arn, username = student, groups = []
}
Expand All @@ -18,19 +17,26 @@ module "eks" {
}
]
)
worker_groups_launch_template = [
{
self_managed_node_groups = {
worker_group = {
public_ip = true
name = "spot-1"
override_instance_types = ["t3.medium"]
spot_instance_pools = 1
// TODO: change to whatever size is needed
asg_max_size = 2
asg_desired_capacity = 2
kubelet_extra_args = "--node-labels=node.kubernetes.io/lifecycle=spot"
bootstrap_extra_args = "--use-max-pods false"
public_ip = true
},
]
min_size = 1
max_size = 2
desired_size = 2
instance_type = "t3.medium"
bootstrap_extra_args = "--node-labels=node.kubernetes.io/lifecycle=spot --use-max-pods false"
use_mixed_instances_policy = true
mixed_instances_policy = {
instances_distribution = {
spot_instance_pools = 4
}
override = [
{ instance_type = "t3.medium" },
]
}
}
}
tags = {
created-by = "terraform"
}
Expand Down
20 changes: 10 additions & 10 deletions terraform/k8s_cert_manager.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ resource "helm_release" "certs" {
]
}

resource "helm_release" "cert-grafana" {
name = "cert-grafana"
repository = "https://helm.pennlabs.org"
chart = "helm-wrapper"
version = "0.1.0"
values = [templatefile("cert-manager-files/cert.yaml", { NAME = "grafana" })]
# resource "helm_release" "cert-grafana" {
# name = "cert-grafana"
# repository = "https://helm.pennlabs.org"
# chart = "helm-wrapper"
# version = "0.1.0"
# values = [templatefile("cert-manager-files/cert.yaml", { NAME = "grafana" })]

depends_on = [
time_sleep.cert-manager-cr
]
}
# depends_on = [
# time_sleep.cert-manager-cr
# ]
# }
2 changes: 1 addition & 1 deletion terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ locals {
hw0 = true
hw1 = true
hw2 = true
hw3 = false
hw3 = true
hw4 = false
final_project = false
}
Expand Down
6 changes: 4 additions & 2 deletions terraform/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ provider "aws" {
provider "helm" {
kubernetes {
host = data.aws_eks_cluster.eks.endpoint

# client_certificate = base64decode(data.aws_eks_cluster_auth.eks.client_certificate)
# client_key = base64decode(data.aws_eks_cluster_auth.eks.client_key)
cluster_ca_certificate = base64decode(data.aws_eks_cluster.eks.certificate_authority.0.data)
token = data.aws_eks_cluster_auth.eks.token
}
}

provider "kubernetes" {
load_config_file = false
host = data.aws_eks_cluster.eks.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.eks.certificate_authority.0.data)
token = data.aws_eks_cluster_auth.eks.token
Expand All @@ -33,7 +35,7 @@ terraform {
}
kubernetes = {
source = "hashicorp/kubernetes"
version = "~> 1.13"
version = "2.18.1"
}
github = {
source = "hashicorp/github"
Expand Down

0 comments on commit 80a1702

Please sign in to comment.