Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add installation configure of LH GuaranteedInstanceManagerCPU #706

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ type LHDefaultSettings struct {
// 0 is valid, means not setting CPU resources, use pointer to check if it is set
GuaranteedEngineManagerCPU *uint32 `json:"guaranteedEngineManagerCPU,omitempty"`
GuaranteedReplicaManagerCPU *uint32 `json:"guaranteedReplicaManagerCPU,omitempty"`
// from Longhorn v1.5.0, LH merges the above two into one
// the above two are not used afterwards, but Harvester keeps them for compatibility
GuaranteedInstanceManagerCPU *uint32 `json:"guaranteedInstanceManagerCPU,omitempty"`
}

type LonghornChartValues struct {
Expand Down
15 changes: 10 additions & 5 deletions pkg/config/cos.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ const (
ifcfgGlobPattern = networkConfigDirectory + "ifcfg-*"
ifrouteGlobPattern = networkConfigDirectory + "ifroute-*"

bootstrapConfigCount = 6
defaultReplicaCount = 3
defaultGuaranteedEngineManagerCPU = 12 // means percentage 12%
defaultGuaranteedReplicaManagerCPU = 12 // means percentage 12%
defaultSystemImageSize = 3072 // size of /run/initramfs/cos-state/cOS/active.img in MB
bootstrapConfigCount = 6
defaultReplicaCount = 3
defaultGuaranteedEngineManagerCPU = 12 // means percentage 12%
defaultGuaranteedReplicaManagerCPU = 12 // means percentage 12%
defaultGuaranteedInstanceManagerCPU = 12 // means percentage 12%
defaultSystemImageSize = 3072 // size of /run/initramfs/cos-state/cOS/active.img in MB
)

var (
Expand Down Expand Up @@ -280,6 +281,10 @@ func setConfigDefaultValues(config *HarvesterConfig) {
if config.Harvester.Longhorn.DefaultSettings.GuaranteedReplicaManagerCPU != nil && *config.Harvester.Longhorn.DefaultSettings.GuaranteedReplicaManagerCPU > defaultGuaranteedReplicaManagerCPU {
*config.Harvester.Longhorn.DefaultSettings.GuaranteedReplicaManagerCPU = defaultGuaranteedReplicaManagerCPU
}

if config.Harvester.Longhorn.DefaultSettings.GuaranteedInstanceManagerCPU != nil && *config.Harvester.Longhorn.DefaultSettings.GuaranteedInstanceManagerCPU > defaultGuaranteedInstanceManagerCPU {
*config.Harvester.Longhorn.DefaultSettings.GuaranteedInstanceManagerCPU = defaultGuaranteedInstanceManagerCPU
}
}

func initRancherdStage(config *HarvesterConfig, stage *yipSchema.Stage) error {
Expand Down
7 changes: 2 additions & 5 deletions pkg/config/templates/rancherd-10-harvester.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,8 @@ resources:
defaultSettings:
taintToleration: "kubevirt.io/drain:NoSchedule"
defaultDataPath: "/var/lib/harvester/defaultdisk"
{{- if .Harvester.Longhorn.DefaultSettings.GuaranteedEngineManagerCPU }}
guaranteedEngineManagerCPU: {{ .Harvester.Longhorn.DefaultSettings.GuaranteedEngineManagerCPU }}
{{- end }}
{{- if .Harvester.Longhorn.DefaultSettings.GuaranteedReplicaManagerCPU }}
guaranteedReplicaManagerCPU: {{ .Harvester.Longhorn.DefaultSettings.GuaranteedReplicaManagerCPU }}
{{- if .Harvester.Longhorn.DefaultSettings.GuaranteedInstanceManagerCPU }}
guaranteedInstanceManagerCPU: {{ .Harvester.Longhorn.DefaultSettings.GuaranteedInstanceManagerCPU }}
{{- end }}
harvester-network-controller:
enabled: true
Expand Down
Loading