Skip to content

Commit

Permalink
Add edge node cluster defines
Browse files Browse the repository at this point in the history
first pass adding edge node cluseter to the API
fix some Yetus errors

Signed-off-by: Gerald (Bob) Lee <bob@famleehouse.net>
  • Loading branch information
famleebob committed Apr 9, 2024
1 parent 57b8263 commit 1c04844
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 6 deletions.
3 changes: 3 additions & 0 deletions proto/config/appconfig.proto
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ message AppInstanceConfig {
// allow AppInstance to discover other AppInstances
// attached to its network instances
bool allow_to_discover = 24;

// This edge-node UUID for the Designate Node for the Application
string designated_node_id = 25;
}

message PatchEnvelopeRef {
Expand Down
4 changes: 4 additions & 0 deletions proto/config/devconfig.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import "google/protobuf/timestamp.proto";
import "evecommon/acipherinfo.proto";
import "config/appconfig.proto";
import "config/baseosconfig.proto";
import "config/edge_node_cluster.proto";
import "config/devcommon.proto";
import "config/devmodel.proto";
import "config/netconfig.proto";
Expand Down Expand Up @@ -165,6 +166,9 @@ message EdgeDevConfig {
// Configuration of the Local Operator Console (LOC)
LOCConfig loc_config = 41;
repeated EvePatchEnvelope patchEnvelopes = 42;

// cluster configuration
EdgeNodeCluster cluster = 43;
}

message ConfigRequest {
Expand Down
33 changes: 33 additions & 0 deletions proto/config/edge_node_cluster.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright(c) 2024 Zededa, Inc.
// All rights reserved.

syntax = "proto3";

package org.lfedge.eve.config;
option go_package = "github.com/lf-edge/eve-api/go/config";
option java_package = "org.lfedge.eve.config";

import "evecommon/acipherinfo.proto";

message EdgeNodeCluster {
// cluster name, in case it has multiple cluster on the same site
string cluster_name = 1;

// cluster UUID
string cluster_id = 2;

// Cluster-Interface, for example "mgmt0", this is the logicallabel of the physicalIO
string cluster_interface = 3;

// the 'cluster-prefix' IP address of the 'Cluster-Interface', 10.244.244.2/28
string cluster_ip_prefix = 4;

// This device is an 'Agent' node
bool is_worker_node = 5;

// Server IP address to join the cluster. E.g. 10.244.244.1
string join_server_ip = 6;

// encrypted token string, use edge-node TPM to decrypt
org.lfedge.eve.common.CipherBlock encrypted_cluster_token = 7;
}
4 changes: 4 additions & 0 deletions proto/config/storage.proto
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ message Volume {
string displayName = 7; // Optional friendly name echo'ed in info message
bool clear_text = 8; // Flag to indicate the volume encryption needed or not
Target target = 9; // How the volume will be presented to the instance. At the moment only the AppCustom is used

// To inform the edge-node if the device receiving this Volume is
// responsible for volume creation, convert PVC, or not
string designated_node_id = 10;
}

// DiskConfigType is the desired configuration of disks
Expand Down
27 changes: 21 additions & 6 deletions proto/info/info.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@

syntax = "proto3";

import "google/protobuf/timestamp.proto";
import "evecommon/devmodelcommon.proto";
import "evecommon/evecommon.proto";
import "info/patch_envelope.proto";

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 "evecommon/devmodelcommon.proto";
import "evecommon/evecommon.proto";
import "info/patch_envelope.proto";

// Deprecated: see deprecatedMetricItem below
enum DepMetricItemType {
Expand Down Expand Up @@ -921,6 +919,17 @@ message ZInfoSnapshot {
ErrorInfo snap_err = 6;
}

enum ZInfoClusterNodeStatus {
Z_INFO_CLUSTER_NODE_STATUS_UNSPECIFIED = 0;
Z_INFO_CLUSTER_NODE_STATUS_READY = 1; // cluster reports our node is ready
Z_INFO_CLUSTER_NODE_STATUS_NOTREADY = 2; // cluster reports our node is NOT ready
Z_INFO_CLUSTER_NODE_STATUS_DOWN = 3; // cluster API server can not be reached
}

message ZInfoClusterNode {
ZInfoClusterNodeStatus node_status = 1;
}

message ZInfoApp {
reserved 9 to 11, 19; // deprecated

Expand All @@ -940,6 +949,10 @@ message ZInfoApp {
repeated ZInfoNetwork network = 16; // up/down; allocated IP
repeated string volumeRefs = 17; // volume UUIDs
repeated ZInfoSnapshot snapshots = 18; // optional field, used to send list of snapshots on device

// Deployed app is scheduled, or rescheduled and launched on this node,
// it has the Pod Spec-name of this node, the app can be in any operating state.
bool cluster_app_running = 20;
}

// ipSec state information
Expand Down Expand Up @@ -1152,6 +1165,8 @@ message ZInfoMsg {
ZInfoHardware hwinfo = 18;
ZInfoLocation locinfo = 19;
ZInfoPatchEnvelope patchInfo = 20;
// 21 reserved
ZInfoClusterNode cluster_node = 22;
}
google.protobuf.Timestamp atTimeStamp = 6;
}
Expand Down

0 comments on commit 1c04844

Please sign in to comment.