Skip to content

Commit b6fca9f

Browse files
authored
Merge pull request #117 from deric/kubelet_labels
Kubelet labels
2 parents a585efa + ce2f4f8 commit b6fca9f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: manifests/node/kubelet.pp

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# @param ca_cert path to the ca cert
77
# @param cert path to node cert file
88
# @param cert_path path to cert files
9+
# @param labels node labels to be set on initial node registration
910
# @param config additional config to pass to kubelet
1011
# @param control_plane_url cluster API connection
1112
# @param ensure set ensure for installation or deinstallation
@@ -29,6 +30,7 @@
2930

3031
Hash[String, Data] $config = {},
3132
Hash[String, Data] $arguments = {},
33+
Hash[String, String] $labels = {},
3234
String $runtime = $k8s::container_manager,
3335
String $runtime_service = $k8s::container_runtime_service,
3436
String[1] $puppetdb_discovery_tag = $k8s::node::puppetdb_discovery_tag,
@@ -224,6 +226,8 @@
224226
$_node_ip = undef
225227
}
226228

229+
$_labels = $labels.map |$k, $v| { "${k}=${v}" }.join(',')
230+
227231
$_args = k8s::format_arguments({
228232
config => '/etc/kubernetes/kubelet.conf',
229233
kubeconfig => $kubeconfig,
@@ -232,6 +236,7 @@
232236
container_runtime_endpoint => $_runtime_endpoint,
233237
hostname_override => fact('networking.fqdn'),
234238
node_ip => $_node_ip,
239+
node_labels => $_labels,
235240
} + $arguments)
236241

237242
file { "${k8s::sysconfig_path}/kubelet":

0 commit comments

Comments
 (0)