Repository navigation
How to build a custom pod view? #882
|
Hi, while it is already possible to customize the pod view, I couldn't find a way to create second custom pod view. So, I'd like to have a custom resource name like "images" which shows "[namespace],pod,image,tag" and another one for normal pod view. Currently I have: [views."v1/pods"]
replace = true
columns = [
{ name = "NAME", builtin = "NAME" },
{ name = "READY", builtin = "READY" },
{ name = "STATUS", builtin = "STATUS" },
{ name = "RESTARTS", builtin = "RESTARTS" },
{ name = "CPU", metric = "cpu" },
{ name = "CPU/R", metric = "cpu-request", wide = true },
{ name = "%CPU/R", metric = "cpu-request-utilization", wide = true },
{ name = "%CPU/L", metric = "cpu-limit-utilization", wide = true },
{ name = "MEM", metric = "memory" },
{ name = "%MEM/R", metric = "memory-request-utilization", wide = true },
{ name = "%MEM/L", metric = "memory-limit-utilization", wide = true },
{ name = "AGE", builtin = "AGE" },
{ name = "SPILO-ROLE", path = "/metadata/labels/spilo-role" },
]I'd need something like this in addition to the above: [views."v1/pods".images]
replace = true
columns = [
{ name = "NAME", builtin = "NAME" },
{ name = "IMAGE", path = "/spec/containers/0/image", format = "image", wide = true },
{ name = "TAG", path = "/spec/containers/0/image", format = "image-tag", wide = true },
]But this doesn't work, it loads, but I can't swith to this "image" view. Is this possible somehow? |
Replies: 2 comments 1 reply
|
Not possible right now. Each resource has one layout (plus optional Closest you can get today is to put the image columns in your main pod view as wide-only columns and toggle them with { name = "IMAGE", path = "/spec/containers/0/image", wide = true },
{ name = "TAG", path = "/spec/containers/0/image", format = "image-tag", wide = true },( Named view variants (something like |
Not possible right now. Each resource has one layout (plus optional
@namespacevariants), so[views."v1/pods".images]is ignored. It should warn about that, and I'll fix it.Closest you can get today is to put the image columns in your main pod view as wide-only columns and toggle them with
w:(
format = "image"doesn't exist; leaveformatoff to get the full image string.)Named view variants (something like
[views."pods:images"]plus:pods:images, or a key to cycle through them) sound useful. I'll think about the shape.