Repository navigation
Description
What you would like to be added?
Five usability changes to kli:
-
Shell completion for workload types and names.
getanddescribe(cli/cmd/get.go,cli/cmd/describe.go) have no
ValidArgsFunction. Only the-oand--phaseflags complete today
(cli/cmd/flags.go). Complete the TYPE argument from the known Karta definitions,
and complete NAME (in both theTYPE NAMEandTYPE/NAMEforms) from the
workloads of that type in the current namespace. -
Print warnings after the command output.
get,describe, anddefinitionscallprintWarnings(cli/cmd/warnings.go)
before they render, sowarning:lines show up above the table or tree and are
easy to miss. Print them after the output. They stay on stderr. -
Add a component limit to
kli describe.
Add a--component-limit <n>flag that caps the components shown under each
parent in the describe tree, and print a "N more" note when some are hidden.
The default is 0, which shows every component, as--pod-limitdoes. Keep
unhealthy components first when some are hidden. Follow the existing
--pod-limithandling (cli/cmd/describe.go,cli/pkg/generator/describe.go):
reject negative values with a usage error. -
Print a plain GVK in
kli validateoutput.
The success line is
OK: <file> is a valid Karta definition (maps kubeflow.org/v1, Kind=PyTorchJob).
This is the apimachineryschema.GroupVersionKind.String()format
(cli/cmd/validate.go, anddefinitionFilter.Stringincli/cmd/definitions.go).
Printgroup/version/Kindinstead, for examplekubeflow.org/v1/PyTorchJob, and use
the same format wherever the CLI prints a GVK. In the validate line, label it
GVK:instead ofmaps. -
Limit the components listed by
kli definitions, with the same flag.
The COMPONENTS column (cli/cmd/definitions.go) lists every component, so a
definition such as Milvus, with 18 child components, produces a very long row.
List the root and at most 3 child components, then+N more. The root only
repeats the kind, so it does not count toward the limit.--component-limit <n>
changes the cap, 0 lists every component, and a negative value is a usage error.
json and yaml output keep the full definitions.
Why is this needed?
- Completion saves typing long workload names and CRD types, and catches typos
before a request goes to the cluster. - A warning printed above a long table or tree scrolls out of view. Printed last,
it is the first thing the user sees. - Workloads with many components produce a long describe tree. The flag lets the
user cap it, while the default still shows every component. maps kubeflow.org/v1, Kind=PyTorchJobreads like an internal Go format. A single
GVK token is shorter and easier to copy.- One definition with many components widens the whole
kli definitionstable.
Capping the column keeps every row on one line.
Examples
Warnings after the output
kli get jobset, before:
warning: the Karta CRD is not installed in this cluster; showing catalog definitions only
NAME NAMESPACE PHASE AGE
preprocess ml-team Running 2h
train ml-team Running 5m
After:
NAME NAMESPACE PHASE AGE
preprocess ml-team Running 2h
train ml-team Running 5m
warning: the Karta CRD is not installed in this cluster; showing catalog definitions only
When the command fails, the error stays the last line:
warning: the Karta CRD is not installed in this cluster; showing catalog definitions only
error: no Karta definition covers "flinkdeployment"
Component limit
kli describe jobset/llama-train --component-limit 3 on a JobSet with 6 shards, where shard-4 is unschedulable. The unhealthy component keeps its row:
`-- llama-train 5/6 ready gpu: 48
|-- shard-0 1/1 ready gpu: 8
| `-- shard-0-0 Running node-00
|-- shard-1 1/1 ready gpu: 8
| `-- shard-1-0 Running node-01
|-- shard-4 0/1 ready gpu: 8
| `-- shard-4-0 Pending (Unschedulable) <none>
`-- ... and 3 more components
kli describe jobset/llama-train shows every component by default, the same as --component-limit 0:
`-- llama-train 5/6 ready gpu: 48
|-- shard-0 1/1 ready gpu: 8
| `-- shard-0-0 Running node-00
|-- shard-1 1/1 ready gpu: 8
| `-- shard-1-0 Running node-01
|-- shard-2 1/1 ready gpu: 8
| `-- shard-2-0 Running node-02
|-- shard-3 1/1 ready gpu: 8
| `-- shard-3-0 Running node-03
|-- shard-4 0/1 ready gpu: 8
| `-- shard-4-0 Pending (Unschedulable) <none>
`-- shard-5 1/1 ready gpu: 8
`-- shard-5-0 Running node-05
The Resources table keeps every component in both cases, so its rows still sum to TOTAL.
GVK in kli validate
Before:
OK: my-karta.yaml is a valid Karta definition (maps kubeflow.org/v1, Kind=PyTorchJob)
After:
OK: my-karta.yaml is a valid Karta definition (GVK: kubeflow.org/v1/PyTorchJob)
Component limit in kli definitions
kli definitions, before:
NAME KIND ORIGIN COMPONENTS
kubeflow-org-pytorchjob-v1 PyTorchJob catalog pytorchjob, master, worker
leaderworkerset-x-k8s-io-leaderworkerset-v1 LeaderWorkerSet catalog leaderworkerset, group, leader, worker
milvus-io-milvus-v1beta1 Milvus catalog milvus, standalone, proxy, mixcoord, datanode, querynode, streamingnode, indexnode, rootcoord, datacoord, querycoord, indexcoord, cdc, etcd, minio, pulsar-zookeeper, pulsar-bookkeeper, pulsar-broker, pulsar-proxy
After:
NAME KIND ORIGIN COMPONENTS
kubeflow-org-pytorchjob-v1 PyTorchJob catalog pytorchjob, master, worker
leaderworkerset-x-k8s-io-leaderworkerset-v1 LeaderWorkerSet catalog leaderworkerset, group, leader, worker
milvus-io-milvus-v1beta1 Milvus catalog milvus, standalone, proxy, mixcoord, +15 more
kli definitions --component-limit 0 prints the full list, as before.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Effort
Target date
Activity
fix(cli): omit the empty core group from a kind-only filter
fix(cli): rank a component missing its pods as unhealthy
fix(cli): rank missing pods below an unhealthy pod
fix(cli): name a single hidden component in the singular