Skip to content

Commit

Permalink
add tolerations to Karpenter controllers for dmz nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
baixiac committed Feb 2, 2024
1 parent dcc2daa commit 005785d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cluster/eks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module "eks" {
{
key : "dmz-pod",
operator : "Equal",
value : "false",
value : "yes",
effect : "NoExecute"
}
],
Expand Down Expand Up @@ -126,9 +126,10 @@ module "eks" {

# Do we need this in the general template?
taints = [{
key = "dmz-pod"
value = "false"
effect = "NO_EXECUTE"
key = "dmz-pod"
operator = "Equal"
value = "yes"
effect = "NO_EXECUTE"
}]

instance_types = var.instance_types
Expand Down
26 changes: 26 additions & 0 deletions config/karpenter.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,32 @@ resource "helm_release" "karpenter" {
name = "settings.aws.interruptionQueueName"
value = module.karpenter[0].queue_name
}

set {
name = "replicas"
value = 1 # The initial value should match var.dmz_node_size["desired"] defined in cluster/variables.tf
}

set {
name = "tolerations[0].key"
value = "dmz-pod"
}

set {
name = "tolerations[0].value"
value = "yes"
}

set {
name = "tolerations[0].operator"
value = "Equal"
}

set {
name = "tolerations[0].effect"
value = "NoExecute"
}

}

resource "kubectl_manifest" "karpenter_provisioner" {
Expand Down

0 comments on commit 005785d

Please sign in to comment.