Pending Workloads on-demand
This page shows you how to monitor pending workloads with VisibilityOnDemand
feature.
The intended audience for this page are batch administrators, and batch users for Local Queue Visibility section.
From version v0.6.0, Kueue provides the ability for a batch administrators to monitor the pipeline of pending jobs, and help users to estimate when their jobs will start.
Before you begin
Make sure the following conditions are met:
- A Kubernetes cluster is running.
- The kubectl command-line tool has communication with your cluster.
- Kueue is installed in version v0.6.0 or later.
Configure API Priority and Fairness:
To install the API Priority and Fairness configuration for the visibility API apply one of the manifests, depending on your Kubernetes version:
Directly accessing the Visibility API
If you want to directly access the Visibility API with a http client like
curl
or wget
, or a browser, there are multiple ways you can locate and
authenticate against the Visibility API server:
(Recommended) Using kubectl proxy
Run kubectl in proxy mode. This method is recommended, since it uses the stored API server location and verifies the identity of the API server using a self-signed certificate. No man-in-the-middle (MITM) attack is possible using this method.
For more details, see kubectl documentation.
Without kubectl proxy
Alternatively, you can provide the location and credentials directly to the http client. This works with client code that is confused by proxies. To protect against man in the middle attacks, you’ll need to import a root cert into your browser.
For more details, see kubectl documentation.
You then need to create ClusterRole
and ClusterRoleBinding
for that same (default) k8s service account
using a command:
Monitor pending workloads on demand
Note
VisibilityOnDemand
is a Beta feature enabled by default.
You can disable it by setting the VisibilityOnDemand
feature gate. Check the Installation guide for details on feature gate configuration.
To install a simple setup of ClusterQueue
run the following command:
Now, let’s create 6 jobs
using a command:
3 of them saturate the ClusterQueue and the other 3 should be pending.
Cluster Queue visibility via kubectl
To view pending workloads in ClusterQueue cluster-queue
run the following command:
You should get results similar to:
You can pass optional query parameters:
- limit
<integer>
- 1000 on default. It indicates max number of pending workloads that should be fetched. - offset
<integer>
- 0 by default. It indicates position of the first pending workload that should be fetched, starting from 0.
To view only 1 pending workloads use, starting from position 1 in ClusterQueue run:
You should get results similar to
Cluster Queue visibility via curl
If you followed steps described in Directly accessing the Visibility API above, you can use curl to view pending workloads in ClusterQueue using following commands:
You should get results similar to:
Local Queue visibility via kubectl
Similarly to ClusterQueue, to view pending workloads in LocalQueue user-queue
run the following command:
You should get results similar to:
You can pass optional query parameters:
- limit
<integer>
- 1000 on default. It indicates max number of pending workloads that should be fetched. - offset
<integer>
- 0 by default. It indicates position of the first pending workload that should be fetched, starting from 0.
To view only 1 pending workloads use, starting from position 1 in LocalQueue run:
You should get results similar to
Local Queue visibility via curl
If you followed steps described in Directly accessing the Visibility API above, you can use curl to view pending workloads in LocalQueue using following commands:
You should get results similar to:
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.