-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support multiple AmazonCloudWatchAgent CRs and add integration for Pr…
…ometheus Target Allocator (#126)
- Loading branch information
Showing
9 changed files
with
1,755 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
build | ||
.tmp | ||
*.iml | ||
.DS_Store | ||
*.DS_Store | ||
.idea | ||
.attach_pid* | ||
bin |
1,571 changes: 1,571 additions & 0 deletions
1,571
...mazon-cloudwatch-observability/crds/cloudwatch.aws.amazon.com_amazoncloudwatchagents.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
charts/amazon-cloudwatch-observability/templates/target-allocator-clusterrole.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{{- if .Values.agent.enabled }} | ||
{{- range $i, $customAgent := .Values.agents }} | ||
{{- if and (and (hasKey ($customAgent.prometheus) "targetAllocator") (hasKey ($customAgent.prometheus.targetAllocator) "enabled")) $customAgent.prometheus.targetAllocator.enabled }} | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
labels: | ||
{{- include "amazon-cloudwatch-observability.labels" $ | nindent 4}} | ||
name: "cloudwatch-agent-target-allocator-role" | ||
rules: | ||
- apiGroups: [ "" ] | ||
resources: [ "pods", "nodes", "nodes/metrics", "services", "endpoints" ] | ||
verbs: [ "list", "watch", "get" ] | ||
- apiGroups: [ "" ] | ||
resources: [ "configmaps" ] | ||
verbs: [ "get" ] | ||
- apiGroups: ["discovery.k8s.io"] | ||
resources: ["endpointslices"] | ||
verbs: ["get", "list", "watch"] | ||
- apiGroups: [ "networking.k8s.io"] | ||
resources: ["ingresses"] | ||
verbs: ["get", "list", "watch"] | ||
- nonResourceURLs: ["/metrics"] | ||
verbs: ["get"] | ||
{{- if and (hasKey ($customAgent.prometheus.targetAllocator) "PrometheusCR") $customAgent.prometheus.targetAllocator.PrometheusCR.enabled }} | ||
- apiGroups: [ "monitoring.coreos.com"] | ||
resources: ["podmonitors", "servicemonitors"] | ||
verbs: ["get", "list", "watch"] | ||
{{- end }} | ||
{{- end }} | ||
--- | ||
{{- end }} | ||
{{- end }} |
21 changes: 21 additions & 0 deletions
21
charts/amazon-cloudwatch-observability/templates/target-allocator-clusterrolebinding.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{{- if .Values.agent.enabled }} | ||
{{- range $i, $customAgent := .Values.agents }} | ||
{{- if and (and (hasKey ($customAgent.prometheus) "targetAllocator") (hasKey ($customAgent.prometheus.targetAllocator) "enabled")) $customAgent.prometheus.targetAllocator.enabled }} | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
labels: | ||
{{- include "amazon-cloudwatch-observability.labels" $ | nindent 4 }} | ||
name: "cloudwatch-agent-target-allocator-rolebinding" | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: "cloudwatch-agent-target-allocator-role" | ||
subjects: | ||
- kind: ServiceAccount | ||
name: "target-allocator-service-acct" | ||
namespace: {{ $.Release.Namespace }} | ||
{{- end }} | ||
--- | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters