Resources
A resource captures a piece of system state. Each resource belongs to a “Type” which defines resource contents. Resource state can be split in two parts:- metadata: fixed set of fields describing resource - namespace, type, ID, etc.
- spec: contents of the resource (depends on resource type).
namespace, type, id).
Namespaces provide a way to avoid conflicts on duplicate resource IDs.
At the moment of this writing, all resources are local to the node and stored in memory.
So on every reboot resource state is rebuilt from scratch (the only exception is MachineConfig resource which reflects current machine config).
Controllers
Controllers run as independent lightweight threads in Talos. The goal of the controller is to reconcile the state based on inputs and eventually update outputs. A controller can have any number of resource types (and namespaces) as inputs. In other words, it watches specified resources for changes and reconciles when these changes occur. A controller might also have additional inputs: running reconcile on schedule, watchingetcd keys, etc.
A controller has a single output: a set of resources of fixed type in a fixed namespace.
Only one controller can manage resource type in the namespace, so conflicts are avoided.
Querying Resources
Talos CLI tooltalosctl provides read-only access to the resource API which includes getting specific resource,
listing resources and watching for changes.
Talos stores resources describing resource types and namespaces in meta namespace:
--namespace) can be omitted, as ResourceDefinition contains default
namespace which is used if no namespace is given:
Output
Commandtalosctl get supports following output modes:
table(default) prints resource list as a tableyamlprints pretty formatted resources with details, including full metadata spec. This format carries most details from the backend resource (e.g. comments inMachineConfigresource)jsonprints same information asyaml, some additional details (e.g. comments) might be lost. This format is useful for automated processing with tools likejq.
Watching Changes
If flag--watch is appended to the talosctl get command, the command switches to watch mode.
If list of resources was requested, talosctl prints initial contents of the list and then appends resource information for every change:
* specifies event type:
+is created-is deletedis updated
event is added to the resource representation to describe the event type.
Examples
Getting machine config:kube-apiserver:
Inspecting Controller Dependencies
Talos can report current dependencies between controllers and resources for debugging purposes:graphviz format which can be rendered to PNG with command:

