Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed comments and changed workernodes website weights #10

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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