Skip to content

Commit

Permalink
Merge pull request #230 from klihub/backports/release-0.3/update-ball…
Browse files Browse the repository at this point in the history
…oons-config

[release-0.3/#222] pkg/apis, helm: update balloons config/CRD.
  • Loading branch information
fmuyassarov committed Jan 12, 2024
2 parents e39907b + c0fb898 commit cf661c6
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 7 deletions.
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ allclean: clean clean-cache

test: test-gopkgs

verify: verify-godeps verify-fmt
verify: verify-godeps verify-fmt verify-generate

#
# build targets
Expand Down Expand Up @@ -372,6 +372,17 @@ verify-fmt:
exit 1; \
fi

verify-generate: generate
$(Q) git diff --quiet; ec="$$?"; \
if [ "$$ec" != "0" ]; then \
echo "ERROR: generated artifacts are not up-to-date."; \
echo "ERROR:"; \
git --no-pager diff | sed 's/^/ERROR: /g'; \
echo "ERROR:"; \
echo "ERROR: please run 'make generate' and commit these changes."; \
exit "$$ec"; \
fi

#
# targets for installing dependencies
#
Expand Down
7 changes: 6 additions & 1 deletion config/crd/bases/config.nri_balloonspolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ spec:
items:
type: string
type: array
preferCloseToDevices:
description: 'PreferCloseToDevices: prefer creating new balloons
of this type close to listed devices.'
items:
type: string
type: array
preferNewBalloons:
description: 'PreferNewBalloons: prefer creating new balloons
over adding containers to existing balloons. The default is
Expand Down Expand Up @@ -297,7 +303,6 @@ spec:
description: Reserved (CPU) resources for kube-system namespace.
type: object
required:
- idleCPUClass
- reservedResources
type: object
status:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ spec:
type: string
type: array
preferCloseToDevices:
description: prefer creating new balloons of this type close to listed devices.
description: 'PreferCloseToDevices: prefer creating new balloons
of this type close to listed devices.'
items:
type: string
type: array
Expand Down Expand Up @@ -302,7 +303,6 @@ spec:
description: Reserved (CPU) resources for kube-system namespace.
type: object
required:
- idleCPUClass
- reservedResources
type: object
status:
Expand Down
8 changes: 5 additions & 3 deletions pkg/apis/config/v1alpha1/resmgr/policy/balloons/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type Config struct {
PinMemory *bool `json:"pinMemory,omitempty"`
// IdleCpuClass controls how unusded CPUs outside any a
// balloons are (re)configured.
IdleCpuClass string `json:"idleCPUClass",omitempty"`
IdleCpuClass string `json:"idleCPUClass,omitempty"`
// ReservedPoolNamespaces is a list of namespace globs that
// will be allocated to reserved CPUs.
ReservedPoolNamespaces []string `json:"reservedPoolNamespaces,omitempty"`
Expand Down Expand Up @@ -185,10 +185,12 @@ type BalloonDef struct {
ShareIdleCpusInSame CPUTopologyLevel `json:"shareIdleCPUsInSame,omitempty"`
// PreferCloseToDevices: prefer creating new balloons of this
// type close to listed devices.
PreferCloseToDevices []string `json:"preferCloseToDevices",omitempty`
PreferCloseToDevices []string `json:"preferCloseToDevices,omitempty"`
// PreferFarFromDevices: prefer creating new balloons of this
// type far from listed devices.
PreferFarFromDevices []string `json:"preferFarFromDevices",omitempty`
// TODO: PreferFarFromDevices is considered too untested for usage. Hence,
// for the time being we prevent its usage through CRDs.
PreferFarFromDevices []string `json:"-"`
}

// String stringifies a BalloonDef
Expand Down

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

0 comments on commit cf661c6

Please sign in to comment.