Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions charts/dataplane/templates/event-exporter/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{- if .Values.eventExporter.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "union-operator.fullname" . }}-event-exporter
namespace: {{ .Release.Namespace }}
labels:
{{- include "unionai-dataplane.labels" . | nindent 4 }}
app.kubernetes.io/component: event-exporter
data:
config.yaml: |
logLevel: {{ .Values.eventExporter.logLevel }}
logFormat: json
route:
routes:
{{- if .Values.eventExporter.routes }}
{{- toYaml .Values.eventExporter.routes | nindent 8 }}
{{- else }}
- receiver: "prometheus"
{{- end }}
receivers:
- name: "prometheus"
prometheus:
port: {{ .Values.eventExporter.metricsPort }}
ttl: {{ .Values.eventExporter.metricsTTL }}
{{- end }}
17 changes: 17 additions & 0 deletions charts/dataplane/templates/event-exporter/dashboard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if and .Values.eventExporter.enabled .Values.monitoring.dashboards.enabled }}
{{- $label := .Values.monitoring.dashboards.label | default "grafana_dashboard" }}
{{- $labelValue := .Values.monitoring.dashboards.labelValue | default "1" }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-dashboard-union-pod-events
namespace: {{ .Release.Namespace }}
labels:
{{ $label }}: {{ $labelValue | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- include "unionai-dataplane.labels" . | nindent 4 }}
app.kubernetes.io/component: event-exporter
data:
union-pod-events.json: |-
{{ .Files.Get "files/union-pod-events.json" | indent 4 }}
{{- end }}
62 changes: 62 additions & 0 deletions charts/dataplane/templates/event-exporter/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{- if .Values.eventExporter.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "union-operator.fullname" . }}-event-exporter
namespace: {{ .Release.Namespace }}
labels:
{{- include "unionai-dataplane.labels" . | nindent 4 }}
app.kubernetes.io/component: event-exporter
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/component: event-exporter
{{- include "unionai-dataplane.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
configChecksum: {{ include (print .Template.BasePath "/event-exporter/configmap.yaml") . | sha256sum | trunc 63 | quote }}
labels:
app.kubernetes.io/component: event-exporter
{{- include "unionai-dataplane.selectorLabels" . | nindent 8 }}
spec:
serviceAccountName: {{ include "union-operator.fullname" . }}-event-exporter
securityContext:
runAsNonRoot: true
runAsUser: 65534
containers:
- name: event-exporter
image: "{{ .Values.eventExporter.image.repository }}:{{ .Values.eventExporter.image.tag }}"
args:
- -conf=/data/config.yaml
ports:
- name: metrics
containerPort: {{ .Values.eventExporter.metricsPort }}
protocol: TCP
resources:
{{- toYaml .Values.eventExporter.resources | nindent 12 }}
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
- mountPath: /data
name: config
volumes:
- name: config
configMap:
name: {{ include "union-operator.fullname" . }}-event-exporter
{{- with .Values.eventExporter.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.eventExporter.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.eventExporter.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
36 changes: 36 additions & 0 deletions charts/dataplane/templates/event-exporter/rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{{- if .Values.eventExporter.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "union-operator.fullname" . }}-event-exporter
labels:
{{- include "unionai-dataplane.labels" . | nindent 4 }}
app.kubernetes.io/component: event-exporter
rules:
- apiGroups: [""]
resources:
- events
- namespaces
- nodes
- pods
verbs:
- get
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "union-operator.fullname" . }}-event-exporter
labels:
{{- include "unionai-dataplane.labels" . | nindent 4 }}
app.kubernetes.io/component: event-exporter
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "union-operator.fullname" . }}-event-exporter
subjects:
- kind: ServiceAccount
name: {{ include "union-operator.fullname" . }}-event-exporter
namespace: {{ .Release.Namespace }}
{{- end }}
24 changes: 24 additions & 0 deletions charts/dataplane/templates/event-exporter/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{- if .Values.eventExporter.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "union-operator.fullname" . }}-event-exporter
namespace: {{ .Release.Namespace }}
labels:
{{- include "unionai-dataplane.labels" . | nindent 4 }}
app.kubernetes.io/component: event-exporter
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "{{ .Values.eventExporter.metricsPort }}"
prometheus.io/path: "/metrics"
spec:
selector:
app.kubernetes.io/component: event-exporter
{{- include "unionai-dataplane.selectorLabels" . | nindent 4 }}
ports:
- name: metrics
port: {{ .Values.eventExporter.metricsPort }}
targetPort: metrics
protocol: TCP
type: ClusterIP
{{- end }}
14 changes: 14 additions & 0 deletions charts/dataplane/templates/event-exporter/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- if .Values.eventExporter.enabled }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "union-operator.fullname" . }}-event-exporter
namespace: {{ .Release.Namespace }}
labels:
{{- include "unionai-dataplane.labels" . | nindent 4 }}
app.kubernetes.io/component: event-exporter
{{- with .Values.eventExporter.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
3 changes: 2 additions & 1 deletion charts/dataplane/templates/prometheus/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ data:
metric_relabel_configs:
- separator: ;
source_labels: [__name__]
regex: kube_pod_container_resource_(limits|requests)|kube_pod_status_phase|kube_node_(labels|status_allocatable|status_condition|status_capacity)|kube_namespace_labels|kube_pod_container_status_(waiting|terminated|last_terminated).*_reason|kube_daemonset_status_number_unavailable|kube_deployment_status_replicas_unavailable|kube_resourcequota|kube_pod_info|kube_node_info|kube_pod_container_status_restarts_total
regex: kube_pod_container_resource_(limits|requests)|kube_pod_status_phase|kube_node_(labels|status_allocatable|status_condition|status_capacity)|kube_namespace_labels|kube_pod_container_status_(waiting|terminated|last_terminated).*_reason|kube_daemonset_status_number_unavailable|kube_deployment_status_replicas_unavailable|kube_resourcequota|kube_pod_info|kube_node_info|kube_pod_container_status_restarts_total{{- if .Values.eventExporter.enabled }}|kube_event_count{{- end }}
action: keep
- separator: ;
source_labels: [__name__, phase]
Expand Down Expand Up @@ -163,6 +163,7 @@ data:
label: app.kubernetes.io/name=dcgm-exporter
{{- end }}


{{- if .Values.cost.enabled }}
rules.yml: |
{{ include "cost.recording-rules" . | nindent 4 }}
Expand Down
46 changes: 44 additions & 2 deletions charts/dataplane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,49 @@ prometheus:

# -- Standalone kube-state-metrics for Union features (cost tracking, pod resource metrics).
# Metric filtering is handled in the Prometheus static scrape config.
kube-state-metrics: {}
# The events collector is always enabled so that kube_event_count is available
# for the eventExporter Grafana dashboard and AlertManager rules.
kube-state-metrics:
collectors:
- certificatesigningrequests
- configmaps
- cronjobs
- daemonsets
- deployments
- endpoints
- events
- horizontalpodautoscalers
- ingresses
- jobs
- leases
- limitranges
- mutatingwebhookconfigurations
- namespaces
- networkpolicies
- nodes
- persistentvolumeclaims
- persistentvolumes
- poddisruptionbudgets
- pods
- replicasets
- replicationcontrollers
- resourcequotas
- secrets
- serviceaccounts
- services
- statefulsets
- storageclasses
- validatingwebhookconfigurations
- volumeattachments

# -- Pod event visibility via Prometheus.
# Uses the kube-state-metrics events collector (already deployed) to expose
# kube_event_count — no extra container required.
# When enabled, allows kube_event_count through the Prometheus scrape filter
# and deploys a Grafana dashboard (when monitoring.dashboards.enabled is also true).
eventExporter:
# -- Enable pod event metrics and the Grafana dashboard.
enabled: false

# -- Scopes the deployment, permissions and actions created into a single namespace
low_privilege: false
Expand Down Expand Up @@ -1654,7 +1696,7 @@ extraObjects: []

## -- Automatically create namespaces to deploy into
namespaces:
enabled: true
enabled: false

monitoring:
enabled: false
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/dataplane.additional-podlabels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5077,7 +5077,7 @@ spec:
- name: kube-state-metrics
args:
- --port=8080
- --resources=certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,horizontalpodautoscalers,ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments
- --resources=certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,events,horizontalpodautoscalers,ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,serviceaccounts,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments
imagePullPolicy: IfNotPresent
image: registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.15.0
ports:
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/dataplane.additional-templates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5136,7 +5136,7 @@ spec:
- name: kube-state-metrics
args:
- --port=8080
- --resources=certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,horizontalpodautoscalers,ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments
- --resources=certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,events,horizontalpodautoscalers,ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,serviceaccounts,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments
imagePullPolicy: IfNotPresent
image: registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.15.0
ports:
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/dataplane.aws.eks-automode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5631,7 +5631,7 @@ spec:
- name: kube-state-metrics
args:
- --port=8080
- --resources=certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,horizontalpodautoscalers,ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments
- --resources=certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,events,horizontalpodautoscalers,ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,serviceaccounts,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments
imagePullPolicy: IfNotPresent
image: registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.15.0
ports:
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/dataplane.aws.with-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5089,7 +5089,7 @@ spec:
- name: kube-state-metrics
args:
- --port=8080
- --resources=certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,horizontalpodautoscalers,ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments
- --resources=certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,events,horizontalpodautoscalers,ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,serviceaccounts,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments
imagePullPolicy: IfNotPresent
image: registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.15.0
ports:
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/dataplane.aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5567,7 +5567,7 @@ spec:
- name: kube-state-metrics
args:
- --port=8080
- --resources=certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,horizontalpodautoscalers,ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments
- --resources=certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,events,horizontalpodautoscalers,ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,serviceaccounts,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments
imagePullPolicy: IfNotPresent
image: registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.15.0
ports:
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/dataplane.azure-custom-storage-prefix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5184,7 +5184,7 @@ spec:
- name: kube-state-metrics
args:
- --port=8080
- --resources=certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,horizontalpodautoscalers,ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments
- --resources=certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,events,horizontalpodautoscalers,ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,serviceaccounts,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments
imagePullPolicy: IfNotPresent
image: registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.15.0
ports:
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/dataplane.azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5186,7 +5186,7 @@ spec:
- name: kube-state-metrics
args:
- --port=8080
- --resources=certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,horizontalpodautoscalers,ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments
- --resources=certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,events,horizontalpodautoscalers,ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,serviceaccounts,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments
imagePullPolicy: IfNotPresent
image: registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.15.0
ports:
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/dataplane.cost.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4935,7 +4935,7 @@ spec:
- name: kube-state-metrics
args:
- --port=8080
- --resources=certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,horizontalpodautoscalers,ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments
- --resources=certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,events,horizontalpodautoscalers,ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,serviceaccounts,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments
imagePullPolicy: IfNotPresent
image: registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.15.0
ports:
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/dataplane.dcgm-exporter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5424,7 +5424,7 @@ spec:
- name: kube-state-metrics
args:
- --port=8080
- --resources=certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,horizontalpodautoscalers,ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments
- --resources=certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,events,horizontalpodautoscalers,ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,serviceaccounts,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments
imagePullPolicy: IfNotPresent
image: registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.15.0
ports:
Expand Down
Loading
Loading