Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple AmazonCloudWatchAgent CRs and add integration for Prometheus Target Allocator #126

Merged
merged 4 commits into from
Dec 18, 2024

Conversation

okankoAMZ
Copy link
Contributor

@okankoAMZ okankoAMZ commented Nov 11, 2024

Description of changes:

  • Adds support for configuring multiple AmazonCloudWatchAgent workloads, each of which can be a deployment/daemonset/statefulset
  • Adds support for Prometheus monitoring via the CloudWatchAgent when using the helm-chart / EKS add-on
  • Adds support for associating a AmazonCloudWatchAgent workload with a corresponding Prometheus TargetAllocator installation, which will be managed by the CloudWatchAgentOperator

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

mitali-salvi and others added 2 commits October 28, 2024 14:47
… Prometheus monitoring with Target Allocator (#86)

* add support for configurable modes for cloudwatch agent CR

* Adding more configurable fields

* adding support for certs with multiple agent workloaf

* Adding support for conditional target-allocator cluster roles

* adding support for replicas

* adding support for replicas

* fixing values.yaml

* fixing values.yaml

* Updating operator cluster-role to perform CRUD operations on pdb

* adding support for custom target-allocator images

* bug fixed for parsing prom config

* Update Agent workload comment

Co-authored-by: Kaushik Surya <[email protected]>

---------

Co-authored-by: okankoAMZ <[email protected]>
Co-authored-by: Kaushik Surya <[email protected]>
# Conflicts:
#	charts/amazon-cloudwatch-observability/templates/certmanager.yaml
#	charts/amazon-cloudwatch-observability/templates/linux/cloudwatch-agent-custom-resource.yaml
@sky333999 sky333999 changed the title Target allocator Support multiple AmazonCloudWatchAgent CRs and add integration for Prometheus Target Allocator Dec 17, 2024
@sky333999 sky333999 marked this pull request as ready for review December 17, 2024 18:13
allocationStrategy: "consistent-hashing"
{{- if $customAgent.prometheus.targetAllocator.prometheusCR }}
prometheusCR: {{ $customAgent.prometheus.targetAllocator.prometheusCR.enabled | default false }}
{{- end }}
Copy link
Collaborator

@musa-asad musa-asad Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to add this to allow the user to use the agent values.

Suggested change
{{- end }}
{{- end }}
{{- else if $.Values.agent.prometheus.targetAllocator }}
targetAllocator:
enabled: {{ $.Values.agent.prometheus.targetAllocator.enabled | default false }}
image: {{ include "target-allocator.modify-image" (merge (dict "image" $.Values.agent.prometheus.targetAllocator.image) $ ) }}
allocationStrategy: "consistent-hashing"
{{- if $.Values.agent.prometheus.targetAllocator.prometheusCR }}
prometheusCR: {{ $.Values.agent.prometheus.targetAllocator.prometheusCR.enabled | default false }}
{{- end }}

{{- with $customAgent.prometheus.config }}
config:
{{- toYaml . | nindent 6 }}
{{- end }}
Copy link
Collaborator

@musa-asad musa-asad Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to add this to allow the user to use the agent values.

Suggested change
{{- end }}
{{- end }}
{{- else if $.Values.agent.prometheus.config }}
prometheus:
{{- with $.Values.agent.prometheus.config }}
config:
{{- toYaml . | nindent 6 }}
{{- end }}

Copy link
Contributor Author

@okankoAMZ okankoAMZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to update: operator tag:tag: 1.9.0

# Conflicts:
#	charts/amazon-cloudwatch-observability/templates/linux/cloudwatch-agent-custom-resource.yaml
#	charts/amazon-cloudwatch-observability/values.yaml
@sky333999
Copy link
Contributor

There's room for improvements with how we handle the overlays for agents on top of the default agent, but that can be a follow-up.

Did a helm template render of the chart with and without this change and the diffs look as expected - essentially a no-op in the default case.

@sky333999 sky333999 merged commit 28fee3b into main Dec 18, 2024
3 checks passed
@sky333999 sky333999 deleted the target-allocator branch December 18, 2024 00:31
@David-Crty
Copy link

I don't understand why this is merged into the main, but no new releases are done.

How can we know if this available on release 2.6.0 or not ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants