pub struct ContainerCluster {
pub id: String,
pub capacity_groups: Vec<CapacityGroup>,
pub container_cidr: Option<String>,
pub template_inputs: Option<TemplateInputs>,
}Expand description
ContainerCluster resource for running long-running container workloads.
A ContainerCluster provides compute infrastructure that integrates with Horizon for container orchestration. It manages auto scaling groups of machines that run the horizond agent for container scheduling.
§Architecture
- Alien provisions infrastructure: ASGs/MIGs/VMSSs, IAM roles, security groups
- Horizon manages containers: scheduling replicas to machines, autoscaling
- horizond runs on each machine: starts/stops containers based on Horizon’s assignments
§Example
use alien_core::{ContainerCluster, CapacityGroup};
let cluster = ContainerCluster::new("compute".to_string())
.capacity_group(CapacityGroup {
group_id: "general".to_string(),
instance_type: Some("m7g.xlarge".to_string()),
profile: None,
min_size: 1,
max_size: 5,
})
.build();Fields§
§id: StringUnique identifier for the container cluster. Must contain only alphanumeric characters, hyphens, and underscores.
capacity_groups: Vec<CapacityGroup>Capacity groups defining the machine pools for this cluster. Each group becomes a separate ASG/MIG/VMSS.
container_cidr: Option<String>Container CIDR block for internal container networking. Auto-generated as “10.244.0.0/16” if not specified. Each machine gets a /24 subnet from this range.
template_inputs: Option<TemplateInputs>Deployment-time values that affect instance templates (horizond URL, monitoring, etc.). Populated by stamp_template_inputs() from DeploymentConfig — not user-provided.
Implementations§
Source§impl ContainerCluster
impl ContainerCluster
Sourcepub fn new(id: String) -> ContainerClusterBuilder
pub fn new(id: String) -> ContainerClusterBuilder
Create an instance of ContainerCluster using the builder syntax
Source§impl ContainerCluster
impl ContainerCluster
Sourcepub const RESOURCE_TYPE: ResourceType
pub const RESOURCE_TYPE: ResourceType
The resource type identifier for ContainerCluster
Sourcepub fn container_cidr(&self) -> &str
pub fn container_cidr(&self) -> &str
Returns the container CIDR, defaulting to “10.244.0.0/16” if not specified.
Trait Implementations§
Source§impl Clone for ContainerCluster
impl Clone for ContainerCluster
Source§fn clone(&self) -> ContainerCluster
fn clone(&self) -> ContainerCluster
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more