instance

package
v0.0.0-...-a2a92cf Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IBMCloudInstanceProvider

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

func NewProvider

func NewProvider() (*IBMCloudInstanceProvider, error)

func (*IBMCloudInstanceProvider) Create

func (p *IBMCloudInstanceProvider) Create(ctx context.Context, nodeClaim *v1.NodeClaim) (*corev1.Node, error)

func (*IBMCloudInstanceProvider) Delete

func (p *IBMCloudInstanceProvider) Delete(ctx context.Context, node *corev1.Node) error

func (*IBMCloudInstanceProvider) GetInstance

func (p *IBMCloudInstanceProvider) GetInstance(ctx context.Context, node *corev1.Node) (*Instance, error)

type Instance

type Instance struct {
	// ID is the instance ID
	ID string
	// Name is the instance name
	Name string
	// Type is the instance type
	Type string
	// Region is the region where the instance is located
	Region string
	// Zone is the availability zone where the instance is located
	Zone string
	// Status is the current status of the instance
	Status InstanceStatus
	// State represents the current state of the instance
	State string
	// ImageID is the ID of the image used to create the instance
	ImageID string
	// CreationTime is when the instance was created
	CreationTime time.Time
	// LaunchTime is when the instance was created (string format)
	LaunchTime string
	// CapacityType represents the type of capacity (on-demand, spot, etc)
	CapacityType string
	// Tags are key/value pairs attached to the instance
	Tags map[string]string
}

Instance represents an IBM Cloud instance

type InstanceOptions

type InstanceOptions struct {
	// Type is the instance type to create
	Type string
	// Zone is the availability zone to create the instance in
	Zone string
	// Labels are the Kubernetes labels to apply to the instance
	Labels map[string]string
	// Taints are the Kubernetes taints to apply to the instance
	Taints []string
}

InstanceOptions contains configuration for instance creation

type InstanceStatus

type InstanceStatus string

InstanceStatus represents the current status of an instance

const (
	// InstanceStatusPending indicates the instance is being created
	InstanceStatusPending InstanceStatus = "pending"
	// InstanceStatusRunning indicates the instance is running
	InstanceStatusRunning InstanceStatus = "running"
	// InstanceStatusStopping indicates the instance is being stopped
	InstanceStatusStopping InstanceStatus = "stopping"
	// InstanceStatusStopped indicates the instance has been stopped
	InstanceStatusStopped InstanceStatus = "stopped"
)

type Provider

type Provider interface {
	// Create launches a new instance in IBM Cloud
	Create(ctx context.Context, nodeClaim *karpv1.NodeClaim) (*v1.Node, error)

	// Delete terminates the specified instance
	Delete(ctx context.Context, node *v1.Node) error

	// GetInstance retrieves instance information for the specified node
	GetInstance(ctx context.Context, node *v1.Node) (*Instance, error)
}

Provider defines the interface for managing IBM Cloud instances

Jump to

Keyboard shortcuts

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