instance

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Ref: https://cloud.google.com/compute/docs/instances/instance-lifecycle#instance-states
	// PROVISIONING, STAGING, RUNNING, PENDING_STOP, STOPPING, STOPPED, TERMINATED, REPAIRING, SUSPENDING, SUSPENDED
	InstanceStatusProvisioning = "PROVISIONING"
	InstanceStatusStaging      = "STAGING"
	InstanceStatusRunning      = "RUNNING"
	InstanceStatusPendingStop  = "PENDING_STOP"
	InstanceStatusStopping     = "STOPPING"
	InstanceStatusStopped      = "STOPPED"
	InstanceStatusTerminated   = "TERMINATED"
	InstanceStatusRepairing    = "REPAIRING"
	InstanceStatusSuspending   = "SUSPENDING"
	InstanceStatusSuspended    = "SUSPENDED"
)

Variables

View Source
var InsufficientCapacityErrorCodes = sets.NewString(
	"ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS",
	"ZONE_RESOURCE_POOL_EXHAUSTED",
	"IP_SPACE_EXHAUSTED_WITH_DETAILS",
	"IP_SPACE_EXHAUSTED",
)

Functions

This section is empty.

Types

type DefaultProvider

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

func (*DefaultProvider) Create

func (p *DefaultProvider) Create(ctx context.Context, nodeClass *v1alpha1.GCENodeClass, nodeClaim *karpv1.NodeClaim, instanceTypes []*cloudprovider.InstanceType) (*Instance, error)

func (*DefaultProvider) CreateTags

func (p *DefaultProvider) CreateTags(ctx context.Context, providerID string, tags map[string]string) error

func (*DefaultProvider) Delete

func (p *DefaultProvider) Delete(ctx context.Context, providerID string) error

func (*DefaultProvider) Get

func (p *DefaultProvider) Get(ctx context.Context, providerID string) (*Instance, error)

func (*DefaultProvider) List

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

type Instance

type Instance struct {
	CapacityReservationID string            `json:"capacityReservationId"`
	CapacityType          string            `json:"capacityType"`
	CreationTime          time.Time         `json:"creationTime"`
	ImageID               string            `json:"imageId"`
	InstanceID            string            `json:"instanceId"`
	InstanceTemplate      string            `json:"instanceTemplate"`
	Labels                map[string]string `json:"labels"`
	Location              string            `json:"location"`
	Name                  string            `json:"name"`
	ProjectID             string            `json:"projectId"`
	Status                string            `json:"status"`
	Tags                  map[string]string `json:"tags"`
	Type                  string            `json:"type"`
}

Instance is an internal data structure for GCE instances

type Provider

func NewProvider

func NewProvider(clusterName, clusterLocation, region, projectID, defaultServiceAccount string, computeService *compute.Service, gkeProvider gke.Provider,
	unavailableOfferings *pkgcache.UnavailableOfferings,
) Provider

Jump to

Keyboard shortcuts

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