cloudstack

package
v0.0.0-...-976d991 Latest Latest
Warning

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

Go to latest
Published: May 26, 2021 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CloudstackResourceIPAdress     = "PublicIpAddress"
	CloudstackResourceLoadBalancer = "LoadBalancer"
)
View Source
const ProviderName = "custom-cloudstack"

ProviderName is the name of this cloud provider.

Variables

View Source
var ErrVMNotFound = errors.New("vm not found in cloudstack")

Functions

This section is empty.

Types

type CSCloud

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

CSCloud is an implementation of Interface for CloudStack.

func (*CSCloud) AddSSHKeyToAllInstances

func (cs *CSCloud) AddSSHKeyToAllInstances(ctx context.Context, user string, keyData []byte) error

AddSSHKeyToAllInstances is currently not implemented.

func (*CSCloud) Clusters

func (cs *CSCloud) Clusters() (cloudprovider.Clusters, bool)

Clusters returns an implementation of Clusters for CloudStack.

func (*CSCloud) CurrentNodeName

func (cs *CSCloud) CurrentNodeName(ctx context.Context, hostname string) (types.NodeName, error)

CurrentNodeName returns the name of the node we are currently running on.

func (*CSCloud) EnsureLoadBalancer

func (cs *CSCloud) EnsureLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error)

EnsureLoadBalancer creates a new load balancer, or updates the existing one. Returns the status of the balancer.

func (*CSCloud) EnsureLoadBalancerDeleted

func (cs *CSCloud) EnsureLoadBalancerDeleted(ctx context.Context, clusterName string, service *v1.Service) error

EnsureLoadBalancerDeleted deletes the specified load balancer if it exists, returning nil if the load balancer specified either didn't exist or was successfully deleted.

func (*CSCloud) GetLoadBalancer

func (cs *CSCloud) GetLoadBalancer(ctx context.Context, clusterName string, service *v1.Service) (*v1.LoadBalancerStatus, bool, error)

GetLoadBalancer returns whether the specified load balancer exists, and if so, what its status is.

func (*CSCloud) GetLoadBalancerName

func (cs *CSCloud) GetLoadBalancerName(ctx context.Context, clusterName string, service *v1.Service) string

GetLoadBalancerName returns the name of the load balancer responsible for the service by looking at the service label. If not set, it fallsback to the concatanation of the service name and the environment load balancer domain for the environent

func (*CSCloud) GetZone

func (cs *CSCloud) GetZone(ctx context.Context) (cloudprovider.Zone, error)

GetZone returns the Zone containing the current failure zone and locality region that the program is running in In most cases, this method is called from the kubelet querying a local metadata service to acquire its zone. For the case of external cloud providers, use GetZoneByProviderID or GetZoneByNodeName since GetZone can no longer be called from the kubelets.

func (*CSCloud) GetZoneByNodeName

func (cs *CSCloud) GetZoneByNodeName(ctx context.Context, nodeName types.NodeName) (cloudprovider.Zone, error)

GetZoneByNodeName returns the Zone containing the current zone and locality region of the node specified by node name This method is particularly used in the context of external cloud providers where node initialization must be done outside the kubelets.

func (*CSCloud) GetZoneByProviderID

func (cs *CSCloud) GetZoneByProviderID(ctx context.Context, providerID string) (cloudprovider.Zone, error)

GetZoneByProviderID returns the Zone containing the current zone and locality region of the node specified by providerId This method is particularly used in the context of external cloud providers where node initialization must be done outside the kubelets.

func (*CSCloud) HasClusterID

func (cs *CSCloud) HasClusterID() bool

HasClusterID returns true if the cluster has a clusterID

func (*CSCloud) Initialize

func (cs *CSCloud) Initialize(clientBuilder cloudprovider.ControllerClientBuilder, stop <-chan struct{})

Initialize passes a Kubernetes clientBuilder interface to the cloud provider

func (*CSCloud) InstanceExistsByProviderID

func (cs *CSCloud) InstanceExistsByProviderID(ctx context.Context, providerID string) (bool, error)

InstanceExistsByProviderID returns if the instance still exists.

func (*CSCloud) InstanceID

func (cs *CSCloud) InstanceID(ctx context.Context, name types.NodeName) (string, error)

InstanceID returns the cloud provider ID of the specified instance.

func (*CSCloud) InstanceShutdownByProviderID

func (cs *CSCloud) InstanceShutdownByProviderID(ctx context.Context, providerID string) (bool, error)

InstanceShutdownByProviderID returns true if the instance is shutdown in cloudprovider

func (*CSCloud) InstanceType

func (cs *CSCloud) InstanceType(ctx context.Context, name types.NodeName) (string, error)

InstanceType returns the type of the specified instance.

func (*CSCloud) InstanceTypeByProviderID

func (cs *CSCloud) InstanceTypeByProviderID(ctx context.Context, providerID string) (string, error)

InstanceTypeByProviderID returns the type of the specified instance.

func (*CSCloud) Instances

func (cs *CSCloud) Instances() (cloudprovider.Instances, bool)

Instances returns an implementation of Instances for CloudStack.

func (*CSCloud) LoadBalancer

func (cs *CSCloud) LoadBalancer() (cloudprovider.LoadBalancer, bool)

LoadBalancer returns an implementation of LoadBalancer for CloudStack.

func (*CSCloud) NodeAddresses

func (cs *CSCloud) NodeAddresses(ctx context.Context, name types.NodeName) ([]v1.NodeAddress, error)

NodeAddresses returns the addresses of the specified instance.

func (*CSCloud) NodeAddressesByProviderID

func (cs *CSCloud) NodeAddressesByProviderID(ctx context.Context, providerID string) ([]v1.NodeAddress, error)

NodeAddressesByProviderID returns the addresses of the specified instance.

func (*CSCloud) ProviderName

func (cs *CSCloud) ProviderName() string

ProviderName returns the cloud provider ID.

func (*CSCloud) Routes

func (cs *CSCloud) Routes() (cloudprovider.Routes, bool)

Routes returns an implementation of Routes for CloudStack.

func (*CSCloud) SetInformers

func (cs *CSCloud) SetInformers(informerFactory informers.SharedInformerFactory)

func (*CSCloud) UpdateLoadBalancer

func (cs *CSCloud) UpdateLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node) error

UpdateLoadBalancer updates hosts under the specified load balancer.

func (*CSCloud) Zones

func (cs *CSCloud) Zones() (cloudprovider.Zones, bool)

Zones returns an implementation of Zones for CloudStack.

type CSConfig

type CSConfig struct {
	Global      globalConfig                  `gcfg:"global"`
	Environment map[string]*environmentConfig `gcfg:"environment"`
	Command     commandConfig                 `gcfg:"custom-command"`
	CommandArgs map[string]*commandArgsConfig `gcfg:"custom-command-args"`
}

CSConfig wraps the config for the CloudStack cloud provider.

type CSEnvironment

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

type IPNotFoundError

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

func (IPNotFoundError) Error

func (e IPNotFoundError) Error() string

type UpdateGloboNetworkPoolResponse

type UpdateGloboNetworkPoolResponse struct {
	JobID     string `json:"jobid"`
	Jobstatus int    `json:"jobstatus"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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