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

Commit

Permalink
Revert "Merge pull request #1405 from kinvolk/imran/baremetal-node-sp…
Browse files Browse the repository at this point in the history
…ecific-labels"

This reverts commit a495c72, reversing
changes made to 0736a32.

Signed-off-by: Imran Pochi <imran@kinvolk.io>
  • Loading branch information
ipochi committed Mar 11, 2021
1 parent 516dd41 commit 860af3d
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 198 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module "controller" {
ssh_keys = var.ssh_keys
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
}
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,3 @@ variable "install_to_smallest_disk" {
type = bool
default = false
}

variable "node_specific_labels" {
type = map(map(string))
description = "Map of node specific labels map."
default = {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module "worker" {
cluster_domain_suffix = var.cluster_domain_suffix
ca_cert = module.bootkube.ca_cert
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)
kubelet_labels = var.labels
cluster_name = var.cluster_name
clc_snippets = lookup(var.clc_snippets, var.worker_names[count.index], [])
set_standard_hostname = true
Expand Down
4 changes: 2 additions & 2 deletions assets/terraform-modules/controller/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ data "ct_config" "config" {
kubelet_image_tag = var.kubelet_image_tag
kubelet_docker_extra_args = []
hostname = var.set_standard_hostname == true ? "${var.cluster_name}-controller-${var.count_index}" : ""
kubelet_labels = merge(var.kubelet_labels, {
kubelet_labels = {
"node.kubernetes.io/master" = "",
"node.kubernetes.io/controller" = "true",
})
}
kubelet_taints = {
"node-role.kubernetes.io/master" = ":NoSchedule"
}
Expand Down
6 changes: 0 additions & 6 deletions assets/terraform-modules/controller/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,3 @@ variable "set_standard_hostname" {
description = "Sets the hostname if true. Hostname is set as <cluster_name>-controller-<count_index>"
default = false
}

variable "kubelet_labels" {
type = map(string)
description = "Node labels passed to kubelet --node-labels flag. E.g. { { \"node.kubernetes.io/node\" = \"\" }"
default = {}
}
14 changes: 0 additions & 14 deletions ci/baremetal/baremetal-cluster.lokocfg.envsubst
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,6 @@ cluster "bare-metal" {
"roleofnode" = "testing",
}

node_specific_labels = {
"node1" = {
"testkey": "testvalue"
}

"node2" = {
"ingressnode": "yes"
}

"node3" = {
"storagenode": "yes"
}
}

conntrack_max_per_core = 65000

install_to_smallest_disk = "true"
Expand Down
88 changes: 34 additions & 54 deletions docs/configuration-reference/platforms/baremetal.md

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions pkg/assets/generated_assets.go

Large diffs are not rendered by default.

10 changes: 2 additions & 8 deletions pkg/platform/baremetal/baremetal.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ import (
"github.com/kinvolk/lokomotive/pkg/terraform"
)

// Labels represent the map of key value string pairs added the kubelet.
type Labels map[string]string

type config struct {
AssetDir string `hcl:"asset_dir"`
CachedInstall string `hcl:"cached_install,optional"`
Expand All @@ -54,8 +51,7 @@ type config struct {
WorkerNames []string `hcl:"worker_names"`
WorkerMacs []string `hcl:"worker_macs"`
WorkerDomains []string `hcl:"worker_domains"`
Labels Labels `hcl:"labels,optional"`
NodeSpecificLabels map[string]Labels `hcl:"node_specific_labels,optional"`
Labels map[string]string `hcl:"labels,optional"`
OIDC *oidc.Config `hcl:"oidc,block"`
EncryptPodTraffic bool `hcl:"encrypt_pod_traffic,optional"`
IgnoreX509CNCheck bool `hcl:"ignore_x509_cn_check,optional"`
Expand Down Expand Up @@ -224,8 +220,7 @@ func createTerraformConfigFile(cfg *config, terraformPath string) error {
WorkerDomains string
DisableSelfHostedKubelet bool
KubeAPIServerExtraFlags []string
Labels Labels
NodeSpecificLabels map[string]Labels
Labels map[string]string
EncryptPodTraffic bool
IgnoreX509CNCheck bool
ConntrackMaxPerCore int
Expand Down Expand Up @@ -257,7 +252,6 @@ func createTerraformConfigFile(cfg *config, terraformPath string) error {
DisableSelfHostedKubelet: cfg.DisableSelfHostedKubelet,
KubeAPIServerExtraFlags: cfg.KubeAPIServerExtraFlags,
Labels: cfg.Labels,
NodeSpecificLabels: cfg.NodeSpecificLabels,
EncryptPodTraffic: cfg.EncryptPodTraffic,
IgnoreX509CNCheck: cfg.IgnoreX509CNCheck,
ConntrackMaxPerCore: cfg.ConntrackMaxPerCore,
Expand Down
14 changes: 0 additions & 14 deletions pkg/platform/baremetal/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,6 @@ module "bare-metal-{{.ClusterName}}" {
}
{{- end}}
{{- if .NodeSpecificLabels}}
node_specific_labels = {
{{- range $nodeName, $mapOfLabels := .NodeSpecificLabels}}
{{- if $mapOfLabels }}
"{{$nodeName}}" = {
{{- range $key, $value := $mapOfLabels }}
"{{$key}}" = "{{$value}}",
{{- end }}
}
{{- end }}
{{- end }}
}
{{- end }}
ignore_x509_cn_check = {{.IgnoreX509CNCheck}}
conntrack_max_per_core = {{.ConntrackMaxPerCore}}
Expand Down
82 changes: 0 additions & 82 deletions test/components/kubernetes/baremetal_kubelet_labels_test.go

This file was deleted.

0 comments on commit 860af3d

Please sign in to comment.