From f1fbfa1d5ebd9491ed62c8b912c44aec3d163bae Mon Sep 17 00:00:00 2001 From: Scott Hussey Date: Wed, 28 Mar 2018 16:33:31 -0500 Subject: [PATCH] [398399] Support resource limits - Add resource limit support to each daemon set Change-Id: I4680f70338627144e7b3ffa1625eba2ce3a33f25 --- divingbell/templates/daemonset-ethtool.yaml | 1 + divingbell/templates/daemonset-mounts.yaml | 1 + divingbell/templates/daemonset-sysctl.yaml | 1 + divingbell/templates/daemonset-uamlite.yaml | 1 + divingbell/values.yaml | 30 +++++++++++++++++++++ 5 files changed, 34 insertions(+) diff --git a/divingbell/templates/daemonset-ethtool.yaml b/divingbell/templates/daemonset-ethtool.yaml index 8490cbf..06404bf 100644 --- a/divingbell/templates/daemonset-ethtool.yaml +++ b/divingbell/templates/daemonset-ethtool.yaml @@ -38,6 +38,7 @@ spec: - name: {{ $daemonset }} image: {{ .Values.images.divingbell }} imagePullPolicy: {{ .Values.images.pull_policy }} +{{ tuple $envAll $envAll.Values.pod.resources.ethtool | include "helm-toolkit.snippets.kubernetes_resources" | indent 8 }} command: - /tmp/{{ $daemonset }}.sh volumeMounts: diff --git a/divingbell/templates/daemonset-mounts.yaml b/divingbell/templates/daemonset-mounts.yaml index 5d22d89..0d4d106 100644 --- a/divingbell/templates/daemonset-mounts.yaml +++ b/divingbell/templates/daemonset-mounts.yaml @@ -38,6 +38,7 @@ spec: - name: {{ $daemonset }} image: {{ .Values.images.divingbell }} imagePullPolicy: {{ .Values.images.pull_policy }} +{{ tuple $envAll $envAll.Values.pod.resources.mounts | include "helm-toolkit.snippets.kubernetes_resources" | indent 8 }} command: - /tmp/{{ $daemonset }}.sh volumeMounts: diff --git a/divingbell/templates/daemonset-sysctl.yaml b/divingbell/templates/daemonset-sysctl.yaml index 217fa60..4fca19a 100644 --- a/divingbell/templates/daemonset-sysctl.yaml +++ b/divingbell/templates/daemonset-sysctl.yaml @@ -38,6 +38,7 @@ spec: - name: {{ $daemonset }} image: {{ .Values.images.divingbell }} imagePullPolicy: {{ .Values.images.pull_policy }} +{{ tuple $envAll $envAll.Values.pod.resources.sysctl | include "helm-toolkit.snippets.kubernetes_resources" | indent 8 }} command: - /tmp/{{ $daemonset }}.sh volumeMounts: diff --git a/divingbell/templates/daemonset-uamlite.yaml b/divingbell/templates/daemonset-uamlite.yaml index 7baa706..85ef8bd 100644 --- a/divingbell/templates/daemonset-uamlite.yaml +++ b/divingbell/templates/daemonset-uamlite.yaml @@ -38,6 +38,7 @@ spec: - name: {{ $daemonset }} image: {{ .Values.images.divingbell }} imagePullPolicy: {{ .Values.images.pull_policy }} +{{ tuple $envAll $envAll.Values.pod.resources.uamlite | include "helm-toolkit.snippets.kubernetes_resources" | indent 8 }} command: - /tmp/{{ $daemonset }}.sh volumeMounts: diff --git a/divingbell/values.yaml b/divingbell/values.yaml index e070554..2ee97ba 100644 --- a/divingbell/values.yaml +++ b/divingbell/values.yaml @@ -46,3 +46,33 @@ pod: enabled: true min_ready_seconds: 0 max_unavailable: 100% + resources: + enabled: false + ethtool: + limits: + memory: "128Mi" + cpu: "100m" + requests: + memory: "128Mi" + cpu: "100m" + mounts: + limits: + memory: "128Mi" + cpu: "100m" + requests: + memory: "128Mi" + cpu: "100m" + uamlite: + limits: + memory: "128Mi" + cpu: "100m" + requests: + memory: "128Mi" + cpu: "100m" + sysctl: + limits: + memory: "128Mi" + cpu: "100m" + requests: + memory: "128Mi" + cpu: "100m"