3 Commits

Author SHA1 Message Date
Andrey Smirnov
753a82188f
refactor: move pkg/resources to machinery
Fixes #4420

No functional changes, just moving packages around.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-11-15 19:50:35 +03:00
Andrey Smirnov
88f2422955
refactor: get rid of prometheus/procfs dependency in pkg/resources
This PR introduces the concept of the resource adapter: something which
wraps core resource (which defines presentation) and adds additional
fatures to it which we don't want to have in `pkg/machinery` in the
future, but at the same time there's value in keeping it next to the
resource itself.

If the concept looks good, I will continue doing it same way for other
resources.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-10-29 18:37:10 +03:00
Artem Chernyshev
76aac4bb25 feat: implement CPU and Memory stats controller
Now the latest value for CPU and Memory is also represented as COSI
resources.

Was going back and forth in the implementation but in the end decided to
use dedicated yaml structures for both CPU and Memory stats because:

- JSON tags are ignored by `go-yaml`, so the output is not really great.
- protobuf Talos definition contains fields which we don't really need
in the YAML output of `talosctl get`.
- current state of Talos resource service does not support protobuf
encoding for resources.

So the plan for Theila is to just use the structure as a dynamic object
without relying on protobufs. At least for now.

Signed-off-by: Artem Chernyshev <artem.0xD2@gmail.com>
2021-06-03 10:19:27 -07:00