Skip to content

Commit

Permalink
Add node_labels variable to aws/container-linux/kubernetes/. Applies …
Browse files Browse the repository at this point in the history
…to worker nodes.
  • Loading branch information
valer-cara committed Sep 24, 2019
1 parent 078f084 commit 0dea9e4
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions aws/container-linux/kubernetes/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,9 @@ variable "enable_aggregation" {
default = "false"
}

variable "node_labels" {
description = "List of additional labels to add to worker nodes"
type = list
default = []
}

1 change: 1 addition & 0 deletions aws/container-linux/kubernetes/workers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ module "workers" {
service_cidr = var.service_cidr
cluster_domain_suffix = var.cluster_domain_suffix
clc_snippets = var.worker_clc_snippets
node_labels = var.node_labels
}

3 changes: 3 additions & 0 deletions aws/container-linux/kubernetes/workers/cl/worker.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ systemd:
--lock-file=/var/run/lock/kubelet.lock \
--network-plugin=cni \
--node-labels=node.kubernetes.io/node \
%{ for label in split(";", node_labels) }
--node-labels=${label} \
%{ endfor ~}
--pod-manifest-path=/etc/kubernetes/manifests \
--read-only-port=0 \
--volume-plugin-dir=/var/lib/kubelet/volumeplugins
Expand Down
5 changes: 5 additions & 0 deletions aws/container-linux/kubernetes/workers/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,8 @@ variable "cluster_domain_suffix" {
default = "cluster.local"
}

variable "node_labels" {
description = "List of additional labels to add to worker nodes"
type = list
default = []
}
1 change: 1 addition & 0 deletions aws/container-linux/kubernetes/workers/workers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ data "template_file" "worker-config" {
cluster_dns_service_ip = cidrhost(var.service_cidr, 10)
cluster_domain_suffix = var.cluster_domain_suffix
cgroup_driver = local.flavor == "flatcar" && local.channel == "edge" ? "systemd" : "cgroupfs"
node_labels = join(";", var.node_labels)
}
}

0 comments on commit 0dea9e4

Please sign in to comment.