Skip to content

Commit

Permalink
helm: add helm chart for plugins installations
Browse files Browse the repository at this point in the history
This commit adds a helm chart to install balloons and topology-aware
NRI plugins.

Signed-off-by: Muyassarov, Feruzjon <[email protected]>
  • Loading branch information
fmuyassarov committed May 17, 2023
1 parent ced32fb commit 22deea8
Show file tree
Hide file tree
Showing 13 changed files with 493 additions and 0 deletions.
23 changes: 23 additions & 0 deletions deployment/helm/nri-plugins/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
11 changes: 11 additions & 0 deletions deployment/helm/nri-plugins/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v2
appVersion: main
description: |
NRI resource policy is a NRI plugin that will apply hardware-aware resource allocation
policies to the containers running in the system.
name: nri-plugins
sources:
- https://github.com/containers/nri-plugins
home: https://github.com/containers/nri-plugins
type: application
version: 0.0.0
15 changes: 15 additions & 0 deletions deployment/helm/nri-plugins/balloons_values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Default values for nri-plugins.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
---
image:
name: nri-resource-policy-balloons
container:
name: nri-resource-policy-balloons

namespace: kube-system

configMap:
data:
ReservedResources:
cpu: 750m
6 changes: 6 additions & 0 deletions deployment/helm/nri-plugins/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{/*
Common labels
*/}}
{{- define "nri-plugins.labels" -}}
app: nri-resource-policy
{{- end -}}
12 changes: 12 additions & 0 deletions deployment/helm/nri-plugins/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: nri-resource-policy
rules:
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- watch
12 changes: 12 additions & 0 deletions deployment/helm/nri-plugins/templates/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: nri-resource-policy
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: nri-resource-policy
subjects:
- kind: ServiceAccount
name: nri-resource-policy
namespace: {{ .Values.namespace }}
8 changes: 8 additions & 0 deletions deployment/helm/nri-plugins/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: nri-resource-policy-config.default
namespace: {{ .Values.namespace }}
data:
policy: |+
{{- toYaml .Values.configMap.data | nindent 4 }}
80 changes: 80 additions & 0 deletions deployment/helm/nri-plugins/templates/daemonset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
labels:
{{- include "nri-plugins.labels" . | nindent 4 }}
name: nri-resource-policy
namespace: {{ .Values.namespace }}
spec:
selector:
matchLabels:
{{- include "nri-plugins.labels" . | nindent 4 }}
template:
metadata:
labels:
{{- include "nri-plugins.labels" . | nindent 4 }}
spec:
serviceAccount: nri-resource-policy
nodeSelector:
kubernetes.io/os: "linux"
containers:
- name: "{{ .Values.container.name }}"
args:
- --host-root
- /host
- --fallback-config
- /etc/nri-resource-policy/nri-resource-policy.cfg
- --pid-file
- /tmp/nri-resource-policy.pid
- -metrics-interval
- 5s
ports:
- containerPort: 8891
name: metrics
protocol: TCP
hostPort: 8891
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: "{{ .Values.image.name }}:devel"
imagePullPolicy: Always
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
resources:
requests:
cpu: 500m
memory: 512Mi
volumeMounts:
- name: resource-policydata
mountPath: /var/lib/nri-resource-policy
- name: hostsysfs
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:
- name: resource-policydata
hostPath:
path: /var/lib/nri-resource-policy
type: DirectoryOrCreate
- name: hostsysfs
hostPath:
path: /sys
type: Directory
- name: resource-policysockets
hostPath:
path: /var/run/nri-resource-policy
- name: resource-policyconfig
configMap:
name: nri-resource-policy-config
- name: nrisockets
hostPath:
path: /var/run/nri
type: Directory
Loading

0 comments on commit 22deea8

Please sign in to comment.