Skip to content
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

Add rpc interface for livestate in plugin architecture #5447

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
891 changes: 630 additions & 261 deletions pkg/model/application_live_state.pb.go

Large diffs are not rendered by default.

328 changes: 328 additions & 0 deletions pkg/model/application_live_state.pb.validate.go

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

42 changes: 42 additions & 0 deletions pkg/model/application_live_state.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ message ApplicationLiveStateSnapshot {
ECSApplicationLiveState ecs = 14;

ApplicationLiveStateVersion version = 15 [(validate.rules).message.required = true];
ApplicationLiveState application_live_state = 16;
}

message ApplicationLiveStateVersion {
Expand Down Expand Up @@ -71,6 +72,47 @@ message LambdaApplicationLiveState {
repeated LambdaResourceState resources = 1;
}

message ApplicationLiveState {
repeated ResourceState resources = 1;

enum Status {
UNKNOWN = 0;
HEALTHY = 1;
OTHER = 2;
}
// The health status of the application.
Status health_status = 2;
}

// TODO: Add some more fields to consider about the deployment for multi clusters.
message ResourceState {
enum HealthStatus {
UNKNOWN = 0;
HEALTHY = 1;
UNHEALTHY = 2;
}

// The unique ID.
string id = 1 [(validate.rules).string.min_len = 1];
// The sorted list of unique IDs of the parents.
repeated string parent_ids = 2;
// The name of resource.
string name = 3 [(validate.rules).string.min_len = 1];
// The type of this resource.
string resource_type = 4;
// The metadata of this resource.
map<string, string> resource_metadata = 5;
// The health status of this resource.
HealthStatus health_status = 6 [(validate.rules).enum.defined_only = true];
// The description of the health status.
string health_description = 7;

// The timestamp when this resource was created.
int64 created_at = 10 [(validate.rules).int64.gt = 0];
// The timestamp of the last time when this resource was updated.
int64 updated_at = 11 [(validate.rules).int64.gt = 0];
}
Comment on lines +88 to +114
Copy link
Member Author

@ffjlabo ffjlabo Dec 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diff compared to the existing livestate resource state for k8s, ecs, lambda, cloud run.

Deleted

  • owner_ids: no longer used by any kinds of application.
  • api_version, kind, namespace: these naming are k8s specific and we need to adopt the platform-neutral field for plugin architecture.

Added

  • resource_type: We decide to use it as kind to show resource type.
  • resource_metadata: We decided to add metadata as string map to add platform specific values freely (such as api_version, namespace)


// KubernetesResourceState represents the state of a single kubernetes resource object.
message KubernetesResourceState {
enum HealthStatus {
Expand Down
Loading
Loading