Repository navigation
WIP: --same-prefix-color: same color pods with same prefix - #322
martinpovolny wants to merge 1 commit into
Conversation
--same-prefix-color -- use the same color for pods that have the same name prefix such as 'api-1' and 'api-2' Also prevent colisions in the hash function if there's enough colors. Example: "query" and "reader"
|
Hi, thanks for the PR!
This is an interesting feature, but I believe it might be challenging to determine the correct prefix in all cases. In your code, the prefix is defined as the part before the first If you want to colorize pods by their owner objects, like ReplicaSet or Statefulset, we could use apiVersion: v1
kind: Pod
metadata:
creationTimestamp: "2024-10-05T11:28:35Z"
generateName: kube-proxy- # <-- pod.metadata.generateName
labels:
controller-revision-hash: 5976bc5f75
k8s-app: kube-proxy
pod-template-generation: "1"
name: kube-proxy-knwd2
namespace: kube-system
ownerReferences: # <-- pod.metadata.ownerReferences
- apiVersion: apps/v1
blockOwnerDeletion: true
controller: true
kind: DaemonSet
name: kube-proxy
uid: 3cac7f5b-dae4-4b72-9836-c4276a7a2b22
resourceVersion: "378"
uid: 5ccd2aa4-37a8-45c5-bf18-f43483c7cc03 |
|
Thank you for the PR, and sorry for leaving this open for so long. I'm closing this PR due to inactivity since the review comment above. In the meantime, #375 introduced |
First shot (please, suggest a better approach) at 2 issues that I hit.
--same-prefix-color -- use the same color for pods that have the same name prefix such as 'api-1' and 'api-2'
Prevent collisions of color assignment if there are enough colors "query" and "reader"
I have pods from different stateful sets that I would like to color the same, but different for each SS:
with these changes I can do:
and get the desired effect
Please, advise what changes would make this PR or it's part acceptable for the project.
Thank you!