-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
machinepools.go
59 lines (50 loc) · 1.92 KB
/
machinepools.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package types
// MachinePool is a pool of machines to be installed.
type MachinePool struct {
// Name is the name of the machine pool.
Name string `json:"name"`
// Replicas is the count of machines for this machine pool.
// Default is 1.
Replicas *int64 `json:"replicas"`
// Platform is configuration for machine pool specific to the platfrom.
Platform MachinePoolPlatform `json:"platform"`
}
// MachinePoolPlatform is the platform-specific configuration for a machine
// pool. Only one of the platforms should be set.
type MachinePoolPlatform struct {
// AWS is the configuration used when installing on AWS.
AWS *AWSMachinePoolPlatform `json:"aws,omitempty"`
// Libvirt is the configuration used when installing on libvirt.
Libvirt *LibvirtMachinePoolPlatform `json:"libvirt,omitempty"`
}
// AWSMachinePoolPlatform stores the configuration for a machine pool
// installed on AWS.
type AWSMachinePoolPlatform struct {
// InstanceType defines the ec2 instance type.
// eg. m4-large
InstanceType string `json:"type"`
// IAMRoleName defines the IAM role associated
// with the ec2 instance.
IAMRoleName string `json:"iamRoleName"`
// EC2RootVolume defines the storage for ec2 instance.
EC2RootVolume `json:"rootVolume"`
}
// EC2RootVolume defines the storage for an ec2 instance.
type EC2RootVolume struct {
// IOPS defines the iops for the instance.
IOPS int `json:"iops"`
// Size defines the size of the instance.
Size int `json:"size"`
// Type defines the type of the instance.
Type string `json:"type"`
}
// LibvirtMachinePoolPlatform stores the configuration for a machine pool
// installed on libvirt.
type LibvirtMachinePoolPlatform struct {
// ImagePool is the name of the libvirt storage pool to which the storage
// volume containing the OS image belongs.
ImagePool string `json:"imagePool"`
// ImageVolume is the name of the libvirt storage volume containing the OS
// image.
ImageVolume string `json:"imageVolume"`
}