From 35ef849bcc5f22a005b416fa1937043c766c93d9 Mon Sep 17 00:00:00 2001 From: Anson Mansfield Date: Fri, 14 Jul 2023 19:11:51 -0400 Subject: [PATCH] Generate rke2-canal resource bounds from template values rather than hardcoding. (#359) * use template values to set resource bounds * packageVersion increment Signed-off-by: Anson Mansfield --- .../rke2-canal/charts/templates/daemonset.yaml | 9 ++++++--- packages/rke2-canal/charts/values.yaml | 16 ++++++++++++++++ packages/rke2-canal/package.yaml | 2 +- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/packages/rke2-canal/charts/templates/daemonset.yaml b/packages/rke2-canal/charts/templates/daemonset.yaml index a9c51620..5227a1b5 100644 --- a/packages/rke2-canal/charts/templates/daemonset.yaml +++ b/packages/rke2-canal/charts/templates/daemonset.yaml @@ -181,9 +181,9 @@ spec: {{- end }} securityContext: privileged: true - resources: - requests: - cpu: 250m + {{- if .Values.calico.resources }} + resources: {{- toYaml .Values.calico.resources | nindent 12 }} + {{- end }} lifecycle: preStop: exec: @@ -239,6 +239,9 @@ spec: {{- end }} securityContext: privileged: true + {{- if .Values.flannel.resources }} + resources: {{- toYaml .Values.flannel.resources | nindent 12 }} + {{- end }} env: - name: POD_NAME valueFrom: diff --git a/packages/rke2-canal/charts/values.yaml b/packages/rke2-canal/charts/values.yaml index 991867a9..646a3f34 100644 --- a/packages/rke2-canal/charts/values.yaml +++ b/packages/rke2-canal/charts/values.yaml @@ -46,6 +46,14 @@ flannel: #tunnelMode: "separate" # Persistent keep interval to use keepaliveInterval: 0 + # Resource bounds for the kube-flannel daemon container + resources: ~ + # requests: + # memory: 32Mi + # cpu: 100m + # limits: + # memory: 128Mi + # cpu: 500m calico: # CNI installation image. @@ -112,6 +120,14 @@ calico: ip6AutoDetectionMethod: "first-found" # Enable calico kube-controllers calicoKubeControllers: false + # Resource bounds for the calico-node daemon container + resources: + requests: + cpu: 250m + # memory: 128Mi + # limits: + # cpu: 250m + # memory: 256Mi global: systemDefaultRegistry: "" diff --git a/packages/rke2-canal/package.yaml b/packages/rke2-canal/package.yaml index 3c62637b..b2f64298 100644 --- a/packages/rke2-canal/package.yaml +++ b/packages/rke2-canal/package.yaml @@ -1,2 +1,2 @@ url: local -packageVersion: 03 +packageVersion: 04