mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-01-19 10:08:00 +01:00
Merge pull request #53 from bshelton229/kubelet-node-labels
Kubelet node labels
This commit is contained in:
@@ -9,7 +9,7 @@ project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
### Added
|
||||
|
||||
- your excellent addition. (Hat-tip, @self 👒)
|
||||
- kubelet_node_labels worker group option allows setting --node-labels= in kubelet. (Hat-tip, @bshelton229 👒)
|
||||
|
||||
### Changed
|
||||
|
||||
|
||||
1
data.tf
1
data.tf
@@ -94,5 +94,6 @@ data template_file userdata {
|
||||
max_pod_count = "${lookup(local.max_pod_per_node, lookup(var.worker_groups[count.index], "instance_type", lookup(var.workers_group_defaults, "instance_type")))}"
|
||||
pre_userdata = "${lookup(var.worker_groups[count.index], "pre_userdata",lookup(var.workers_group_defaults, "pre_userdata"))}"
|
||||
additional_userdata = "${lookup(var.worker_groups[count.index], "additional_userdata",lookup(var.workers_group_defaults, "additional_userdata"))}"
|
||||
kubelet_node_labels = "${lookup(var.worker_groups[count.index], "kubelet_node_labels",lookup(var.workers_group_defaults, "kubelet_node_labels"))}"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,11 @@ CA_CERTIFICATE_FILE_PATH=$CA_CERTIFICATE_DIRECTORY/ca.crt
|
||||
mkdir -p $CA_CERTIFICATE_DIRECTORY
|
||||
echo "${cluster_auth_base64}" | base64 -d >$CA_CERTIFICATE_FILE_PATH
|
||||
|
||||
# Authenticatoin
|
||||
# Set kubelet --node-labels if kubelet_node_labels were set
|
||||
KUBELET_NODE_LABELS=${kubelet_node_labels}
|
||||
if [[ $KUBELET_NODE_LABELS != "" ]]; then sed -i '/INTERNAL_IP/a \ \ --node-labels='"$KUBELET_NODE_LABELS"'\ \\' /etc/systemd/system/kubelet.service; fi
|
||||
|
||||
# Authentication
|
||||
INTERNAL_IP=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4)
|
||||
sed -i s,MASTER_ENDPOINT,${endpoint},g /var/lib/kubelet/kubeconfig
|
||||
sed -i s,CLUSTER_NAME,${cluster_name},g /var/lib/kubelet/kubeconfig
|
||||
|
||||
@@ -66,6 +66,7 @@ variable "workers_group_defaults" {
|
||||
additional_userdata = "" # userdata to append to the default userdata.
|
||||
ebs_optimized = true # sets whether to use ebs optimization on supported types.
|
||||
public_ip = false # Associate a public ip address with a worker
|
||||
kubelet_node_labels = "" # This string is passed directly to kubelet via --node-lables= if set. It should be comma delimited with no spaces. If left empty no --node-labels switch is added.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user