Skip to content

Commit

Permalink
deployment/helm: initial chart for topology-aware policy.
Browse files Browse the repository at this point in the history
Signed-off-by: Krisztian Litkey <[email protected]>
  • Loading branch information
klihub committed Oct 24, 2023
1 parent 75db5c4 commit 7804e29
Show file tree
Hide file tree
Showing 6 changed files with 243 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.12.0
name: topologyawareconfigs.config.nri
spec:
group: config.nri
names:
kind: TopologyAwareConfig
listKind: TopologyAwareConfigList
plural: topologyawareconfigs
singular: topologyawareconfig
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: TopologyAwareConfig represents the configuration for the topology-aware
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'
type: string
common:
properties:
control:
properties:
cpu:
properties:
classes:
additionalProperties:
properties:
energyPerformancePreference:
type: integer
maxFreq:
type: integer
minFreq:
type: integer
uncoreMaxFreq:
type: integer
uncoreMinFreq:
type: integer
required:
- energyPerformancePreference
- maxFreq
- minFreq
- uncoreMaxFreq
- uncoreMinFreq
type: object
type: object
required:
- classes
type: object
enable:
items:
type: string
type: array
type: object
instrumentation:
description: Config is the runtime configuration for instrumentation.
properties:
httpEndpoint:
description: HTTPEndpoint, used among other things to expose metrics
to Prometheus.
type: string
prometheusExport:
description: PrometheusExport enables /metrics exporting for Prometheus.
type: boolean
reportPeriod:
description: ReportPeriod for our metrics view.
format: duration
type: string
samplingRatePerMillion:
description: Number of samples to collect per million spans.
type: integer
tracingCollector:
description: TracingCollector is the endpoint for tracing data
collection.
type: string
type: object
log:
properties:
debug:
additionalProperties:
type: boolean
description: Debug controls which log sources produce debug messages.
type: object
klog:
description: Klog configures klog-specific options.
properties:
add_dir_header:
type: boolean
alsologtostderr:
type: boolean
log_backtrace_at:
type: string
log_dir:
type: string
log_file:
type: string
log_file_max_size:
format: int64
type: integer
logtostderr:
type: boolean
one_output:
type: boolean
skip_headers:
type: boolean
skip_log_headers:
type: boolean
stderrthreshold:
type: string
v:
type: integer
vmodule:
type: string
type: object
logSource:
description: LogSource controls if messages are prefixed with
the logger source.
type: boolean
type: object
type: object
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'
type: string
metadata:
type: object
status:
properties:
nodes:
additionalProperties:
properties:
errors:
description: Error can provide further details of a configuration
error.
type: string
generation:
description: Generation is the generation the configuration
this status was set for.
format: int64
type: integer
status:
description: Status of activating the configuration on this
node.
enum:
- Success
- Failure
type: string
timestamp:
description: Last time of success/failure.
format: date-time
type: string
required:
- generation
- status
type: object
type: object
required:
- nodes
type: object
topologyAware:
properties:
availableResources:
additionalProperties:
type: string
type: object
colocateNamespaces:
type: boolean
colocatePods:
type: boolean
pinCPU:
type: boolean
pinMemory:
type: boolean
preferIsolatedCPUs:
type: boolean
preferSharedCPUs:
type: boolean
reservedPoolNamespaces:
items:
type: string
type: array
reservedResources:
additionalProperties:
type: string
type: object
required:
- reservedResources
type: object
required:
- topologyAware
type: object
served: true
storage: true
subresources:
status: {}
11 changes: 11 additions & 0 deletions deployment/helm/topology-aware/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,14 @@ rules:
- list
- update
- delete
- apiGroups:
- config.nri
resources:
- topologyawareconfigs
verbs:
- create
- get
- list
- watch
- update
- delete
11 changes: 11 additions & 0 deletions deployment/helm/topology-aware/templates/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: config.nri/v1alpha1
kind: TopologyAwareConfig
metadata:
name: default
namespace: {{ .Release.Namespace }}
labels:
{{- include "topology-aware-plugin.labels" . | nindent 4 }}
topologyAware:
{{- toYaml .Values.policyConfig | nindent 2 }}
common:
{{- toYaml .Values.commonConfig | nindent 2 }}
10 changes: 0 additions & 10 deletions deployment/helm/topology-aware/templates/configmap.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions deployment/helm/topology-aware/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ spec:
args:
- --host-root
- /host
- --fallback-config
- /etc/nri-resource-policy/nri-resource-policy.cfg
- --pid-file
- /tmp/nri-resource-policy.pid
- -metrics-interval
Expand Down Expand Up @@ -74,8 +72,6 @@ spec:
mountPath: /host/sys
- name: resource-policysockets
mountPath: /var/run/nri-resource-policy
- name: resource-policyconfig
mountPath: /etc/nri-resource-policy
- name: nrisockets
mountPath: /var/run/nri
volumes:
Expand All @@ -90,9 +86,6 @@ spec:
- name: resource-policysockets
hostPath:
path: /var/run/nri-resource-policy
- name: resource-policyconfig
configMap:
name: nri-resource-policy-config.default
- name: nrisockets
hostPath:
path: /var/run/nri
Expand Down
21 changes: 17 additions & 4 deletions deployment/helm/topology-aware/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,23 @@ image:
#tag: unstable
pullPolicy: Always

config:
policy:
ReservedResources:
cpu: 750m
policyConfig:
reservedResources:
cpu: 750m

commonConfig:
control:
enable:
- cpu
log:
debug:
"*": false
logSource: true
klog:
skip_headers: true
instrumentation:
reportPeriod: 60s
samplingRatePerMillion: 0

hostPort: 8891

Expand Down

0 comments on commit 7804e29

Please sign in to comment.