instance

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2024 License: Apache-2.0, Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelMachineType = "kaito.sh/machine-type"
)
View Source
const (
	RPReferer = "rp.e2e.ig.e2e-aks.azure.com"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AZClient

type AZClient struct {

	// SKU CLIENT is still using track 1 because skewer does not support the track 2 path. We need to refactor this once skewer supports track 2
	SKUClient skewer.ResourceClient
	// contains filtered or unexported fields
}

func CreateAzClient

func CreateAzClient(cfg *auth.Config) (*AZClient, error)

func NewAZClient

func NewAZClient(cfg *auth.Config, env *azure.Environment) (*AZClient, error)

func NewAZClientFromAPI

func NewAZClientFromAPI(
	agentPoolsClient AgentPoolsAPI,
	skuClient skewer.ResourceClient,
) *AZClient

type AgentPoolsAPI

type AgentPoolsAPI interface {
	BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, parameters armcontainerservice.AgentPool, options *armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions) (*runtime.Poller[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse], error)
	Get(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *armcontainerservice.AgentPoolsClientGetOptions) (armcontainerservice.AgentPoolsClientGetResponse, error)
	BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *armcontainerservice.AgentPoolsClientBeginDeleteOptions) (*runtime.Poller[armcontainerservice.AgentPoolsClientDeleteResponse], error)
	NewListPager(resourceGroupName string, resourceName string, options *armcontainerservice.AgentPoolsClientListOptions) *runtime.Pager[armcontainerservice.AgentPoolsClientListResponse]
}

type Instance

type Instance struct {
	Name         *string // agentPoolName or instance/vmName
	State        *string
	ID           *string
	ImageID      *string
	Type         *string
	CapacityType *string
	SubnetID     *string
	Tags         map[string]*string
	Labels       map[string]string
}

Instance a struct to isolate weather vm or vmss

type PolicySetHeaders added in v0.2.0

type PolicySetHeaders http.Header

PolicySetHeaders sets http header

func (PolicySetHeaders) Do added in v0.2.0

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

func NewProvider

func NewProvider(
	azClient *AZClient,
	kubeClient client.Client,
	instanceTypeProvider *instancetype.Provider,
	offeringsCache *cache.UnavailableOfferings,

	resourceGroup string,
	nodeResourceGroup string,
	clusterName string,
) *Provider

func (*Provider) Create

func (p *Provider) Create(ctx context.Context, machine *v1alpha5.Machine) (*Instance, error)

Create an instance given the constraints. instanceTypes should be sorted by priority for spot capacity type.

func (*Provider) Delete

func (p *Provider) Delete(ctx context.Context, id string) error

func (*Provider) Get

func (p *Provider) Get(ctx context.Context, id string) (*Instance, error)

func (*Provider) List

func (p *Provider) List(ctx context.Context) ([]*Instance, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL