spinkube / runtime-class-manager

A Kubernetes operator to manage Runtime Classes
Apache License 2.0
23 stars 6 forks source link

Add Shim Status information to `.shim.status` #51

Open voigt opened 4 months ago

voigt commented 4 months ago

As a shim operator, I would like to see correct status information per shim in the .shim.status field.

Furthermore we'd like to display proper conditions, depending on the rollout state of the shim.

Possible example:

status:
  nodes: 3
  readyNodes: 2
  updatedNodes: 2
  conditions:
  - lastTransitionTime: "2024-01-30T22:38:57Z"
    lastUpdateTime: "2024-01-30T22:38:57Z"
    message: Shim has minimum availability.
    reason: MinimumShimsAvailable
    status: "True"
    type: Available
  - lastTransitionTime: "2024-01-30T22:38:54Z"
    lastUpdateTime: "2024-01-30T22:39:06Z"
    message: Job "<nodename>-<shimname>" has successfully progressed.
    reason: NewShimAvailable
    status: "True"
    type: Progressing

Please consider this as an idea for inspiration only. I welcome any suggestions for displaying the relevant status information!

rajatjindal commented 3 months ago

this will be a great addition. would adding the shim version as part of the status field makes sense as well? it will be useful to have that info exposed as status field that other tools can then read. (e.g. spinkube-doctor)

voigt commented 2 months ago

Interesting thought @rajatjindal! Any idea where to get this info from?

If you consider the shim spec, there is no reliable source to derive the shim version from. Here an example:

apiVersion: runtime.kwasm.sh/v1alpha1 
kind: Shim
metadata:
  name: spin-v2
  labels:
[...]
spec:
  nodeSelector:
    spin: "true"

  fetchStrategy:
    type: annonymousHttp
    anonHttp:
      location: "https://github.com/spinkube/containerd-shim-spin/releases/download/v0.14.1/containerd-shim-spin-v2-linux-aarch64.tar.gz"

  runtimeClass:
    name: spin-v2
    handler: spin

  rolloutStrategy:
    type: recreate

We could extract it from the filename or the URL path. But this is not a universally applicable approach. Not sure if it is worth to adjust the spec and add a version...? This again would require manual maintenance...