Documentation ¶
Index ¶
- type Config
- type Driver
- func (d *Driver) Allocate(def types.LabelDefinition, metadata map[string]any) (*types.Resource, error)
- func (d *Driver) AvailableCapacity(node_usage types.Resources, def types.LabelDefinition) int64
- func (d *Driver) Deallocate(res *types.Resource) error
- func (d *Driver) GetTask(name, options string) drivers.ResourceDriverTask
- func (d *Driver) IsRemote() bool
- func (d *Driver) Name() string
- func (d *Driver) Prepare(config []byte) error
- func (d *Driver) Status(res *types.Resource) (string, error)
- func (d *Driver) ValidateDefinition(def types.LabelDefinition) error
- type Options
- type TaskSnapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Region string `json:"region"` // AWS Region to connect to KeyID string `json:"key_id"` // AWS AMI Key ID SecretKey string `json:"secret_key"` // AWS AMI Secret Key // Optional AccountIDs []string `json:"account_ids"` // AWS Trusted account IDs to filter vpc, subnet, sg, images, snapshots... InstanceTags map[string]string `json:"instance_tags"` // AWS Instance tags to use when this node provision them }
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Implements drivers.ResourceDriver interface
func (*Driver) Allocate ¶
func (d *Driver) Allocate(def types.LabelDefinition, metadata map[string]any) (*types.Resource, error)
*
- Allocate Instance with provided image *
- It selects the AMI and run instance
- Uses metadata to fill EC2 instance userdata
func (*Driver) AvailableCapacity ¶ added in v0.6.0
Allow Fish to ask the driver about it's capacity (free slots) of a specific definition
func (*Driver) GetTask ¶ added in v0.6.0
func (d *Driver) GetTask(name, options string) drivers.ResourceDriverTask
func (*Driver) ValidateDefinition ¶
func (d *Driver) ValidateDefinition(def types.LabelDefinition) error
type Options ¶ added in v0.6.0
type Options struct { Image string `json:"image"` // ID/Name of the image to use InstanceType string `json:"instance_type"` // Type of the instance from aws available list SecurityGroup string `json:"security_group"` // ID/Name of the security group to use for the instance Tags map[string]string `json:"tags"` // Tags to add during instance creation EncryptKey string `json:"encrypt_key"` // Use specific encryption key for the new disks UserDataFormat string `json:"userdata_format"` // If not empty - will store the resource metadata to userdata in defined format UserDataPrefix string `json:"userdata_prefix"` // Optional if need to add custom prefix to the metadata key during formatting }
*
- Options example:
- image: ami-abcdef123456
- instance_type: c6a.4xlarge
- security_group: sg-abcdef123456
- tags:
- somekey: somevalue
type TaskSnapshot ¶ added in v0.6.0
type TaskSnapshot struct { *types.ApplicationTask `json:"-"` // Info about the requested task *types.Resource `json:"-"` // Info about the processed resource Full bool `json:"full"` // Make full (all disks including OS image), or just the additional disks snapshot // contains filtered or unexported fields }
func (*TaskSnapshot) Clone ¶ added in v0.6.0
func (t *TaskSnapshot) Clone() drivers.ResourceDriverTask
func (*TaskSnapshot) Execute ¶ added in v0.6.0
func (t *TaskSnapshot) Execute() (result []byte, err error)
Snapshot could be executed during ALLOCATED & DEALLOCATE ApplicationStatus
func (*TaskSnapshot) Name ¶ added in v0.6.0
func (t *TaskSnapshot) Name() string
func (*TaskSnapshot) SetInfo ¶ added in v0.6.0
func (t *TaskSnapshot) SetInfo(task *types.ApplicationTask, res *types.Resource)
Click to show internal directories.
Click to hide internal directories.