Skip to content

Commit

Permalink
feat: allow disabling event reporter
Browse files Browse the repository at this point in the history
  • Loading branch information
ATGardner authored Feb 10, 2025
2 parents 4f5622b + 0a88a43 commit 6c4bfbf
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 6 deletions.
1 change: 1 addition & 0 deletions charts/argo-cd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,7 @@ NAME: my-release
| eventReporter.containerSecurityContext | object | See [values.yaml] | Event reporter container-level security context |
| eventReporter.dnsConfig | object | `{}` | [DNS configuration] |
| eventReporter.dnsPolicy | string | `"ClusterFirst"` | Alternative DNS policy for event reporter pods |
| eventReporter.enabled | bool | `true` | |
| eventReporter.env | list | `[]` | Environment variables to pass to event reporter |
| eventReporter.envFrom | list | `[]` (See [values.yaml]) | envFrom to pass to event reporter |
| eventReporter.extraArgs | list | `[]` | Additional command line arguments to pass to event reporter |
Expand Down
2 changes: 2 additions & 0 deletions charts/argo-cd/templates/event-reporter/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.eventReporter.enabled }}
{{- $config := .Values.eventReporter.clusterAdminAccess | default dict -}}
{{- if hasKey $config "enabled" | ternary $config.enabled .Values.createClusterRoles }}
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -22,3 +23,4 @@ rules:
- '*'
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.eventReporter.enabled }}
{{- $config := .Values.eventReporter.clusterAdminAccess | default dict -}}
{{- if hasKey $config "enabled" | ternary $config.enabled .Values.createClusterRoles }}
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -15,3 +16,4 @@ subjects:
name: {{ include "argo-cd.eventReporterServiceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/argo-cd/templates/event-reporter/metrics.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.eventReporter.metrics.enabled }}
{{- if and .Values.eventReporter.enabled .Values.eventReporter.metrics.enabled }}
apiVersion: v1
kind: Service
metadata:
Expand Down
2 changes: 1 addition & 1 deletion charts/argo-cd/templates/event-reporter/networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.global.networkPolicy.create }}
{{- if and .Values.eventReporter.enabled .Values.global.networkPolicy.create }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
Expand Down
2 changes: 1 addition & 1 deletion charts/argo-cd/templates/event-reporter/pdb.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.eventReporter.pdb.enabled }}
{{- if and .Values.eventReporter.enabled .Values.eventReporter.pdb.enabled }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and .Values.eventReporter.metrics.enabled .Values.eventReporter.metrics.rules.enabled }}
{{- if and .Values.eventReporter.enabled .Values.eventReporter.metrics.enabled .Values.eventReporter.metrics.rules.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
Expand Down
2 changes: 2 additions & 0 deletions charts/argo-cd/templates/event-reporter/role.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.eventReporter.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
Expand Down Expand Up @@ -40,3 +41,4 @@ rules:
verbs:
- create
- list
{{- end }}
2 changes: 2 additions & 0 deletions charts/argo-cd/templates/event-reporter/rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.eventReporter.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
Expand All @@ -13,3 +14,4 @@ subjects:
- kind: ServiceAccount
name: {{ template "argo-cd.eventReporterServiceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.eventReporter.serviceAccount.create }}
{{- if and .Values.eventReporter.enabled .Values.eventReporter.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
automountServiceAccountToken: {{ .Values.eventReporter.serviceAccount.automountServiceAccountToken }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") .Values.eventReporter.metrics.enabled .Values.eventReporter.metrics.serviceMonitor.enabled }}
{{- if and .Values.eventReporter.enabled (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") .Values.eventReporter.metrics.enabled .Values.eventReporter.metrics.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
Expand Down
2 changes: 2 additions & 0 deletions charts/argo-cd/templates/event-reporter/statefulset.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.eventReporter.enabled }}
apiVersion: apps/v1
kind: StatefulSet
metadata:
Expand Down Expand Up @@ -322,3 +323,4 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
dnsPolicy: {{ .Values.eventReporter.dnsPolicy }}
{{- end }}
1 change: 1 addition & 0 deletions charts/argo-cd/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3755,6 +3755,7 @@ notifications:

eventReporter:
name: event-reporter
enabled: true
## Amount of replicas for event reporting sharding
replicas: 3
## Event reporter Pod Disruption Budget
Expand Down

0 comments on commit 6c4bfbf

Please sign in to comment.