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

Commit

Permalink
packet: Add --cpu-manager-policy to kubelet
Browse files Browse the repository at this point in the history
This add flag to worker pools, also added a knob for user to configure
it.

closes: #1337
Signed-off-by: knrt10 <[email protected]>
  • Loading branch information
knrt10 committed Mar 1, 2021
1 parent 87e9c0d commit c7db768
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ systemd:
--cloud-provider=external \
--cni-conf-dir=/etc/cni/net.d \
--config=/etc/kubernetes/kubelet.config \
--cpu-manager-policy=${cpu_manager_policy} \
--exit-on-lock-contention \
%{~ if enable_tls_bootstrap ~}
--kubeconfig=/var/lib/kubelet/kubeconfig \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,9 @@ variable "enable_tls_bootstrap" {
description = "Enable TLS Bootstrap for Kubelet."
type = bool
}

variable "cpu_manager_policy" {
description = "CPU Manager policy to use for. Possible values: `none`, `static` for --cpu-manager-policy flag in kubelet."
default = "none"
type = string
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ data "ct_config" "ignitions" {
cluster_domain_suffix = var.cluster_domain_suffix
node_labels = merge({
"node.kubernetes.io/node" = "",
"lokomotive.alpha.kinvolk.io/bgp-enabled" = format("%t", !var.disable_bgp),
"lokomotive.alpha.kinvolk.io/bgp-enabled" = format("%t", ! var.disable_bgp),
}, var.labels)
taints = var.taints
setup_raid = var.setup_raid
Expand All @@ -69,6 +69,7 @@ data "ct_config" "ignitions" {
cluster_name = var.cluster_name
dns_zone = var.dns_zone
enable_tls_bootstrap = var.enable_tls_bootstrap
cpu_manager_policy = var.cpu_manager_policy
}
)
platform = "packet"
Expand Down
115 changes: 58 additions & 57 deletions docs/configuration-reference/platforms/packet.md

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions pkg/assets/generated_assets.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pkg/platform/packet/packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const (
type workerPool struct {
Name string `hcl:"pool_name,label"`
Count int `hcl:"count"`
CPUManagerPolicy string `hcl:"cpu_manager_policy,optional"`
DisableBGP bool `hcl:"disable_bgp,optional"`
IPXEScriptURL string `hcl:"ipxe_script_url,optional"`
OSArch string `hcl:"os_arch,optional"`
Expand Down
2 changes: 2 additions & 0 deletions pkg/platform/packet/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ EOF
cluster_name = "{{$.Config.ClusterName}}"
cpu_manager_policy = "{{$pool.CPUManagerPolicy}}"
{{- if $pool.Tags }}
tags = [
{{- range $key, $value := $pool.Tags }}
Expand Down

0 comments on commit c7db768

Please sign in to comment.