Skip to main content
A view is a YAML document of kind View. This page lists everything it can say. For a guided introduction, see Write a view.

Files

A file can hold several views, separated by ---. A view of yours for a kind replaces KubeStacks’ view of it.

The document

string
required
Always kubestacks.dev/v1alpha1.
string
required
Always View.
string
required
The view’s name. It appears in problem messages, so make it recognizable.
object
required
What the view says, below. Any field it doesn’t know is a problem, so typos don’t go unnoticed.

spec

list
required
The kinds it’s for, at least one. Each is a kind and its API group. Leave out group for the core group’s kinds (Secret, Pod…).
string
The kind’s icon, one of the icons below.
list of fields
List columns, shown after the name and status. They replace the columns the API server prints for the kind. See Fields.
list of rules
How to tell whether an object is healthy. The first rule that applies decides. With no rule that applies, KubeStacks reads the status from the usual conventions. See Status rules.
list of fields
Facts in the detail panel’s Details section. See Fields.
Related objects, opened from the detail panel. See Links.
list of actions
Changes people can make, as patches. See Actions.

Fields

Columns and details are both fields.
string
required
The column’s header, or the fact’s name.
path
required
Where its value is. See Paths.
string
default:"string"
How it’s shown and sorted:
string
What to show when the path finds nothing.

Paths

Paths are the part of kubectl’s JSONPath that CRD printer columns use, starting with a dot. A path can also be written {.spec.x} or $.spec.x. When a path finds several values, they’re shown joined with commas.
In YAML, quote paths that contain brackets or double quotes, and anything that starts with {: '.status.conditions[?(@.type=="Ready")].status'.

Status rules

condition
When the rule applies. See Conditions. A rule without one always applies, which makes it a good last rule.
string
required
One of healthy, progressing, warning, critical or neutral. It decides the color, the icon, where the object sorts, and which filter chip counts it.
template
required
What the status says, like Ready or '{{ .status.phase }}'.
template
More about it, shown on hover.

Conditions

A condition reads one value at path, and compares it:
Comparisons ignore case, so equals: True matches Kubernetes’ "True" even though YAML reads an unquoted True as a boolean. When a path finds several values, the first is compared. Conditions combine with all and any, nested as deep as you need:
A condition has exactly one of path, all or any.

Templates

Labels, details, links, action texts and patches can include values from the object.
string
required
What the object is to this one, like Secret or Issuer.
template
required
How KubeStacks names its kind: a built-in kind (Secret, Pod, Node…), or a kind and its API group (ClusterIssuer.cert-manager.io).
template
required
Its name.
template
Its namespace. This object’s unless set, and none for cluster-wide kinds.
A link whose kind or name comes out empty isn’t shown.

Actions

Actions patch the object, like kubectl patch.
string
required
The action’s name, in menus and on its button.
object or list
required
A merge patch (an object), or, with type: json, a list of JSON patch operations. Templates work inside it.
string
default:"merge"
merge or json. A merge patch is an object, and a JSON patch is a list; anything else is a problem.
string
status, to patch the object’s status subresource.
object or list
A patch that takes the change back, offered as Undo in the notification. Same type as patch.
template
Asks first, with this text. Without it, the action runs at once.
template
The notification once it’s done.
condition
Offer the action only when this holds.
boolean
Also show it as a button in the detail panel, not only in its menu.
boolean
It’s destructive: it’s shown in red, and its confirmation starts on Cancel.
string
One of the icons.
Your account needs patch on the kind (or on its status, with subresource: status) for an action to be enabled. Like every change, it shows the equivalent kubectl patch command and is refused in a read-only cluster.

Icons

Views can use these Lucide icons, for the kind and for actions: activity, archive, bell, box, boxes, cloud, database, gauge, git-branch, globe, key-round, layers, lock, network, package, puzzle, radar, refresh-cw, rocket, route, server, shield-check, timer, workflow

Problems

KubeStacks checks every view before using it. A view with a problem isn’t used at all, and API resources lists the problem at the top, saying where it is: