-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
podresources: add Watch endpoint #1926
Closed
+48
−2
Closed
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0c6948a
podresources: add ListAndWatch function
ffromani 86596df
podresources: watch: split endpoint, add action
ffromani c4b38e3
misc minor fixes:
ffromani 45dd5d9
podresources: watch: expose resourceVersion
ffromani 1346c2a
podresources: watch: address review comments
ffromani File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,12 +60,18 @@ In this document we will discuss the motivation and code changes required for in | |
|
||
## Changes | ||
|
||
Add a v1alpha1 Kubelet GRPC service, at `/var/lib/kubelet/pod-resources/kubelet.sock`, which returns information about the kubelet's assignment of devices to containers. It obtains this information from the internal state of the kubelet's Device Manager. The GRPC Service returns a single PodResourcesResponse, which is shown in proto below: | ||
Add a v1alpha1 Kubelet GRPC service, at `/var/lib/kubelet/pod-resources/kubelet.sock`, which returns information about the kubelet's assignment of devices to containers. It obtains this information from the internal state of the kubelet's Device Manager. | ||
The GRPC Service exposes two endpoints: | ||
- `List`, which returns a single PodResourcesResponse, enabling monitor applications to poll for resources allocated to pods and containers on the node. | ||
- `Watch`, which returns a stream of PodResourcesResponse, enabling monitor applications to be notified of new resource allocation, release or resource allocation updates, using the `action` field in the response. | ||
|
||
This is shown in proto below: | ||
```protobuf | ||
// PodResources is a service provided by the kubelet that provides information about the | ||
// node resources consumed by pods and containers on the node | ||
service PodResources { | ||
rpc List(ListPodResourcesRequest) returns (ListPodResourcesResponse) {} | ||
rpc Watch(WatchPodResourcesRequest) returns (stream WatchPodResourcesResponse) {} | ||
} | ||
|
||
// ListPodResourcesRequest is the request made to the PodResources service | ||
|
@@ -76,6 +82,21 @@ message ListPodResourcesResponse { | |
repeated PodResources pod_resources = 1; | ||
} | ||
|
||
// WatchPodResourcesRequest is the request made to the Watch PodResourcesLister service | ||
message WatchPodResourcesRequest {} | ||
|
||
enum WatchPodAction { | ||
UPDATED = 0; | ||
DELETED = 1; | ||
ADDED = 2; | ||
} | ||
|
||
// WatchPodResourcesResponse is the response returned by Watch function | ||
message WatchPodResourcesResponse { | ||
WatchPodAction action = 1; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if just exposing the pod |
||
repeated PodResources pod_resources = 2; | ||
} | ||
|
||
// PodResources contains information about the node resources assigned to a pod | ||
message PodResources { | ||
string name = 1; | ||
|
@@ -98,7 +119,6 @@ message ContainerDevices { | |
|
||
### Potential Future Improvements | ||
|
||
* Add `ListAndWatch()` function to the GRPC endpoint so monitoring agents don't need to poll. | ||
* Add identifiers for other resources used by pods to the `PodResources` message. | ||
* For example, persistent volume location on disk | ||
|
||
|
@@ -164,6 +184,7 @@ Beta: | |
|
||
## Implementation History | ||
|
||
- 2020-08-XX: KEP extended with ListAndWatch function | ||
ffromani marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- 2018-09-11: Final version of KEP (proposing pod-resources endpoint) published and presented to sig-node. [Slides](https://docs.google.com/presentation/u/1/d/1xz-iHs8Ec6PqtZGzsmG1e68aLGCX576j_WRptd2114g/edit?usp=sharing) | ||
- 2018-10-30: Demo with example gpu monitoring daemonset | ||
- 2018-11-10: KEP lgtm'd and approved | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when is each action emitted? can you clarify when modified would be used in life of pod?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actions should be emitted:
I'll document better in the KEP text.
In Hindsight we most likely don't need MODIFED, will just remove it.