Skip to content

Commit

Permalink
feat: support volume configuration, provisioning, etc
Browse files Browse the repository at this point in the history
This is early WIP.

See #8367

Signed-off-by: Andrey Smirnov <[email protected]>
  • Loading branch information
smira committed Aug 15, 2024
1 parent a5bd770 commit 7b1daf5
Show file tree
Hide file tree
Showing 89 changed files with 9,022 additions and 3,084 deletions.
2 changes: 1 addition & 1 deletion api/prototool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ lint:
ignores:
- id: FILE_OPTIONS_GO_PACKAGE_NOT_LONG_FORM
files:
- vendor/google/rpc/status.proto
- vendor/google/

rules:
# The specific linters to add.
Expand Down
70 changes: 70 additions & 0 deletions api/resource/definitions/block/block.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ package talos.resource.definitions.block;

option go_package = "github.com/siderolabs/talos/pkg/machinery/api/resource/definitions/block";

import "google/api/expr/v1alpha1/checked.proto";
import "resource/definitions/enums/enums.proto";

// DeviceSpec is the spec for devices status.
message DeviceSpec {
string type = 1;
Expand Down Expand Up @@ -34,6 +37,23 @@ message DiscoveredVolumeSpec {
string type = 14;
string device_path = 15;
string parent = 16;
string dev_path = 17;
string parent_dev_path = 18;
}

// DiscoveryRefreshRequestSpec is the spec for DiscoveryRefreshRequest.
message DiscoveryRefreshRequestSpec {
int64 request = 1;
}

// DiscoveryRefreshStatusSpec is the spec for DiscoveryRefreshStatus status.
message DiscoveryRefreshStatusSpec {
int64 request = 1;
}

// DiskSelector selects a disk for the volume.
message DiskSelector {
google.api.expr.v1alpha1.CheckedExpr match = 1;
}

// DiskSpec is the spec for Disks status.
Expand All @@ -51,10 +71,60 @@ message DiskSpec {
string transport = 11;
bool rotational = 12;
bool cdrom = 13;
string dev_path = 14;
}

// FilesystemSpec is the spec for volume filesystem.
message FilesystemSpec {
talos.resource.definitions.enums.BlockFilesystemType type = 1;
}

// LocatorSpec is the spec for volume locator.
message LocatorSpec {
google.api.expr.v1alpha1.CheckedExpr match = 1;
}

// PartitionSpec is the spec for volume partitioning.
message PartitionSpec {
uint64 min_size = 1;
uint64 max_size = 2;
bool grow = 3;
string label = 4;
string type_uuid = 5;
}

// ProvisioningSpec is the spec for volume provisioning.
message ProvisioningSpec {
DiskSelector disk_selector = 1;
PartitionSpec partition_spec = 2;
int64 wave = 3;
FilesystemSpec filesystem_spec = 4;
}

// SystemDiskSpec is the spec for SystemDisks status.
message SystemDiskSpec {
string disk_id = 1;
string dev_path = 2;
}

// VolumeConfigSpec is the spec for VolumeConfig resource.
message VolumeConfigSpec {
string parent_id = 1;
talos.resource.definitions.enums.BlockVolumeType type = 2;
ProvisioningSpec provisioning = 3;
LocatorSpec locator = 4;
}

// VolumeStatusSpec is the spec for VolumeStatus resource.
message VolumeStatusSpec {
talos.resource.definitions.enums.BlockVolumePhase phase = 1;
string location = 2;
string error_message = 3;
string uuid = 4;
string partition_uuid = 5;
talos.resource.definitions.enums.BlockVolumePhase pre_fail_phase = 6;
string parent_location = 7;
int64 partition_index = 8;
uint64 size = 9;
}

23 changes: 23 additions & 0 deletions api/resource/definitions/enums/enums.proto
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,29 @@ enum NethelpersVLANProtocol {
VLAN_PROTOCOL8021_AD = 34984;
}

// BlockFilesystemType describes filesystem type.
enum BlockFilesystemType {
FILESYSTEM_TYPE_NONE = 0;
FILESYSTEM_TYPE_XFS = 1;
}

// BlockVolumePhase describes volume phase.
enum BlockVolumePhase {
VOLUME_PHASE_WAITING = 0;
VOLUME_PHASE_READY = 1;
VOLUME_PHASE_FAILED = 2;
VOLUME_PHASE_MISSING = 3;
VOLUME_PHASE_LOCATED = 4;
VOLUME_PHASE_PROVISIONED = 5;
}

// BlockVolumeType describes volume type.
enum BlockVolumeType {
VOLUME_TYPE_PARTITION = 0;
VOLUME_TYPE_DISK = 1;
VOLUME_TYPE_TMPFS = 2;
}

// KubespanPeerState is KubeSpan peer current state.
enum KubespanPeerState {
PEER_STATE_UNKNOWN = 0;
Expand Down
Loading

0 comments on commit 7b1daf5

Please sign in to comment.