-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
helm: add helm charts for memtierd and memory-qos
This commit adds two new Helm charts for installing memory-qos and memtierd NRI plugins via Helm. Signed-off-by: Feruzjon Muyassarov <[email protected]>
- Loading branch information
1 parent
c866a1d
commit 325cfbf
Showing
13 changed files
with
386 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: v2 | ||
appVersion: "main" | ||
description: | | ||
The memory-qos NRI plugin adds two methods for controlling cgroups v2 | ||
memory.* parameters: QoS class and direct memory annotations. | ||
name: nri-memory-qos | ||
sources: | ||
- https://github.com/containers/nri-plugins | ||
home: https://github.com/containers/nri-plugins | ||
type: application | ||
version: v0.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "memory-qos.labels" -}} | ||
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{ include "memory-qos.selectorLabels" . }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "memory-qos.selectorLabels" -}} | ||
app.kubernetes.io/name: nri-memory-qos | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: nri-memory-qos-config.default | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "memory-qos.labels" . | nindent 4 }} | ||
data: | ||
config.yaml: | | ||
classes: | ||
- name: bronze | ||
swaplimitratio: 0.5 | ||
- name: silver | ||
swaplimitratio: 0.2 | ||
unifiedannotations: | ||
- memory.swap.max | ||
- memory.high |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
labels: | ||
{{- include "memory-qos.labels" . | nindent 4 }} | ||
name: nri-memory-qos | ||
namespace: {{ .Release.Namespace }} | ||
spec: | ||
selector: | ||
matchLabels: | ||
{{- include "memory-qos.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
labels: | ||
{{- include "memory-qos.labels" . | nindent 8 }} | ||
spec: | ||
nodeSelector: | ||
kubernetes.io/os: "linux" | ||
containers: | ||
- name: nri-memory-qos | ||
command: | ||
- nri-memory-qos | ||
- --idx | ||
- "40" | ||
- --config | ||
- /etc/nri/memory-qos/config.yaml | ||
- -v | ||
image: {{ .Values.image.name }}:{{ .Values.image.tag | default .Chart.AppVersion }} | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
resources: | ||
requests: | ||
cpu: {{ .Values.resources.cpu }} | ||
memory: {{ .Values.resources.memory }} | ||
volumeMounts: | ||
- name: memory-qos-config-vol | ||
mountPath: /etc/nri/memory-qos | ||
- name: nrisockets | ||
mountPath: /var/run/nri | ||
volumes: | ||
- name: memory-qos-config-vol | ||
configMap: | ||
name: nri-memory-qos-config.default | ||
- name: nrisockets | ||
hostPath: | ||
path: /var/run/nri | ||
type: Directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"$schema": "http://json-schema.org/schema#", | ||
"required": [ | ||
"image", | ||
"resources" | ||
], | ||
"properties": { | ||
"image": { | ||
"type": "object", | ||
"required": [ | ||
"name", | ||
"tag", | ||
"pullPolicy" | ||
], | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
}, | ||
"tag": { | ||
"type": "string" | ||
}, | ||
"pullPolicy": { | ||
"type": "string", | ||
"enum": ["Never", "Always", "IfNotPresent"] | ||
} | ||
} | ||
}, | ||
"resources": { | ||
"type": "object", | ||
"required": [ | ||
"cpu", | ||
"memory" | ||
], | ||
"properties": { | ||
"cpu": { | ||
"type": "integer" | ||
}, | ||
"memory": { | ||
"type": "integer" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Default values for memory-qos. | ||
# This is a YAML-formatted file. | ||
# Declare variables to be passed into your templates. | ||
--- | ||
image: | ||
name: ghcr.io/containers/nri-plugins/nri-memory-qos | ||
# tag, if defined will use the given image tag, otherwise Chart.AppVersion will be used | ||
tag: unstable | ||
pullPolicy: Always | ||
|
||
resources: | ||
cpu: 10m | ||
memory: 100Mi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: v2 | ||
appVersion: "main" | ||
description: | | ||
The memtierd NRI plugin enables managing workloads with Memtierd in Kubernetes. | ||
name: nri-memtierd | ||
sources: | ||
- https://github.com/containers/nri-plugins | ||
home: https://github.com/containers/nri-plugins | ||
type: application | ||
version: v0.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "memtierd.labels" -}} | ||
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{ include "memtierd.selectorLabels" . }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "memtierd.selectorLabels" -}} | ||
app.kubernetes.io/name: nri-memtierd | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: nri-memtierd-config.default | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "memtierd.labels" . | nindent 4 }} | ||
data: | ||
config.yaml: | | ||
classes: | ||
- name: swap-idle-data | ||
allowswap: true | ||
memtierdconfig: | | ||
policy: | ||
name: age | ||
config: | | ||
intervalms: 10000 | ||
pidwatcher: | ||
name: cgroups | ||
config: | | ||
cgroups: | ||
- $CGROUP2_ABS_PATH | ||
swapoutms: 10000 | ||
tracker: | ||
name: idlepage | ||
config: | | ||
pagesinregion: 512 | ||
maxcountperregion: 1 | ||
scanintervalms: 10000 | ||
mover: | ||
intervalms: 20 | ||
bandwidth: 50 | ||
- name: track-working-set-size | ||
allowswap: false | ||
memtierdconfig: | | ||
policy: | ||
name: age | ||
config: | | ||
intervalms: 20000 | ||
pidwatcher: | ||
name: cgroups | ||
config: | | ||
cgroups: | ||
- $CGROUP2_ABS_PATH | ||
tracker: | ||
name: idlepage | ||
config: | | ||
pagesinregion: 512 | ||
maxcountperregion: 1 | ||
scanintervalms: 20000 | ||
routines: | ||
- name: statactions | ||
config: | | ||
intervalms: 60000 | ||
intervalcommand: ["policy", "-dump", "accessed", "0,1m,30m,2h,24h,0"] | ||
intervalcommandrunner: memtier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
labels: | ||
{{- include "memtierd.labels" . | nindent 4 }} | ||
name: nri-memtierd | ||
namespace: {{ .Release.Namespace }} | ||
spec: | ||
selector: | ||
matchLabels: | ||
{{- include "memtierd.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
labels: | ||
{{- include "memtierd.labels" . | nindent 8 }} | ||
spec: | ||
nodeSelector: | ||
kubernetes.io/os: "linux" | ||
hostPID: true | ||
containers: | ||
- name: nri-memtierd | ||
command: | ||
- nri-memtierd | ||
- --idx | ||
- "45" | ||
- --config | ||
- /etc/nri/memtierd/config.yaml | ||
{{- if .Values.outputDir }} | ||
- --run-dir | ||
- /run-dir | ||
{{- end }} | ||
- --cgroups-dir | ||
- /sys/fs/cgroup | ||
- -v | ||
image: {{ .Values.image.name }}:{{ .Values.image.tag | default .Chart.AppVersion }} | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
resources: | ||
requests: | ||
cpu: {{ .Values.resources.cpu }} | ||
memory: {{ .Values.resources.memory }} | ||
securityContext: | ||
privileged: true | ||
volumeMounts: | ||
- name: memtierd-config-vol | ||
mountPath: /etc/nri/memtierd | ||
- name: nrisockets | ||
mountPath: /var/run/nri | ||
- name: host-bitmap | ||
mountPath: /sys/kernel/mm/page_idle/bitmap | ||
- name: cgroups-vol | ||
mountPath: /sys/fs/cgroup | ||
{{- if .Values.outputDir }} | ||
# Set outputDir parameter to access memtierd.output files from host | ||
- name: run-dir-vol | ||
mountPath: /run-dir | ||
{{- end }} | ||
volumes: | ||
- name: memtierd-config-vol | ||
configMap: | ||
name: nri-memtierd-config.default | ||
- name: nrisockets | ||
hostPath: | ||
path: /var/run/nri | ||
type: Directory | ||
- name: host-bitmap | ||
hostPath: | ||
path: /sys/kernel/mm/page_idle/bitmap | ||
- name: cgroups-vol | ||
hostPath: | ||
path: /sys/fs/cgroup | ||
type: Directory | ||
{{- if .Values.outputDir }} | ||
- name: run-dir-vol | ||
hostPath: | ||
path: {{ .Values.outputDir }} | ||
type: DirectoryOrCreate | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"$schema": "http://json-schema.org/schema#", | ||
"required": [ | ||
"image", | ||
"resources" | ||
], | ||
"properties": { | ||
"image": { | ||
"type": "object", | ||
"required": [ | ||
"name", | ||
"tag", | ||
"pullPolicy" | ||
], | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
}, | ||
"tag": { | ||
"type": "string" | ||
}, | ||
"pullPolicy": { | ||
"type": "string", | ||
"enum": ["Never", "Always", "IfNotPresent"] | ||
} | ||
} | ||
}, | ||
"resources": { | ||
"type": "object", | ||
"required": [ | ||
"cpu", | ||
"memory" | ||
], | ||
"properties": { | ||
"cpu": { | ||
"type": "integer" | ||
}, | ||
"memory": { | ||
"type": "integer" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Default values for memory-qos. | ||
# This is a YAML-formatted file. | ||
# Declare variables to be passed into your templates. | ||
--- | ||
image: | ||
name: ghcr.io/containers/nri-plugins/nri-memtierd | ||
# tag, if defined will use the given image tag, otherwise Chart.AppVersion will be used | ||
tag: unstable | ||
pullPolicy: Always | ||
|
||
resources: | ||
cpu: 250m | ||
memory: 100Mi | ||
|
||
outputDir: "" |
Oops, something went wrong.