Skip to content

feat: add support for more workload types #1052

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

Conversation

sleepyfoodie
Copy link
Contributor

@sleepyfoodie sleepyfoodie commented Apr 23, 2025

Update namespace_workload_pod:kube_pod_owner:relabel recording rule to support more workload types, which now include (but not limited to):

  • replicaset NEW (also supports other replicaset types e.g. Rollout)
  • deployment UPDATED - fixed replicaset appearing as deployment with empty workload label, those will now appear as the new replicaset type instead
  • daemonset
  • statefulset
  • job UPDATED - now includes support for Pod job type
  • CronJob NEW (also supports other job types e.g. ScaledJob)
  • barepod NEW - a pod without a controller
  • staticpod NEW - a pod controlled by a static file manifest on disk
  • As well as other custom pod controllers, e.g. StrimziPodSet

Unit tests for all of the above test cases have been added.

An example deployment is shown to be healthy below, which proves the individual rules are mutually exclusive (otherwise duplicate series would be rejected):

Screenshot 2025-05-29 at 12 27 59

@sleepyfoodie sleepyfoodie changed the title feat: add more support for different workload tpes feat: add more support for different workload types Apr 24, 2025
@sleepyfoodie sleepyfoodie requested a review from skl April 24, 2025 20:17
Copy link
Collaborator

@skl skl left a comment

Choose a reason for hiding this comment

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

There is another non-standard workload rule missing for workloads you would see from the following query:

group by (owner_kind) (kube_pod_owner{owner_kind!="ReplicaSet", owner_kind!="DaemonSet", owner_kind!="StatefulSet", owner_kind!="Job", owner_kind!="Node", owner_kind!=""})

That should capture workload types that are directly controlled via CRDs like StrimziPodSet for example.

No join is required for this additional rule as the pods are created directly rather than via ReplicaSets.

@sleepyfoodie sleepyfoodie requested a review from skl May 15, 2025 17:04
@skl skl changed the title feat: add more support for different workload types feat: add support for more workload types May 29, 2025
@skl skl marked this pull request as ready for review May 29, 2025 10:50
@skl skl requested a review from povilasv as a code owner May 29, 2025 10:50
@skl skl merged commit 56af5da into kubernetes-monitoring:master Jun 2, 2025
9 checks passed
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.

2 participants