Documentation ¶
Index ¶
- Constants
- type CSCloud
- func (cs *CSCloud) AddSSHKeyToAllInstances(ctx context.Context, user string, keyData []byte) error
- func (cs *CSCloud) Clusters() (cloudprovider.Clusters, bool)
- func (cs *CSCloud) CurrentNodeName(ctx context.Context, hostname string) (types.NodeName, error)
- func (cs *CSCloud) EnsureLoadBalancer(ctx context.Context, clusterName string, service *corev1.Service, ...) (status *corev1.LoadBalancerStatus, err error)
- func (cs *CSCloud) EnsureLoadBalancerDeleted(ctx context.Context, clusterName string, service *corev1.Service) error
- func (cs *CSCloud) GetLoadBalancer(ctx context.Context, clusterName string, service *corev1.Service) (*corev1.LoadBalancerStatus, bool, error)
- func (cs *CSCloud) GetLoadBalancerName(ctx context.Context, clusterName string, service *corev1.Service) string
- func (cs *CSCloud) GetZone(ctx context.Context) (cloudprovider.Zone, error)
- func (cs *CSCloud) GetZoneByNodeName(ctx context.Context, nodeName types.NodeName) (cloudprovider.Zone, error)
- func (cs *CSCloud) GetZoneByProviderID(ctx context.Context, providerID string) (cloudprovider.Zone, error)
- func (cs *CSCloud) HasClusterID() bool
- func (cs *CSCloud) Initialize(clientBuilder cloudprovider.ControllerClientBuilder, stop <-chan struct{})
- func (cs *CSCloud) InstanceExists(ctx context.Context, node *corev1.Node) (bool, error)
- func (cs *CSCloud) InstanceExistsByProviderID(ctx context.Context, providerID string) (bool, error)
- func (cs *CSCloud) InstanceID(ctx context.Context, name types.NodeName) (string, error)
- func (cs *CSCloud) InstanceMetadata(ctx context.Context, node *corev1.Node) (*cloudprovider.InstanceMetadata, error)
- func (cs *CSCloud) InstanceShutdown(ctx context.Context, node *corev1.Node) (bool, error)
- func (cs *CSCloud) InstanceShutdownByProviderID(ctx context.Context, providerID string) (bool, error)
- func (cs *CSCloud) InstanceType(ctx context.Context, name types.NodeName) (string, error)
- func (cs *CSCloud) InstanceTypeByProviderID(ctx context.Context, providerID string) (string, error)
- func (cs *CSCloud) Instances() (cloudprovider.Instances, bool)
- func (cs *CSCloud) InstancesV2() (cloudprovider.InstancesV2, bool)
- func (cs *CSCloud) LoadBalancer() (cloudprovider.LoadBalancer, bool)
- func (cs *CSCloud) NodeAddresses(ctx context.Context, name types.NodeName) ([]corev1.NodeAddress, error)
- func (cs *CSCloud) NodeAddressesByProviderID(ctx context.Context, providerID string) ([]corev1.NodeAddress, error)
- func (cs *CSCloud) ProviderName() string
- func (cs *CSCloud) Routes() (cloudprovider.Routes, bool)
- func (cs *CSCloud) UpdateLoadBalancer(ctx context.Context, clusterName string, service *corev1.Service, ...) error
- func (cs *CSCloud) Zones() (cloudprovider.Zones, bool)
- type CSConfig
- type LoadBalancerProtocol
Constants ¶
const ( // ServiceAnnotationLoadBalancerProxyProtocol is the annotation used on the // service to enable the proxy protocol on a CloudStack load balancer. // Note that this protocol only applies to TCP service ports and // CloudStack >= 4.6 is required for it to work. ServiceAnnotationLoadBalancerProxyProtocol = "service.beta.kubernetes.io/cloudstack-load-balancer-proxy-protocol" ServiceAnnotationLoadBalancerLoadbalancerHostname = "service.beta.kubernetes.io/cloudstack-load-balancer-hostname" )
const ProviderName = "external-cloudstack"
ProviderName is the name of this cloud provider.
Variables ¶
This section is empty.
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 ¶
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 ¶
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 *corev1.Service, nodes []*corev1.Node) (status *corev1.LoadBalancerStatus, err 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 *corev1.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 *corev1.Service) (*corev1.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 *corev1.Service) string
GetLoadBalancerName retrieves the name of the LoadBalancer.
func (*CSCloud) GetZone ¶
GetZone returns the Zone containing the region that the program is running in.
func (*CSCloud) GetZoneByNodeName ¶
func (cs *CSCloud) GetZoneByNodeName(ctx context.Context, nodeName types.NodeName) (cloudprovider.Zone, error)
GetZoneByNodeName returns the Zone, found by using the node name.
func (*CSCloud) GetZoneByProviderID ¶
func (cs *CSCloud) GetZoneByProviderID(ctx context.Context, providerID string) (cloudprovider.Zone, error)
GetZoneByProviderID returns the Zone, found by using the provider ID.
func (*CSCloud) HasClusterID ¶
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) InstanceExists ¶
func (*CSCloud) InstanceExistsByProviderID ¶
InstanceExistsByProviderID returns if the instance still exists.
func (*CSCloud) InstanceID ¶
InstanceID returns the cloud provider ID of the specified instance.
func (*CSCloud) InstanceMetadata ¶
func (cs *CSCloud) InstanceMetadata(ctx context.Context, node *corev1.Node) (*cloudprovider.InstanceMetadata, error)
func (*CSCloud) InstanceShutdown ¶
func (*CSCloud) InstanceShutdownByProviderID ¶
func (cs *CSCloud) InstanceShutdownByProviderID(ctx context.Context, providerID string) (bool, error)
InstanceShutdownByProviderID returns true if the instance is in safe state to detach volumes
func (*CSCloud) InstanceType ¶
InstanceType returns the type of the specified instance.
func (*CSCloud) InstanceTypeByProviderID ¶
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) InstancesV2 ¶
func (cs *CSCloud) InstancesV2() (cloudprovider.InstancesV2, bool)
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) ([]corev1.NodeAddress, error)
NodeAddresses returns the addresses of the specified instance.
func (*CSCloud) NodeAddressesByProviderID ¶
func (cs *CSCloud) NodeAddressesByProviderID(ctx context.Context, providerID string) ([]corev1.NodeAddress, error)
NodeAddressesByProviderID returns the addresses of the specified instance.
func (*CSCloud) ProviderName ¶
ProviderName returns the cloud provider ID.
func (*CSCloud) Routes ¶
func (cs *CSCloud) Routes() (cloudprovider.Routes, bool)
Routes returns an implementation of Routes for CloudStack.
type CSConfig ¶
type CSConfig struct { Global struct { APIURL string `gcfg:"api-url"` APIKey string `gcfg:"api-key"` SecretKey string `gcfg:"secret-key"` SSLNoVerify bool `gcfg:"ssl-no-verify"` ProjectID string `gcfg:"project-id"` Zone string `gcfg:"zone"` } }
CSConfig wraps the config for the CloudStack cloud provider.
type LoadBalancerProtocol ¶
type LoadBalancerProtocol int
LoadBalancerProtocol represents a specific network protocol supported by the CloudStack load balancer.
It also allows easy mapping to standard protocol names.
const ( LoadBalancerProtocolTCP LoadBalancerProtocol = iota LoadBalancerProtocolUDP LoadBalancerProtocolTCPProxy LoadBalancerProtocolInvalid )
func ProtocolFromLoadBalancer ¶
func ProtocolFromLoadBalancer(protocol string) LoadBalancerProtocol
ProtocolFromLoadBalancer returns the protocol corresponding to the CloudStack load balancer protocol name.
func ProtocolFromServicePort ¶
func ProtocolFromServicePort(port v1.ServicePort, service *v1.Service) LoadBalancerProtocol
ProtocolFromServicePort selects a suitable CloudStack protocol type based on a ServicePort object and annotations from a LoadBalancer definition.
Supported combinations include:
v1.ProtocolTCP="tcp" -> "tcp" v1.ProtocolTCP="udp" -> "udp" (CloudStack 4.6 and later) v1.ProtocolTCP="tcp" + annotation "service.beta.kubernetes.io/cloudstack-load-balancer-proxy-protocol" -> "tcp-proxy" (CloudStack 4.6 and later)
Other values return LoadBalancerProtocolInvalid.
func (LoadBalancerProtocol) CSProtocol ¶
func (p LoadBalancerProtocol) CSProtocol() string
CSProtocol returns the full CloudStack protocol name. Returns "" if the value is unknown.
func (LoadBalancerProtocol) IPProtocol ¶
func (p LoadBalancerProtocol) IPProtocol() string
IPProtocol returns the standard IP protocol name. Returns "" if the value is unknown.
func (LoadBalancerProtocol) String ¶
func (p LoadBalancerProtocol) String() string
String returns the same value as CSProtocol.