Documentation
¶
Index ¶
- Constants
- func AGIFirewallName(project string, owner string, vpcID string) string
- func DefaultFirewallName(project string, owner string, vpcID string) string
- func EfsInstall(input *EfsInstallInput) error
- func EfsInstallAndMount(installInput *EfsInstallInput, mountInput *EfsMountInput) error
- func EfsMount(input *EfsMountInput) error
- func GetCloudformationClient(credentials *clouds.Credentials, region *string) (client *cloudformation.Client, err error)
- func GetEc2Client(credentials *clouds.Credentials, region *string) (client *ec2.Client, err error)
- func GetEksClient(credentials *clouds.Credentials, region *string) (client *eks.Client, err error)
- func GetIamClient(credentials *clouds.Credentials, region *string) (client *iam.Client, err error)
- func GetRoute53Client(credentials *clouds.Credentials, region *string) (client *route53.Client, err error)
- func GetStsClient(credentials *clouds.Credentials, region *string) (client *sts.Client, err error)
- func LegacyAGIFirewallName(project string, vpcID string) string
- func LegacyDefaultFirewallName(project string, vpcID string) string
- func SanitizeOwner(owner string) string
- type CreateInstanceParams
- type CreateVolumeParams
- type EfsInstallInput
- type EfsMountInput
- type ExpiryDetail
- type ImageDetail
- type InstanceDetail
- type VolumeDetail
Constants ¶
const ( TAG_NAME = "Name" TAG_DESCRIPTION = "Description" TAG_AEROLAB_VERSION = "AEROLAB_VERSION" TAG_AEROLAB_PROJECT = "AEROLAB_PROJECT" TAG_OWNER = "AEROLAB_OWNER" TAG_EXPIRES = "AEROLAB_EXPIRES" TAG_CLUSTER_NAME = "AEROLAB_CLUSTER_NAME" TAG_NODE_NO = "AEROLAB_NODE_NO" TAG_OS_NAME = "AEROLAB_OS_NAME" TAG_OS_VERSION = "AEROLAB_OS_VERSION" TAG_COST_PPH = "AEROLAB_COST_PPH" TAG_COST_SO_FAR = "AEROLAB_COST_SO_FAR" TAG_COST_GB = "AEROLAB_COST_PER_GB" TAG_START_TIME = "AEROLAB_LAST_START_TIME" TAG_DNS_NAME = "AEROLAB_DNS_NAME" TAG_DNS_DOMAIN_ID = "AEROLAB_DNS_DOMAIN_ID" TAG_DNS_DOMAIN_NAME = "AEROLAB_DNS_DOMAIN_NAME" TAG_DNS_REGION = "AEROLAB_DNS_REGION" TAG_CLUSTER_UUID = "AEROLAB_CLUSTER_UUID" TAG_FIREWALL_NAME_PREFIX = "AEROLAB_DEFAULT_" // TAG_FIREWALL_ROLE records what an AeroLab-managed security group is for, // so groups can be found by tag rather than by parsing their name. TAG_FIREWALL_ROLE = "AEROLAB_FIREWALL_ROLE" // TAG_FIREWALL_NAME_PREFIX_AGI prefixes the security groups serving AGI's // web ports. TAG_FIREWALL_NAME_PREFIX_AGI = "AEROLAB_AGI_" )
const ( // TAG_V7_MIGRATED marks an instance as migrated from v7 TAG_V7_MIGRATED = "AEROLAB_V7_MIGRATED" // TAG_SOFT_TYPE identifies the software type (e.g., "aerospike", "tools", "graph") TAG_SOFT_TYPE = "aerolab.type" // TAG_SOFT_VERSION identifies the software version TAG_SOFT_VERSION = "aerolab.soft.version" // TAG_TELEMETRY is the v8 telemetry tag TAG_TELEMETRY = "aerolab.telemetry" // TAG_CLIENT_TYPE is the v8 client type tag TAG_CLIENT_TYPE = "aerolab.client.type" // TAG_IMAGE_TYPE identifies the image type (e.g., "aerospike") TAG_IMAGE_TYPE = "aerolab.image.type" )
V7 migration-related constants
const ( V7_TAG_USED_BY = "UsedBy" V7_TAG_SERVER_MARKER = "aerolab4" V7_TAG_CLIENT_MARKER = "aerolab4client" V7_TAG_VOLUME_MARKER = "aerolab7" V7_TAG_CLUSTER_NAME = "Aerolab4ClusterName" V7_TAG_NODE_NUMBER = "Aerolab4NodeNumber" V7_TAG_OPERATING_SYSTEM = "Aerolab4OperatingSystem" V7_TAG_OPERATING_SYS_VER = "Aerolab4OperatingSystemVersion" V7_TAG_AEROSPIKE_VERSION = "Aerolab4AerospikeVersion" V7_TAG_ARCH = "Arch" V7_TAG_EXPIRES = "aerolab4expires" V7_TAG_OWNER = "owner" V7_TAG_COST_PPH = "Aerolab4CostPerHour" V7_TAG_COST_SO_FAR = "Aerolab4CostSoFar" V7_TAG_COST_START_TIME = "Aerolab4CostStartTime" V7_TAG_TELEMETRY = "telemetry" V7_TAG_SPOT = "aerolab7spot" V7_TAG_CLIENT_CLUSTER_NAME = "Aerolab4clientClusterName" V7_TAG_CLIENT_NODE_NUMBER = "Aerolab4clientNodeNumber" V7_TAG_CLIENT_OS = "Aerolab4clientOperatingSystem" V7_TAG_CLIENT_OS_VER = "Aerolab4clientOperatingSystemVersion" V7_TAG_CLIENT_AS_VER = "Aerolab4clientAerospikeVersion" V7_TAG_CLIENT_TYPE = "Aerolab4clientType" V7_TAG_AGI_AV = "aerolab7agiav" V7_TAG_FEATURES = "aerolab4features" V7_TAG_SSL = "aerolab4ssl" V7_TAG_AGI_LABEL = "agiLabel" V7_TAG_AGI_INSTANCE = "agiinstance" V7_TAG_AGI_NODIM = "aginodim" V7_TAG_TERM_ON_POW = "termonpow" V7_TAG_IS_SPOT = "isspot" V7_TAG_AGI_SRC_LOCAL = "agiSrcLocal" V7_TAG_AGI_SRC_SFTP = "agiSrcSftp" V7_TAG_AGI_SRC_S3 = "agiSrcS3" V7_TAG_AGI_DOMAIN = "agiDomain" V7_TAG_VOLUME_NAME = "Name" V7_TAG_VOLUME_LAST_USED = "lastUsed" V7_TAG_VOLUME_EXPIRE_DUR = "expireDuration" V7_TAG_VOLUME_OWNER = "aerolab7owner" )
V7 tag names for discovery
Variables ¶
This section is empty.
Functions ¶
func AGIFirewallName ¶
AGIFirewallName is the per-user security group serving AGI's web ports.
func DefaultFirewallName ¶
DefaultFirewallName is the per-user security group AeroLab attaches to every instance the user works with. Each user gets their own group in each VPC, so several people can share one AWS account without opening each other's instances to the internet.
func EfsInstall ¶
func EfsInstall(input *EfsInstallInput) error
EfsInstall installs EFS utilities on the instance without mounting This is intended to be called during template creation
func EfsInstallAndMount ¶
func EfsInstallAndMount(installInput *EfsInstallInput, mountInput *EfsMountInput) error
EfsInstallAndMount combines install and mount operations This is a convenience function that calls both EfsInstall and EfsMount
func EfsMount ¶
func EfsMount(input *EfsMountInput) error
EfsMount mounts an EFS filesystem on the instance This assumes EFS utilities are already installed (via EfsInstall or template) This is intended to be called during AGI create
func GetCloudformationClient ¶
func GetCloudformationClient(credentials *clouds.Credentials, region *string) (client *cloudformation.Client, err error)
func GetEc2Client ¶
func GetEksClient ¶
func GetIamClient ¶
func GetRoute53Client ¶
func GetStsClient ¶
func LegacyAGIFirewallName ¶
LegacyAGIFirewallName is the shared, pre-per-user AGI group name.
func LegacyDefaultFirewallName ¶
LegacyDefaultFirewallName is the shared, pre-per-user group name. It is still recognised so that instances created by older AeroLab versions keep working.
func SanitizeOwner ¶
SanitizeOwner strips anything from a username that EC2 would reject in a security group name, and lowercases it so the same person always resolves to the same group.
Types ¶
type CreateInstanceParams ¶
type CreateInstanceParams struct {
// the image to use for the instances(nodes)
Image *backends.Image `yaml:"image" json:"image"`
// specify either region (ca-central-1) or zone (ca-central-1a) or vpc-id (vpc-0123456789abcdefg) or subnet-id (subnet-0123456789abcdefg)
//
// vpc: will use first subnet in the vpc, subnet: will use the specified subnet id, region: will use the default VPC, first subnet in the zone, zone: will use the default VPC-subnet in the zone
NetworkPlacement string `yaml:"networkPlacement" json:"networkPlacement"`
// instance type
InstanceType string `yaml:"instanceType" json:"instanceType" required:"true"`
// volume types and sizes, backend-specific definitions
//
// aws format:
// type={gp3|gp2|io2|io1},size={GB}[,iops={cnt}][,throughput={mb/s}][,count=5][,encrypted=true|false]
// example: type=gp3,size=20 type=gp3,size=100,iops=5000,throughput=200,count=2
//
// first specified volume is the root volume, all subsequent volumes are additional attached volumes
Disks []string `yaml:"disks" json:"disks" required:"true"`
// optional: names of firewalls to assign to the instances(nodes)
//
// will always create a project-wide firewall and assign it to the instances(nodes); this firewall allows communication between the instances(nodes) and all ports from the caller's address
Firewalls []string `yaml:"firewalls" json:"firewalls"`
// optional: if true, the instances(nodes) will be created as spot instances
SpotInstance bool `yaml:"spotInstance" json:"spotInstance"`
// optional: if true, will not create a public IP for the instance(node)
DisablePublicIP bool `yaml:"disablePublicIP" json:"disablePublicIP"`
// optional: the IAM instance profile to use for the instance(node)
IAMInstanceProfile string `yaml:"iamInstanceProfile" json:"iamInstanceProfile"`
// optional: the custom DNS to use for the instance(node); if not set, will not create a custom DNS
CustomDNS *backends.InstanceDNS `yaml:"customDNS" json:"customDNS"`
// optional: if specified, and Image==nil, will lookup this image ID and use it (for custom images)
CustomImageID string `yaml:"customImageID" json:"customImageID"`
}
type CreateVolumeParams ¶
type CreateVolumeParams struct {
// attached volumes only - volume size
SizeGiB int `yaml:"sizeGiB" json:"sizeGiB"`
// vpc: will use first subnet in the vpc, subnet: will use the specified subnet id, zone: will use the default VPC, first subnet in the zone
Placement string `yaml:"placement" json:"placement" required:"true"`
// for attached disk only: gp2, gp3, etc. Required for attached disks, but
// checked at creation time rather than via `required` so shared disks, which
// have no disk type, do not have to pass a placeholder value.
DiskType string `yaml:"diskType" json:"diskType"`
// optional: attach disk only, provisioned iops
Iops int `yaml:"iops" json:"iops"`
// optional: attach disk only, bytes/second
Throughput int `yaml:"throughput" json:"throughput"`
// optional: whether the volume uses encryption
Encrypted bool `yaml:"encrypted" json:"encrypted"`
SharedDiskOneZone bool `yaml:"sharedDiskOneZone" json:"sharedDiskOneZone"`
}
type EfsInstallInput ¶
EfsInstallInput contains parameters for EFS installation
type EfsMountInput ¶
type EfsMountInput struct {
Instance *backends.Instance
MountTargetIP string // Mount target IP address
FileSystemId string // EFS filesystem ID
Region string // AWS region
MountTargetDirectory string // Where to mount the filesystem
FIPS bool // Enable FIPS mode
IAM bool // Enable IAM authentication
IAMProfile string // IAM profile name (requires IAM=true)
MaxAttempts int // Max mount attempts (default 15)
}
EfsMountInput contains parameters for EFS mounting
type ExpiryDetail ¶
type ExpiryDetail struct {
SchedulerArn string `json:"schedulerArn" yaml:"schedulerArn"`
SchedulerTargetArn string `json:"schedulerTargetArn" yaml:"schedulerTargetArn"`
Schedule string `json:"schedule" yaml:"schedule"`
FunctionArn string `json:"functionArn" yaml:"functionArn"`
IAMScheduler string `json:"iamScheduler" yaml:"iamScheduler"`
IAMFunction string `json:"iamFunction" yaml:"iamFunction"`
ExpireEksctl bool `json:"expireEksctl" yaml:"expireEksctl"`
CleanupDNS bool `json:"cleanupDNS" yaml:"cleanupDNS"`
LogLevel int `json:"logLevel" yaml:"logLevel"`
Environment map[string]string `json:"environment" yaml:"environment"`
SchedulerState string `json:"schedulerState" yaml:"schedulerState"`
FunctionState string `json:"functionState" yaml:"functionState"`
}
type ImageDetail ¶
type InstanceDetail ¶
type InstanceDetail struct {
SecurityGroups []types.GroupIdentifier `yaml:"securityGroups" json:"securityGroups"`
ClientToken string `yaml:"clientToken" json:"clientToken"`
EnaSupport bool `yaml:"enaSupport" json:"enaSupport"`
IAMInstanceProfile *types.IamInstanceProfile `yaml:"iamInstanceProfile" json:"iamInstanceProfile"`
SpotInstanceRequestId string `yaml:"spotInstanceRequestID" json:"spotInstanceRequestID"`
LifecycleType string `yaml:"lifecycleType" json:"lifecycleType"`
Volumes []instanceVolume `yaml:"volumes" json:"volumes"`
FirewallIDs []string `yaml:"firewallIDs" json:"firewallIDs"`
NetworkID string `yaml:"networkID" json:"networkID"`
SubnetID string `yaml:"subnetID" json:"subnetID"`
}
type VolumeDetail ¶
type VolumeDetail struct {
FileSystemArn string `yaml:"fileSystemArn" json:"fileSystemArn"`
NumberOfMountTargets int `yaml:"numberOfMountTargets" json:"numberOfMountTargets"`
PerformanceMode string `yaml:"performanceMode" json:"performanceMode"`
ThroughputMode string `yaml:"throughputMode" json:"throughputMode"`
}