diff --git a/stable/cloudzero-cloudwatch-metrics/Chart.yaml b/stable/cloudzero-cloudwatch-metrics/Chart.yaml index 164a8e8..354d035 100644 --- a/stable/cloudzero-cloudwatch-metrics/Chart.yaml +++ b/stable/cloudzero-cloudwatch-metrics/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 name: cloudzero-cloudwatch-metrics description: A Helm chart to deploy cloudzero-cloudwatch-metrics project -version: 0.0.26 +version: 0.0.27 appVersion: "0.0.22" home: https://cloudzero.github.io/cloudzero-k8s-charts/ diff --git a/stable/cloudzero-cloudwatch-metrics/README.md b/stable/cloudzero-cloudwatch-metrics/README.md index 023ddc4..db6cac0 100755 --- a/stable/cloudzero-cloudwatch-metrics/README.md +++ b/stable/cloudzero-cloudwatch-metrics/README.md @@ -43,3 +43,4 @@ helm upgrade --install cloudzero-cloudwatch-metrics \ | `nodeSelector` | Node labels for pod assignment | {} | | `tolerations` | Optional deployment tolerations | {} | | `annotations` | Optional pod annotations | {} | +| `metricsCollectionInterval` | Metrics collection interval in seconds. It can be set to 5, 10, 15, 30, 45, 60 or 120 | 120 | diff --git a/stable/cloudzero-cloudwatch-metrics/templates/configmap.yaml b/stable/cloudzero-cloudwatch-metrics/templates/configmap.yaml index 0baf2d3..c24087a 100755 --- a/stable/cloudzero-cloudwatch-metrics/templates/configmap.yaml +++ b/stable/cloudzero-cloudwatch-metrics/templates/configmap.yaml @@ -14,7 +14,13 @@ data: "metrics_collected": { "kubernetes": { "cluster_name": "{{ .Values.clusterName }}", - "metrics_collection_interval": 120 + {{- $allowedIntervals := list 5 10 15 30 45 60 120 }} + {{- $failureMessage := printf "metricsCollectionInterval must be set to one of %s" (join "," $allowedIntervals) }} + {{- if not (has (int .Values.metricsCollectionInterval) $allowedIntervals) }} + {{- fail $failureMessage }} + {{- else }} + "metrics_collection_interval": {{ .Values.metricsCollectionInterval }} + {{- end }} } }, "force_flush_interval": 5 diff --git a/stable/cloudzero-cloudwatch-metrics/values.yaml b/stable/cloudzero-cloudwatch-metrics/values.yaml index dc65033..87730e8 100644 --- a/stable/cloudzero-cloudwatch-metrics/values.yaml +++ b/stable/cloudzero-cloudwatch-metrics/values.yaml @@ -64,3 +64,5 @@ daemonsetLabels: {} # For AWS ROSA (OpenShift) #openshift: true + +metricsCollectionInterval: 120