diff --git a/proto/info/edge_node_cluster.proto b/proto/info/edge_node_cluster.proto new file mode 100644 index 0000000..875755a --- /dev/null +++ b/proto/info/edge_node_cluster.proto @@ -0,0 +1,237 @@ +// Copyright(c) 2024 Zededa, Inc. +// All rights reserved. + +syntax = "proto3"; + +package org.lfedge.eve.info; +option go_package = "github.com/lf-edge/eve-api/go/info"; +option java_package = "org.lfedge.eve.info"; + +import "google/protobuf/timestamp.proto"; +import "info/info.proto"; + +enum KubeNodeStatus { + KUBE_NODE_STATUS_UNKNOWN = 0; + KUBE_NODE_STATUS_READY = 1; + KUBE_NODE_STATUS_NOT_READY = 2; + KUBE_NODE_STATUS_SCHEDULING_DISABLED = 3; + KUBE_NODE_STATUS_OUT_OF_DISK = 4; + KUBE_NODE_STATUS_MEMORY_PRESSURE = 5; +} + +message KubeNodeInfo { + // Name of the node + string name = 1; + + // Status of the node + KubeNodeStatus status = 2; + + // Role of the node is server or not + bool role_server = 3; + + // Creation Time of the node in the cluster + google.protobuf.Timestamp creation_timestamp = 4; + + // Version of the API Server running on the node + string api_server_sersion = 5; + + // Internal IP address of the node + string internal_ip = 6; +} + +enum StorageHealthStatus { + STORAGE_HEALTH_STATUS_UNKNOWN = 0; + STORAGE_HEALTH_STATUS_HEALTHY = 1; + STORAGE_HEALTH_STATUS_DEGRAEDED_2_REPLICA_AVAILABLE_REPLICATING = 2; + STORAGE_HEALTH_STATUS_DEGRADED_2_REPLICA_AVAILABLE_NOT_REPLICATING = 3; + STORAGE_HEALTH_STATUS_DEGRADED_1_REPLICA_AVAILABLE_REPLICATING = 4; + STORAGE_HEALTH_STATUS_DEGRADED_1_REPLICA_AVAILABLE_NOT_REPLICATING = 5; + STORAGE_HEALTH_STATUS_FAILED = 6; +} + +enum StorageVolumeState { + STORAGE_VOLUME_STATE_UNKNOWN = 0; + STORAGE_VOLUME_STATE_CREATING = 1; + STORAGE_VOLUME_STATE_ATTACHED = 2; + STORAGE_VOLUME_STATE_DETACHED = 3; + STORAGE_VOLUME_STATE_ATTACHING = 4; + STORAGE_VOLUME_STATE_DETACHING = 5; + STORAGE_VOLUME_STATE_DELETING = 6; +} + +enum StorageVolumeRobustness { + STORAGE_VOLUME_ROBUSTNESS_UNKNOWN = 0; + STORAGE_VOLUME_ROBUSTNESS_HEALTHY = 1; + STORAGE_VOLUME_ROBUSTNESS_DEGRADED = 2; + STORAGE_VOLUME_ROBUSTNESS_FAULTED = 3; +} + +enum StorageVolumePVCStatus { + STORAGE_VOLUME_PVC_STATUS_UNKNOWN = 0; + STORAGE_VOLUME_PVC_STATUS_BOUND = 1; + STORAGE_VOLUME_PVC_STATUS_PENDING = 2; + STORAGE_VOLUME_PVC_STATUS_AVAILABLE = 3; + STORAGE_VOLUME_PVC_STATUS_RELEASED = 4; + STORAGE_VOLUME_PVC_STATUS_FAILED = 5; +} + +enum StorageVolumeReplicaStatus { + STORAGE_VOLUME_REPLICA_STATUS_UNKNOWN = 0; + STORAGE_VOLUME_REPLICA_STATUS_REBUILDING = 1; + STORAGE_VOLUME_REPLICA_STATUS_ONLINE = 2; + STORAGE_VOLUME_REPLICA_STATUS_FAILED = 3; +} + +message KubePodNameSpaceInfo { + // Name of the namespace + string name = 1; + + // Number of pods in the namespace + uint32 pod_count = 2; + + // Number of pods in the namespace that are running + uint32 pod_running_count = 3; + + // Number of pods in the namespace that are pending + uint32 pod_pending_count = 4; + + // Number of pods in the namespace that are failed + uint32 pod_failed_count = 5; + + // Number of pods in the namespace that are succeeded + uint32 pod_succeeded_count = 6; +} + +enum KubePodStatus { + KUBE_POD_STATUS_UNKNOWN = 0; + KUBE_POD_STATUS_PENDING = 1; + KUBE_POD_STATUS_RUNNING = 2; + KUBE_POD_STATUS_SUCCEEDED = 3; + KUBE_POD_STATUS_CONTAINER_CREATING = 4; + KUBE_POD_STATUS_CRASHLOOP_BACKOFF = 5; + KUBE_POD_STATUS_ERROR = 6; + KUBE_POD_STATUS_EVICTED = 7; + KUBE_POD_STATUS_FAILED = 8; +} + +message KubeEVEAppPodInfo { + // Name of the EVE application + string name = 1; + + // Application Status + KubePodStatus status = 2; + + // Restart count of the application + uint32 restart_count = 3; + + // Restart time of the application, seconds ago + google.protobuf.Timestamp restart_time = 4; + + // Creation Time of the application + google.protobuf.Timestamp creation_timestamp = 5; + + // IP address of the application, on cni0 interface + string ip_address = 6; + + // Node name on which the application is running + string node_name = 7; +} + +message KubeVolumeReplicaInfo { + // Name of the volume replica + string name = 1; + + // Rebuild progress of the volume replica + uint32 rebuild_progress_percentage = 2; + + // Replica status + StorageVolumeReplicaStatus status = 3; +} + +message KubeVolumeInfo { + // Name of the volume + string name = 1; + + // Status of the volume + StorageVolumeState state = 2; + + // Robustness of the volume + StorageVolumeRobustness robustness = 3; + + // Creation Time of the volume in the cluster + google.protobuf.Timestamp creation_timestamp = 4; + + // Provisioned size of the volume in bytes + uint64 provisioned_bytes = 5; + + // Allocated size of the volume in bytes + uint64 allocated_bytes = 6; + + // PV/PVC status of the volume + StorageVolumePVCStatus pvc_status = 7; + + // Replicas of the volume + repeated KubeVolumeReplicaInfo replica = 8; +} + +message KubeStorageInfo { + // Overall status of Longhorn + StorageHealthStatus health = 1; + + // time of the health status transition + google.protobuf.Timestamp transition_time = 2; + + // Status of all the volumes in Longhorn + repeated KubeVolumeInfo volumes = 3; +} + +enum KubeCompUpgradeStatus { + KUBE_COMP_UPGRADE_STATUS_UNKNOWN = 0; + KUBE_COMP_UPGRADE_STATUS_DOWNLOAD = 1; + KUBE_COMP_UPGRADE_STATUS_DOWNLOAD_FAILED = 2; + KUBE_COMP_UPGRADE_STATUS_IN_PROGRESS = 3; + KUBE_COMP_UPGRADE_STATUS_FAILED = 4; + KUBE_COMP_UPGRADE_STATUS_COMPLETED = 5; +} + +enum KubeComp { + KUBE_COMP_UNKNOWN = 0; + KUBE_COMP_CONTAINERD = 1; //every node will publish + KUBE_COMP_K3S = 2; // every node will publish + KUBE_COMP_MULTUS = 3; // only the seed node will publish the remaining here and below + KUBE_COMP_KUBEVIRT = 4; + KUBE_COMP_CDI = 5; + KUBE_COMP_LONGHORN = 6; +} + +message KubeClusterUpgradeStatus { + // current_node will have an empty value when no node is in an upgrade + string current_node = 1; + + // component currently under upgrade, COMP_UNKNOWN when no upgrades in progress + KubeComp component = 2; + + // status of the current component under upgrade, KUBE_COMP_UPGRADE_STATUS_UNKNOWN when + // no upgrades in progress + KubeCompUpgradeStatus status = 3; + + // error info in case of failure + ErrorInfo error = 4; +} + +message KubeClusterInfo { + // Info message on a list of cluster nodes + repeated KubeNodeInfo nodes = 1; + + // Info message on a list of namespaces's pods summary + repeated KubePodNameSpaceInfo pod_name_spaces = 2; + + // Info message on a list of EVE applications + repeated KubeEVEAppPodInfo eve_apps = 3; + + // Info message on cluster storage + KubeStorageInfo storage = 4; + + // The current status of the cluster upgrade + KubeClusterUpgradeStatus upgrade = 5; +}