From 678f9014612a9890aeaa4655287aaaccccbb7ef8 Mon Sep 17 00:00:00 2001 From: Bourne-ID Date: Thu, 20 Jun 2024 12:56:40 -0400 Subject: [PATCH] Add RUN_IN_AWS Environment Variable (#51) * feat(aws): Add RUN_IN_AWS to avoid onPrem detection when IMDS does not respond * Bump chart version --------- Co-authored-by: Robin Bourne --- stable/cloudzero-cloudwatch-metrics/Chart.yaml | 2 +- stable/cloudzero-cloudwatch-metrics/templates/daemonset.yaml | 4 ++++ stable/cloudzero-cloudwatch-metrics/values.yaml | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/stable/cloudzero-cloudwatch-metrics/Chart.yaml b/stable/cloudzero-cloudwatch-metrics/Chart.yaml index 1bb466c..847288c 100644 --- a/stable/cloudzero-cloudwatch-metrics/Chart.yaml +++ b/stable/cloudzero-cloudwatch-metrics/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 name: cloudzero-cloudwatch-metrics description: A Helm chart to deploy cloudzero-cloudwatch-metrics project -version: 0.0.29 +version: 0.0.30 appVersion: "0.0.23" home: https://cloudzero.github.io/cloudzero-k8s-charts/ diff --git a/stable/cloudzero-cloudwatch-metrics/templates/daemonset.yaml b/stable/cloudzero-cloudwatch-metrics/templates/daemonset.yaml index 7e8b30e..2cc4b71 100755 --- a/stable/cloudzero-cloudwatch-metrics/templates/daemonset.yaml +++ b/stable/cloudzero-cloudwatch-metrics/templates/daemonset.yaml @@ -54,6 +54,10 @@ spec: value: "k8s/1.3.0" - name: TRACK_REPLICA_SETS value: {{ printf "%v" .Values.trackReplicaSets | default true | quote }} + {{- if .Values.runInAws }} + - name: RUN_IN_AWS + value: "True" + {{- end }} # Please don't change the mountPath volumeMounts: - name: cwagentconfig diff --git a/stable/cloudzero-cloudwatch-metrics/values.yaml b/stable/cloudzero-cloudwatch-metrics/values.yaml index 49a7156..544737c 100644 --- a/stable/cloudzero-cloudwatch-metrics/values.yaml +++ b/stable/cloudzero-cloudwatch-metrics/values.yaml @@ -70,3 +70,6 @@ daemonsetLabels: {} #openshift: true metricsCollectionInterval: 120 + +# For AWS EC2 use - Avoids the use of IMDS for discovery +#runInAws: true