Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
baremetal: sets hostname controller_names/worker_names
Browse files Browse the repository at this point in the history
Sets the hostname from the `<cluster_name>-worker-<count_index>` which
is set when `set_standard_hostname` is true, to
`controller_names<count_index>` for controllers and
`worker_names<count_index>` for workers

The hostname change got introduced by #1477 where it was set from the
template variable `domain_name` coming from
var.controller_domains[count.index]
  • Loading branch information
pothos authored and ipochi committed Jun 10, 2021
1 parent c1f853e commit ca0837e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ module "controller" {
apiserver = format("%s.%s", var.cluster_name, var.k8s_domain_name)
ca_cert = module.bootkube.ca_cert
kubelet_labels = lookup(var.node_specific_labels, var.controller_names[count.index], {})
clc_snippets = lookup(var.clc_snippets, var.controller_names[count.index], [])
set_standard_hostname = true
set_standard_hostname = false
clc_snippets = concat(lookup(var.clc_snippets, var.controller_names[count.index], []), [
<<EOF
storage:
files:
- path: /etc/hostname
filesystem: root
mode: 0644
contents:
inline: ${var.controller_names[count.index]}
EOF
,
])
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,18 @@ module "worker" {
apiserver = format("%s.%s", var.cluster_name, var.k8s_domain_name)
kubelet_labels = merge(lookup(var.node_specific_labels, var.worker_names[count.index], {}), var.labels)
cluster_name = var.cluster_name
clc_snippets = lookup(var.clc_snippets, var.worker_names[count.index], [])
set_standard_hostname = true
set_standard_hostname = false
clc_snippets = concat(lookup(var.clc_snippets, var.worker_names[count.index], []), [
<<EOF
storage:
files:
- path: /etc/hostname
filesystem: root
mode: 0644
contents:
inline: ${var.worker_names[count.index]}
EOF
,
])
}

8 changes: 4 additions & 4 deletions pkg/assets/generated_assets.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ca0837e

Please sign in to comment.