Skip to content

Commit

Permalink
✨ Add proto for operator Cluster endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
MatiasFrank committed Oct 29, 2024
1 parent e0abed4 commit 0f60814
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 0 deletions.
69 changes: 69 additions & 0 deletions docs/docs/api/platform-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
| /api.v1.cluster.Service/List | [ListRequest](#api-v1-cluster-ListRequest) | [ListResponse](#api-v1-cluster-ListResponse) | |
| /api.v1.cluster.Service/GetConfig | [GetConfigRequest](#api-v1-cluster-GetConfigRequest) | [GetConfigResponse](#api-v1-cluster-GetConfigResponse) | GetConfig returns the config for the cluster. |
| /api.v1.cluster.Service/GetConfigs | [GetConfigsRequest](#api-v1-cluster-GetConfigsRequest) | [GetConfigsResponse](#api-v1-cluster-GetConfigsResponse) | GetConfigs returns the configs for all clusters. |
| /api.v1.cluster.Service/ListNodePods | [ListNodePodsRequest](#api-v1-cluster-ListNodePodsRequest) | [ListNodePodsResponse](#api-v1-cluster-ListNodePodsResponse) | |



Expand Down Expand Up @@ -2289,6 +2290,22 @@ A reference to a kubernetes object.



<a name="model-Resources"></a>

### Resources



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| cpu_millis | [uint64](#uint64) | | |
| memory_bytes | [uint64](#uint64) | | |









Expand Down Expand Up @@ -7507,6 +7524,37 @@ Empty Response for getting the configs of all clusters.



<a name="api-v1-cluster-ListNodePodsRequest"></a>

### ListNodePodsRequest



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| cluster_name | [string](#string) | | |
| node_name | [string](#string) | | |






<a name="api-v1-cluster-ListNodePodsResponse"></a>

### ListNodePodsResponse



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| pods | [Pod](#api-v1-cluster-Pod) | repeated | |






<a name="api-v1-cluster-ListRequest"></a>

### ListRequest
Expand Down Expand Up @@ -7537,6 +7585,25 @@ Response for listing available clusters.



<a name="api-v1-cluster-Pod"></a>

### Pod



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| pod_name | [string](#string) | | |
| namespace | [string](#string) | | |
| project_name | [string](#string) | | |
| environment_name | [string](#string) | | |
| capsule_name | [string](#string) | | |






<a name="api-v1-cluster-Registry"></a>

### Registry
Expand Down Expand Up @@ -8594,6 +8661,7 @@ A docker image tag.
| environment | [bool](#bool) | | |
| capsule | [bool](#bool) | | |
| metric_name | [bool](#bool) | | |
| cluster | [string](#string) | | |
| all | [bool](#bool) | | |


Expand Down Expand Up @@ -8645,6 +8713,7 @@ A docker image tag.
| environment | [string](#string) | | |
| capsule | [string](#string) | | |
| metric_name | [string](#string) | | |
| cluster | [string](#string) | | |



Expand Down
19 changes: 19 additions & 0 deletions proto/rig/api/v1/cluster/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ service Service {
rpc GetConfig(GetConfigRequest) returns (GetConfigResponse) {}
// GetConfigs returns the configs for all clusters.
rpc GetConfigs(GetConfigsRequest) returns (GetConfigsResponse) {}

rpc ListNodePods(ListNodePodsRequest) returns (ListNodePodsResponse) {}
}

// request for getting cluster config for an environment.
Expand Down Expand Up @@ -69,3 +71,20 @@ message ListResponse {
// List of clusters.
repeated api.v1.cluster.Cluster clusters = 1;
}

message ListNodePodsRequest {
string cluster_name = 1;
string node_name = 2;
}

message ListNodePodsResponse {
repeated Pod pods = 1;
}

message Pod {
string pod_name = 1;
string namespace = 2;
string project_name = 3;
string environment_name = 4;
string capsule_name = 5;
}
2 changes: 2 additions & 0 deletions proto/rig/api/v1/metrics/metrics.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ message Tags {
string environment = 2;
string capsule = 3;
string metric_name = 4;
string cluster = 5;
}

message Keys {
bool project = 1;
bool environment = 2;
bool capsule = 3;
bool metric_name = 4;
string cluster = 6;
bool all = 5;
}
5 changes: 5 additions & 0 deletions proto/rig/model/metrics.proto
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,8 @@ message ObjectReference {
// Api version of the object.
string api_version = 3;
}

message Resources {
uint64 cpu_millis = 1;
uint64 memory_bytes = 2;
}
38 changes: 38 additions & 0 deletions proto/rig/operator/api/v1/cluster/service.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
syntax = "proto3";

package api.v1.operator.cluster;

import "model/metrics.proto";

service Service {
rpc GetNodes(GetNodesRequest) returns (GetNodesResponse) {}
rpc GetNodePods(GetNodePodsRequest) returns (GetNodePodsResponse) {}
}

message GetNodesRequest {}

message GetNodesResponse {
repeated Node nodes = 1;
}

message Node {
string node_name = 1;
model.Resources allocateable = 2;
model.Resources usage = 3;
uint64 max_pods = 4;
}

message GetNodePodsRequest {
string node_name = 1;
}

message GetNodePodsResponse {
repeated Pod pods = 1;
}

message Pod {
string pod_name = 1;
string namespace = 2;
model.Resources requested = 3;
string capsule_name = 4;
}

0 comments on commit 0f60814

Please sign in to comment.