Skip to content

Commit

Permalink
Merge pull request #10 from arcegacardenas/troubleshooting-module-rob…
Browse files Browse the repository at this point in the history
…isoh88

removed comments and changed workernodes website weights
  • Loading branch information
arcegacardenas authored Nov 19, 2024
2 parents bd2cfef + be2f679 commit 4232d52
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,6 @@ locals {
}
}


# data "aws_vpc" "selected" {
# tags = {
# created-by = "eks-workshop-v2"
# env = var.addon_context.eks_cluster_id
# }
# }

# data "aws_subnets" "public" {
# tags = {
# created-by = "eks-workshop-v2"
# env = var.addon_context.eks_cluster_id
# }
# }
# filter {
# name = "tag:Name"
# values = ["*Public*"]
# }

data "aws_eks_cluster" "cluster" {
name = var.eks_cluster_id
}
Expand All @@ -58,14 +39,6 @@ data "aws_eks_node_group" "default" {
node_group_name = "default"
}

# data "aws_subnet" "default_nodegroup_subnet" {
# id = tolist(data.aws_eks_node_group.default.subnet_ids)[0]
# }

# data "aws_nat_gateway" "default_nodegroup_nat" {
# subnet_id = data.aws_subnet.default_nodegroup_subnet.id
# }

data "aws_vpc" "selected" {
tags = {
created-by = "eks-workshop-v2"
Expand All @@ -85,11 +58,6 @@ data "aws_nat_gateways" "cluster_nat_gateways" {
name = "state"
values = ["available"]
}

# filter {
# name = "tag:created-by"
# values = ["eks-workshop-v2"]
# }
}

# Create a new subnet
Expand Down Expand Up @@ -159,14 +127,11 @@ resource "aws_eks_node_group" "new_nodegroup_2" {
aws_subnet.new_subnet,
aws_route_table_association.new_subnet_association,
]
# # Allow Terraform to delete the node group
# force_delete = true

# combine local tags with resource-specific tags
tags = merge(local.tags, {
Name = "troubleshooting-new-node-group"
})
# helps manage updates more smoothly
lifecycle {
create_before_destroy = true
}
Expand All @@ -189,14 +154,8 @@ resource "null_resource" "increase_desired_count" {
command = "aws eks update-nodegroup-config --cluster-name ${data.aws_eks_cluster.cluster.id} --nodegroup-name new_nodegroup_2 --scaling-config minSize=0,maxSize=2,desiredSize=1"

when = create
# environment = {
# AWS_DEFAULT_REGION = "us-west-2" # Replace with any region
# }
}
# provisioner "local-exec" {
# when = destroy
# command = "aws eks update-nodegroup-config --cluster-name ${self.triggers.cluster_name} --nodegroup-name ${self.triggers.node_group_name} --scaling-config minSize=0,maxSize=2,desiredSize=0"
# }
}

depends_on = [aws_eks_node_group.new_nodegroup_2]
}

Expand All @@ -221,11 +180,3 @@ data "aws_instances" "new_nodegroup_2_instances" {
depends_on = [null_resource.wait_for_instance]
}


# data "aws_instances" "new_nodegroup_2_instances" {
# instance_tags = {
# "aws:autoscaling:groupName" = data.aws_autoscaling_group.new_nodegroup_2.name
# }
# instance_state_names = ["running"]
# depends_on = [null_resource.increase_desired_count]
# }
2 changes: 1 addition & 1 deletion website/docs/troubleshooting/workernodes/three/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Node in Not-Ready state"
sidebar_position: 72
sidebar_position: 73
chapter: true
sidebar_custom_props: { "module": true }
---
Expand Down
2 changes: 1 addition & 1 deletion website/docs/troubleshooting/workernodes/two/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Node Join Failure"
sidebar_position: 73
sidebar_position: 72
chapter: true
sidebar_custom_props: { "module": true }
---
Expand Down

0 comments on commit 4232d52

Please sign in to comment.