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

build: update to controller-tools 0.14.0. #263

Merged
merged 3 commits into from
Feb 13, 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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ CLIENT_GEN ?= $(LOCALBIN)/client-gen
GIT_CLONE := git clone

# External generation tool versions
CONTROLLER_TOOLS_VERSION ?= v0.12.0
CONTROLLER_TOOLS_VERSION ?= v0.14.0
CLIENT_GEN_VERSION ?= v0.28.1
CODE_GENERATOR_REPO ?= https://github.com/kubernetes/code-generator
CODE_GENERATOR_VERSION ?= v0.28.1
Expand Down
513 changes: 248 additions & 265 deletions cmd/plugins/balloons/policy/balloons-policy.go

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions cmd/plugins/balloons/policy/cputree.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ type cpuTreeAllocatorOptions struct {
preferSpreadOnPhysicalCores bool
preferCloseToDevices []string
preferFarFromDevices []string
virtDevCpusets map[string][]cpuset.CPUSet
}

var emptyCpuSet = cpuset.New()
Expand Down Expand Up @@ -401,9 +402,13 @@ func (t *cpuTreeNode) SplitLevel(splitLevel CPUTopologyLevel, cpuClassifier func
// CPU tree branch.
func (t *cpuTreeNode) NewAllocator(options cpuTreeAllocatorOptions) *cpuTreeAllocator {
ta := &cpuTreeAllocator{
root: t,
options: options,
cacheCloseCpuSets: map[string][]cpuset.CPUSet{},
root: t,
options: options,
}
if options.virtDevCpusets == nil {
ta.cacheCloseCpuSets = map[string][]cpuset.CPUSet{}
} else {
ta.cacheCloseCpuSets = options.virtDevCpusets
}
if options.preferSpreadOnPhysicalCores {
newTree := t.SplitLevel(CPUTopologyLevelNuma,
Expand Down
8 changes: 0 additions & 8 deletions cmd/plugins/balloons/policy/fillmethod.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ const (
// but refuse to run the container if the balloon cannot be
// created.
FillNewBalloonMust
// FillReservedBalloon: put a container into the reserved
// balloon.
FillReservedBalloon
// FillDefaultBalloon: put a container into the default
// balloon.
FillDefaultBalloon
)

var fillMethodNames = map[FillMethod]string{
Expand All @@ -71,8 +65,6 @@ var fillMethodNames = map[FillMethod]string{
FillSamePod: "same-pod",
FillNewBalloon: "new-balloon",
FillNewBalloonMust: "new-balloon-must",
FillDefaultBalloon: "default-balloon",
FillReservedBalloon: "reserved-balloon",
}

// String stringifies a FillMethod
Expand Down
176 changes: 100 additions & 76 deletions config/crd/bases/config.nri_balloonspolicies.yaml

Large diffs are not rendered by default.

37 changes: 22 additions & 15 deletions config/crd/bases/config.nri_templatepolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.12.0
controller-gen.kubebuilder.io/version: v0.14.0
name: templatepolicies.config.nri
spec:
group: config.nri
Expand All @@ -21,14 +21,19 @@ spec:
policy.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
Expand Down Expand Up @@ -79,9 +84,9 @@ spec:
description: Config provides runtime configuration for instrumentation.
properties:
httpEndpoint:
description: HTTPEndpoint is the address our HTTP server listens
on. This endpoint is used to expose Prometheus metrics among
other things.
description: |-
HTTPEndpoint is the address our HTTP server listens on. This endpoint is used
to expose Prometheus metrics among other things.
example: :8891
type: string
prometheusExport:
Expand All @@ -98,11 +103,13 @@ spec:
example: 100000
type: integer
tracingCollector:
description: 'TracingCollector defines the external endpoint for
tracing data collection. Endpoints are specified as full URLs,
or as plain URL schemes which then imply scheme-specific defaults.
The supported schemes and their default URLs are: - otlp-http,
http: localhost:4318 - otlp-grpc, grpc: localhost:4317'
description: |-
TracingCollector defines the external endpoint for tracing data collection.
Endpoints are specified as full URLs, or as plain URL schemes which then
imply scheme-specific defaults. The supported schemes and their default
URLs are:
- otlp-http, http: localhost:4318
- otlp-grpc, grpc: localhost:4317
example: otlp-http://localhost:4318
type: string
type: object
Expand Down
83 changes: 47 additions & 36 deletions config/crd/bases/config.nri_topologyawarepolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.12.0
controller-gen.kubebuilder.io/version: v0.14.0
name: topologyawarepolicies.config.nri
spec:
group: config.nri
Expand All @@ -21,14 +21,19 @@ spec:
policy.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
Expand All @@ -38,18 +43,20 @@ spec:
availableResources:
additionalProperties:
type: string
description: AvailableResources defines the bounding set for the policy
to allocate resources from.
description: |-
AvailableResources defines the bounding set for the policy to allocate
resources from.
type: object
colocateNamespaces:
description: ColocateNamespaces controls whether an attempt is made
to allocate all containers of pods in a namespace close to each
other (to the same topology zone).
description: |-
ColocateNamespaces controls whether an attempt is made to allocate all
containers of pods in a namespace close to each other (to the same topology
zone).
type: boolean
colocatePods:
description: ColocatePods controls whether an attempt is made to allocate
containers within the same pod close to each other (to the same
topology zone).
description: |-
ColocatePods controls whether an attempt is made to allocate containers
within the same pod close to each other (to the same topology zone).
type: boolean
control:
properties:
Expand Down Expand Up @@ -91,9 +98,9 @@ spec:
description: Config provides runtime configuration for instrumentation.
properties:
httpEndpoint:
description: HTTPEndpoint is the address our HTTP server listens
on. This endpoint is used to expose Prometheus metrics among
other things.
description: |-
HTTPEndpoint is the address our HTTP server listens on. This endpoint is used
to expose Prometheus metrics among other things.
example: :8891
type: string
prometheusExport:
Expand All @@ -110,11 +117,13 @@ spec:
example: 100000
type: integer
tracingCollector:
description: 'TracingCollector defines the external endpoint for
tracing data collection. Endpoints are specified as full URLs,
or as plain URL schemes which then imply scheme-specific defaults.
The supported schemes and their default URLs are: - otlp-http,
http: localhost:4318 - otlp-grpc, grpc: localhost:4317'
description: |-
TracingCollector defines the external endpoint for tracing data collection.
Endpoints are specified as full URLs, or as plain URL schemes which then
imply scheme-specific defaults. The supported schemes and their default
URLs are:
- otlp-http, http: localhost:4318
- otlp-grpc, grpc: localhost:4317
example: otlp-http://localhost:4318
type: string
type: object
Expand Down Expand Up @@ -174,29 +183,31 @@ spec:
type: boolean
preferIsolatedCPUs:
default: true
description: PreferIsolated controls whether kernel-isolated CPUs
are preferred for Guaranteed QoS-class containers that request 1
full CPU.
description: |-
PreferIsolated controls whether kernel-isolated CPUs are preferred for
Guaranteed QoS-class containers that request 1 full CPU.
type: boolean
preferSharedCPUs:
description: PreferShared controls whether exclusive CPU allocation
is considered for all eligible containers. If set to trues, exclusive
CPU allocation is only considered for eligible containers which
are explicitly annotated to opt out from shared allocation.
description: |-
PreferShared controls whether exclusive CPU allocation is considered for
all eligible containers. If set to trues, exclusive CPU allocation is only
considered for eligible containers which are explicitly annotated to opt
out from shared allocation.
type: boolean
reservedPoolNamespaces:
description: ReservedPoolNamespaces lists extra namespaces which are
treated like 'kube-system' (resources allocate from the reserved
pool).
description: |-
ReservedPoolNamespaces lists extra namespaces which are treated like
'kube-system' (resources allocate from the reserved pool).
items:
type: string
type: array
reservedResources:
additionalProperties:
type: string
description: ReservedResources defines the resources reserved namespaces
get assigned to. If AvailableResources is defined, ReservedResources
must be a subset of it.
description: |-
ReservedResources defines the resources reserved namespaces get assigned
to. If AvailableResources is defined, ReservedResources must be a subset
of it.
type: object
required:
- reservedResources
Expand Down
Loading
Loading