Skip to content

Add refresh icon for refetching the Kuberentes resources on the Environments page

Currently, we show static data on the Kubernetes resources tab of the environment. Implement Watch API for Kubernetes API calls (#422945 - closed) implemented we are going to start watching for the pods and flux sync status. In the future, we'll add Watch API support for all the workload types. The Watch API receives the data for 5 minutes until it timeouts (Kubernetes limit). As we don't want to resubscribe to an event stream automatically, we need to add a refresh icon for the user.

The refresh icon should refresh the whole Kubernetes section and resubscribe to the Watch API.

Together with the refresh icon, we'll need an indicator of the resources being watched.

Proposal:

Add a refresh icon to the top right of the collapsable dashboard, as well as tooltips depending on data state.

Up to Date Expired Refreshing
Screenshot_2023-11-20_at_8.43.30_AM Screenshot_2023-11-20_at_8.43.36_AM Screenshot_2023-11-20_at_8.43.43_AM

Full UX Flow

Figma File

Implementation proposal

  1. Subscribe to the timeout event from the WatchAPI.
  2. Add a solution to keep the subscription state:
    • Update it to 'loading' once the first WatchAPI query gets executed
    • Update it to 'up-to-date' once the last Watch API query is executed
    • Update it to 'expired' once the first Watch API query times out.
  3. Add corresponding query and mutation.
  4. According to this state render the refresh icon and the tooltip as per the design.

Release Notes

Add a dedicated refresh mechanism to allow users to manually refetch Kubernetes resource data in the environment page

Edited by Nicolò Maria Mezzopera