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

1811 adding missing general node selectors/affinity to core components #2214

Closed
Closed
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 @@ -63,9 +63,34 @@ data "aws_eks_cluster_auth" "main" {

resource "aws_eks_addon" "aws-ebs-csi-driver" {
# required for Kubernetes v1.23+ on AWS
addon_name = "aws-ebs-csi-driver"
cluster_name = aws_eks_cluster.main.name
resolve_conflicts = "OVERWRITE"
Copy link
Member

@Adam-D-Lewis Adam-D-Lewis Mar 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addon_name = "aws-ebs-csi-driver"
cluster_name = aws_eks_cluster.main.name

configuration_values = jsonencode({
controller = {
nodeSelector = {
"eks.amazonaws.com/nodegroup" = "general"
}
}
})

# Ensure cluster and node groups are created
depends_on = [
aws_eks_cluster.main,
aws_eks_node_group.main,
]
}

resource "aws_eks_addon" "coredns" {
addon_name = "coredns"
cluster_name = aws_eks_cluster.main.name

configuration_values = jsonencode({
nodeSelector = {
"eks.amazonaws.com/nodegroup" = "general"
}
})

# Ensure cluster and node groups are created
depends_on = [
aws_eks_cluster.main,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ resource "aws_vpc" "main" {

enable_dns_support = true
enable_dns_hostnames = true
enable_classiclink = false
Copy link
Member

@Adam-D-Lewis Adam-D-Lewis Mar 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing to change here, just a note.
Note: This was removed since it's no longer supported as of August 23, 2023 - https://aws.amazon.com/blogs/aws/ec2-classic-is-retiring-heres-how-to-prepare/


tags = merge({ Name = var.name }, var.tags, var.vpc_tags)
}
Expand Down
2 changes: 1 addition & 1 deletion src/_nebari/stages/infrastructure/template/aws/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "3.73.0"
version = "5.33.0"
}
}
required_version = ">= 1.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,24 @@ resource "helm_release" "autoscaler" {
clusterName = var.cluster-name
enabled = true
}

affinity = {
nodeAffinity = {
requiredDuringSchedulingIgnoredDuringExecution = {
nodeSelectorTerms = [
{
matchExpressions = [
{
key = "eks.amazonaws.com/nodegroup"
operator = "In"
values = ["general"]
}
]
}
]
}
}
}
})
], var.overrides)
}
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,23 @@ resource "kubernetes_manifest" "deployment_admission_controller" {
}
},
]
affinity = {
nodeAffinity = {
requiredDuringSchedulingIgnoredDuringExecution = {
nodeSelectorTerms = [
{
matchExpressions = [
{
key = var.node-group.key
operator = "In"
values = [var.node-group.value]
}
]
}
]
}
}
}
}
}
}
Expand Down
Loading