instance

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: Apache-2.0, Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelMachineType       = "kaito.sh/machine-type"
	NodeClaimCreationLabel = "kaito.sh/creation-timestamp"
	// use self-defined layout in order to satisfy node label syntax
	CreationTimestampLayout = "2006-01-02T15-04-05Z"
)
View Source
const (
	RPReferer = "rp.e2e.ig.e2e-aks.azure.com"
)

Variables

View Source
var (
	KaitoNodeLabels    = []string{"kaito.sh/workspace", "kaito.sh/ragengine"}
	AgentPoolNameRegex = regexp.MustCompile(`^[a-z][a-z0-9]{0,11}$`)
)

Functions

This section is empty.

Types

type AZClient

type AZClient struct {
	// 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,
) *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,
	resourceGroup string,
	nodeResourceGroup string,
	clusterName string,
) *Provider

func (*Provider) Create

func (p *Provider) Create(ctx context.Context, nodeClaim *karpenterv1.NodeClaim) (*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, apName 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