Skip to content

Commit

Permalink
Add UpdatePodSandbox to API
Browse files Browse the repository at this point in the history
This API is called by the container runtime to update pod sandbox
resources when they change. This is for the In-place Pod Resize
KEP-1287.
  • Loading branch information
chrishenzie committed Feb 6, 2025
1 parent 8955028 commit 92689e4
Show file tree
Hide file tree
Showing 9 changed files with 2,008 additions and 825 deletions.
1,900 changes: 1,113 additions & 787 deletions pkg/api/api.pb.go

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions pkg/api/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ service Plugin {
// can update any of the remaining containers in the runtime in response.
rpc StopContainer(StopContainerRequest) returns (StopContainerResponse);

// UpdatePodSandbox relays the corresponding request to the plugin.
// TODO: Add comment on anything the plugin can do in response (if
// applicable).
rpc UpdatePodSandbox(UpdatePodSandboxRequest) returns (UpdatePodSandboxResponse);

// StateChange relays any remaining pod or container lifecycle/state change
// events the plugin has subscribed for. These can be used to trigger any
// plugin-specific processing which needs to occur in connection with any of
Expand Down Expand Up @@ -206,6 +211,18 @@ message StopContainerResponse {
repeated ContainerUpdate update = 1;
}

message UpdatePodSandboxRequest {
// Pod being updated.
PodSandbox pod = 1;
// Resources to update.
LinuxResources linux_resources = 2;
}

message UpdatePodSandboxResponse {
// Requested updates to pods.
repeated PodSandboxUpdate update = 1;
}

message StateChangeEvent {
// Event type of notification.
Event event = 1;
Expand Down Expand Up @@ -234,7 +251,10 @@ enum Event {
POST_UPDATE_CONTAINER = 9;
STOP_CONTAINER = 10;
REMOVE_CONTAINER = 11;
// TODO: Should this be moved to the end (assuming it's not used anywhere)?
LAST = 12;
UPDATE_POD_SANDBOX = 13;
POST_UPDATE_POD_SANDBOX = 14;
}

// Pod metadata that is considered relevant for a plugin.
Expand Down Expand Up @@ -445,6 +465,18 @@ message ContainerEviction {
string reason = 2;
}

// Requested update to an already created pod sandbox.
message PodSandboxUpdate {
string pod_sandbox_id = 1;
LinuxPodSandboxUpdate linux = 2;
bool ignore_failure = 3;
}

// Updates to (linux) resources.
message LinuxPodSandboxUpdate {
LinuxResources resources = 1;
}

// KeyValue represents an environment variable.
message KeyValue {
string key = 1;
Expand Down
111 changes: 89 additions & 22 deletions pkg/api/api_host.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions pkg/api/api_plugin.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions pkg/api/api_service.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions pkg/api/api_ttrpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 92689e4

Please sign in to comment.