Skip to content

Commit

Permalink
move karpenter into layer2-k8s instead of using a separate module
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Glotov committed Jan 5, 2024
1 parent a195a47 commit 0ce4dea
Show file tree
Hide file tree
Showing 16 changed files with 314 additions and 684 deletions.
1 change: 0 additions & 1 deletion terraform/layer1-aws/aws-eks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ module "eks" {

}
}
# iam_role_additional_policies = var.eks_workers_additional_policies
metadata_options = {
http_endpoint = "enabled"
http_tokens = "required"
Expand Down
13 changes: 8 additions & 5 deletions terraform/layer1-aws/aws-vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ module "vpc" {
database_subnets = local.database_subnets
intra_subnets = local.intra_subnets

single_nat_gateway = var.single_nat_gateway
enable_nat_gateway = true
enable_vpn_gateway = false
enable_dns_hostnames = true
enable_dns_support = true
single_nat_gateway = var.single_nat_gateway
enable_nat_gateway = true
enable_vpn_gateway = false
enable_dns_hostnames = true
enable_dns_support = true
map_public_ip_on_launch = true

create_database_subnet_group = false

Expand All @@ -47,6 +48,7 @@ module "vpc" {
private_subnet_tags = {
Name = "${local.name}-private"
destination = "private"
"karpenter.sh/discovery" = "private"
"kubernetes.io/role/internal-elb" = "1"
}

Expand All @@ -58,6 +60,7 @@ module "vpc" {
public_subnet_tags = {
Name = "${local.name}-public"
destination = "public"
"karpenter.sh/discovery" = "public"
"kubernetes.io/role/elb" = "1"
}

Expand Down
4 changes: 0 additions & 4 deletions terraform/layer1-aws/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,6 @@ output "ssl_certificate_arn" {
value = local.ssl_certificate_arn
}

output "node_group_default_iam_instance_profile_id" {
value = module.eks.self_managed_node_groups["default"].iam_instance_profile_id
}

output "node_group_default_iam_role_arn" {
value = module.eks.self_managed_node_groups["default"].iam_role_arn
}
Expand Down
8 changes: 0 additions & 8 deletions terraform/layer1-aws/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,6 @@ variable "eks_cluster_version" {
description = "Version of the EKS K8S cluster"
}

# variable "eks_workers_additional_policies" {
# type = map(string)
# default = {
# additional = "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore"
# }
# description = "Additional IAM policy attached to EKS worker nodes"
# }

variable "node_group_default" {
type = object({
instance_type = string
Expand Down
188 changes: 0 additions & 188 deletions terraform/layer2-k8s/eks-cluster-autoscaler.tf

This file was deleted.

Loading

0 comments on commit 0ce4dea

Please sign in to comment.