From 32d5ce8990b1398bc71b07d904dca3ad244a66a9 Mon Sep 17 00:00:00 2001 From: Robert Gordon Date: Wed, 7 Aug 2024 10:46:24 +0100 Subject: [PATCH 1/2] chore: fix for POD_NAME and POD_NAMESPACE envs when enableHA is true --- .../chart/reloader/templates/deployment.yaml | 2 +- .../chart/reloader/tests/deployment_test.yaml | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/deployments/kubernetes/chart/reloader/templates/deployment.yaml b/deployments/kubernetes/chart/reloader/templates/deployment.yaml index d43bd872b..493186b40 100644 --- a/deployments/kubernetes/chart/reloader/templates/deployment.yaml +++ b/deployments/kubernetes/chart/reloader/templates/deployment.yaml @@ -127,6 +127,7 @@ spec: fieldRef: fieldPath: {{ $value | quote}} {{- end }} + {{- end }} {{- if eq .Values.reloader.watchGlobally false }} - name: KUBERNETES_NAMESPACE valueFrom: @@ -146,7 +147,6 @@ spec: {{- if .Values.reloader.enableMetricsByNamespace }} - name: METRICS_COUNT_BY_NAMESPACE value: enabled - {{- end }} {{- end }} ports: - name: http diff --git a/deployments/kubernetes/chart/reloader/tests/deployment_test.yaml b/deployments/kubernetes/chart/reloader/tests/deployment_test.yaml index 7fabe5c4b..aee0f9fb1 100644 --- a/deployments/kubernetes/chart/reloader/tests/deployment_test.yaml +++ b/deployments/kubernetes/chart/reloader/tests/deployment_test.yaml @@ -48,3 +48,16 @@ tests: asserts: - isEmpty: path: spec.template.spec.containers[0].securityContext + + - it: template still sets POD_NAME and POD_NAMESPACE environment variables when enableHA is true + set: + reloader: + enableHA: true + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name From ef0ea91ec5c91ccbab0aa9b398bec3318971fd5a Mon Sep 17 00:00:00 2001 From: bnallapeta Date: Wed, 7 Aug 2024 19:29:03 +0530 Subject: [PATCH 2/2] fix default values for memory and cpu --- .../kubernetes/chart/reloader/templates/deployment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/kubernetes/chart/reloader/templates/deployment.yaml b/deployments/kubernetes/chart/reloader/templates/deployment.yaml index 493186b40..e4295c5f8 100644 --- a/deployments/kubernetes/chart/reloader/templates/deployment.yaml +++ b/deployments/kubernetes/chart/reloader/templates/deployment.yaml @@ -83,7 +83,7 @@ spec: {{- else }} valueFrom: resourceFieldRef: - resource: limits.memory + resource: limits.cpu {{- end }} - name: GOMEMLIMIT {{- if .Values.reloader.deployment.gomemlimitOverride }} @@ -91,7 +91,7 @@ spec: {{- else }} valueFrom: resourceFieldRef: - resource: limits.cpu + resource: limits.memory {{- end }} {{- range $name, $value := .Values.reloader.deployment.env.open }} {{- if not (empty $value) }}