added repo
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
apiVersion: v2
|
||||
name: node-thp-config
|
||||
description: A Helm chart for deploying a DaemonSet to configure Transparent Huge Pages (THP) on nodes
|
||||
type: application
|
||||
version: 0.1.0
|
||||
appVersion: "1.0.0"
|
||||
keywords:
|
||||
- kernel
|
||||
- transparent-hugepages
|
||||
- thp
|
||||
- daemonset
|
||||
home: https://github.com/your-org/node-thp-config
|
||||
sources:
|
||||
- https://github.com/your-org/node-thp-config
|
||||
maintainers:
|
||||
- name: Your Name
|
||||
email: your.email@example.com
|
||||
@@ -0,0 +1,46 @@
|
||||
{{/*
|
||||
Generate the complete node affinity configuration
|
||||
*/}}
|
||||
{{- define "node-thp-config.nodeAffinity" -}}
|
||||
nodeAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
nodeSelectorTerms:
|
||||
{{- if .Values.baseMatchExpressions }}
|
||||
- matchExpressions:
|
||||
{{- include "node-thp-config.baseMatchExpressions" . | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- if and .Values.addExtraMatchExpressions .Values.additionalMatchExpressions }}
|
||||
- matchExpressions:
|
||||
{{- include "node-thp-config.additionalMatchExpressions" . | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Generate the base matchExpressions (always included)
|
||||
*/}}
|
||||
{{- define "node-thp-config.baseMatchExpressions" -}}
|
||||
{{- range .Values.baseMatchExpressions }}
|
||||
- key: {{ .key }}
|
||||
operator: {{ .operator }}
|
||||
values:
|
||||
{{- range .values }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Generate additional matchExpressions if enabled
|
||||
*/}}
|
||||
{{- define "node-thp-config.additionalMatchExpressions" -}}
|
||||
{{- if and .Values.addExtraMatchExpressions .Values.additionalMatchExpressions }}
|
||||
{{- range .Values.additionalMatchExpressions }}
|
||||
- key: {{ .key }}
|
||||
operator: {{ .operator }}
|
||||
values:
|
||||
{{- range .values }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,59 @@
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: {{ .Values.daemonSet.name }}
|
||||
namespace: {{ .Values.daemonSet.namespace }}
|
||||
labels:
|
||||
app: {{ .Values.daemonSet.name }}
|
||||
{{- with .Values.daemonSet.labels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.daemonSet.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ .Values.daemonSet.name }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ .Values.daemonSet.name }}
|
||||
{{- with .Values.pod.labels }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.pod.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.global.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range .Values.global.imagePullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
hostNetwork: {{ .Values.pod.hostNetwork }}
|
||||
hostPID: {{ .Values.pod.hostPID }}
|
||||
hostIPC: {{ .Values.pod.hostIPC }}
|
||||
containers:
|
||||
- name: {{ .Values.container.name }}
|
||||
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
command: {{ .Values.container.command | toJson }}
|
||||
args: {{ .Values.container.args | toJson }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.container.securityContext | nindent 12 }}
|
||||
resources:
|
||||
{{- toYaml .Values.container.resources | nindent 12 }}
|
||||
volumeMounts:
|
||||
{{- toYaml .Values.volumeMounts | nindent 12 }}
|
||||
volumes:
|
||||
{{- toYaml .Values.volumes | nindent 8 }}
|
||||
affinity:
|
||||
{{- include "node-thp-config.nodeAffinity" . | nindent 8 }}
|
||||
{{- with .Values.pod.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,85 @@
|
||||
# Default values for node-thp-config
|
||||
|
||||
global:
|
||||
imageRegistry: ""
|
||||
imagePullSecrets: []
|
||||
|
||||
# Image settings
|
||||
image:
|
||||
repository: alpine
|
||||
tag: "3.6"
|
||||
pullPolicy: IfNotPresent
|
||||
|
||||
# DaemonSet configuration
|
||||
daemonSet:
|
||||
name: node-thp-config
|
||||
namespace: kube-system
|
||||
labels: {}
|
||||
annotations: {}
|
||||
|
||||
# Container configuration
|
||||
container:
|
||||
name: thp-config
|
||||
command: ["sh", "-c"]
|
||||
args:
|
||||
- "while true; do echo madvise > /sys/kernel/mm/transparent_hugepage/enabled; echo defer > /sys/kernel/mm/transparent_hugepage/defrag; echo 1 > /sys/kernel/mm/transparent_hugepage/khugepaged/defrag; echo advise > /sys/kernel/mm/transparent_hugepage/shmem_enabled; sleep 30; done;"
|
||||
|
||||
# Security context
|
||||
securityContext:
|
||||
privileged: true
|
||||
|
||||
# Resource limits and requests
|
||||
resources:
|
||||
requests:
|
||||
cpu: "10m"
|
||||
memory: "16Mi"
|
||||
limits:
|
||||
cpu: "50m"
|
||||
memory: "32Mi"
|
||||
|
||||
# Pod configuration
|
||||
pod:
|
||||
hostNetwork: true
|
||||
hostPID: true
|
||||
hostIPC: true
|
||||
|
||||
# Pod labels
|
||||
labels: {}
|
||||
|
||||
# Pod annotations
|
||||
annotations: {}
|
||||
|
||||
# Pod tolerations
|
||||
tolerations:
|
||||
- operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
- operator: "Exists"
|
||||
effect: "NoExecute"
|
||||
- operator: "Exists"
|
||||
effect: "PreferNoSchedule"
|
||||
|
||||
# Volume configuration
|
||||
volumes:
|
||||
- name: sys
|
||||
hostPath:
|
||||
path: /sys
|
||||
|
||||
# Volume mounts
|
||||
volumeMounts:
|
||||
- name: sys
|
||||
mountPath: /sys
|
||||
|
||||
# Node affinity configuration
|
||||
# Base matchExpressions (always included)
|
||||
baseMatchExpressions:
|
||||
- key: dedicated
|
||||
operator: In
|
||||
values:
|
||||
- "azul"
|
||||
|
||||
|
||||
# Flag to control adding extra matchExpressions
|
||||
addExtraMatchExpressions: false
|
||||
|
||||
# Additional matchExpressions to append when addExtraMatchExpressions is true
|
||||
additionalMatchExpressions: []
|
||||
Reference in New Issue
Block a user