diff --git a/charts/amazon-cloudwatch-observability/templates/linux/cloudwatch-agent-custom-resource.yaml b/charts/amazon-cloudwatch-observability/templates/linux/cloudwatch-agent-custom-resource.yaml index 457c261..de98634 100644 --- a/charts/amazon-cloudwatch-observability/templates/linux/cloudwatch-agent-custom-resource.yaml +++ b/charts/amazon-cloudwatch-observability/templates/linux/cloudwatch-agent-custom-resource.yaml @@ -105,7 +105,8 @@ spec: image: {{ template "target-allocator.image" (merge $agent.prometheus.targetAllocator.image (dict "region" $.Values.region)) }} allocationStrategy: "consistent-hashing" {{- if $agent.prometheus.targetAllocator.prometheusCR.enabled }} - prometheusCR: {{ $agent.prometheus.targetAllocator.prometheusCR.enabled | default false }} + prometheusCR: + enabled: {{ $agent.prometheus.targetAllocator.prometheusCR.enabled | default false }} {{- end }} {{- end }} {{- with $agent.resources }} diff --git a/charts/amazon-cloudwatch-observability/templates/target-allocator-clusterrole.yaml b/charts/amazon-cloudwatch-observability/templates/target-allocator-clusterrole.yaml index b52643c..951e6e4 100644 --- a/charts/amazon-cloudwatch-observability/templates/target-allocator-clusterrole.yaml +++ b/charts/amazon-cloudwatch-observability/templates/target-allocator-clusterrole.yaml @@ -22,7 +22,7 @@ rules: verbs: ["get", "list", "watch"] - nonResourceURLs: ["/metrics"] verbs: ["get"] - {{- if and (hasKey ($customAgent.prometheus.targetAllocator) "PrometheusCR") $customAgent.prometheus.targetAllocator.PrometheusCR.enabled }} + {{- if and (hasKey ($customAgent.prometheus.targetAllocator) "prometheusCR") $customAgent.prometheus.targetAllocator.prometheusCR.enabled }} - apiGroups: [ "monitoring.coreos.com"] resources: ["podmonitors", "servicemonitors"] verbs: ["get", "list", "watch"]