Documentation
¶
Index ¶
- Constants
- type Cloud
- func (c Cloud) Clusters() (cloudprovider.Clusters, bool)
- func (c Cloud) HasClusterID() bool
- func (c Cloud) Initialize(clientBuilder cloudprovider.ControllerClientBuilder, stop <-chan struct{})
- func (c Cloud) Instances() (cloudprovider.Instances, bool)
- func (c Cloud) LoadBalancer() (cloudprovider.LoadBalancer, bool)
- func (c Cloud) ProviderName() string
- func (c Cloud) Routes() (cloudprovider.Routes, bool)
- func (c Cloud) Zones() (cloudprovider.Zones, bool)
- type CloudConfiguration
- type CloudServer
- func (s *CloudServer) Create(locationID string, packageID string, hostname string) error
- func (s *CloudServer) Destroy() error
- func (s *CloudServer) GetRandomPassword(length int) string
- func (s *CloudServer) InitializeByHostname(hostname string) (notFound bool, e error)
- func (s *CloudServer) InitializeByID(id string) (notFound bool, e error)
- func (s *CloudServer) SFTP(sshClient *ssh.Client) (*sftp.Client, error)
- func (s *CloudServer) SSH() (*ssh.Client, error)
- func (s *CloudServer) UploadFile(sftpClient *sftp.Client, filePath string, fileContents *bytes.Buffer) error
- type Instances
- func (i Instances) AddSSHKeyToAllInstances(ctx context.Context, user string, keyData []byte) error
- func (i Instances) CurrentNodeName(ctx context.Context, hostname string) (types.NodeName, error)
- func (i Instances) InstanceExistsByProviderID(ctx context.Context, providerID string) (bool, error)
- func (i Instances) InstanceID(ctx context.Context, nodeName types.NodeName) (string, error)
- func (i Instances) InstanceShutdownByProviderID(ctx context.Context, providerID string) (bool, error)
- func (i Instances) InstanceType(ctx context.Context, name types.NodeName) (string, error)
- func (i Instances) InstanceTypeByProviderID(ctx context.Context, providerID string) (string, error)
- func (i Instances) NodeAddresses(ctx context.Context, name types.NodeName) ([]v1.NodeAddress, error)
- func (i Instances) NodeAddressesByProviderID(ctx context.Context, providerID string) ([]v1.NodeAddress, error)
- type LoadBalancers
- func (l LoadBalancers) EnsureLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error)
- func (l LoadBalancers) EnsureLoadBalancerDeleted(ctx context.Context, clusterName string, service *v1.Service) error
- func (l LoadBalancers) GetLoadBalancer(ctx context.Context, clusterName string, service *v1.Service) (status *v1.LoadBalancerStatus, exists bool, err error)
- func (l LoadBalancers) GetLoadBalancerName(ctx context.Context, clusterName string, service *v1.Service) string
- func (l LoadBalancers) UpdateLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node) error
- type Zones
Constants ¶
const (
// ProviderName specifies the name of the cloud controller manager defined in this file.
ProviderName = "clouddk"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cloud ¶
type Cloud struct {
// contains filtered or unexported fields
}
Cloud implements the interface cloudprovider.Interface.
func (Cloud) Clusters ¶
func (c Cloud) Clusters() (cloudprovider.Clusters, bool)
Clusters returns a clusters interface. Also returns true if the interface is supported, false otherwise.
func (Cloud) HasClusterID ¶
HasClusterID returns true if a ClusterID is required and set.
func (Cloud) Initialize ¶
func (c Cloud) Initialize(clientBuilder cloudprovider.ControllerClientBuilder, stop <-chan struct{})
Initialize provides the cloud with a kubernetes client builder and may spawn goroutines to perform housekeeping or run custom controllers specific to the cloud provider. Any tasks started here should be cleaned up when the stop channel closes.
func (Cloud) Instances ¶
func (c Cloud) Instances() (cloudprovider.Instances, bool)
Instances returns an instances interface. Also returns true if the interface is supported, false otherwise.
func (Cloud) LoadBalancer ¶
func (c Cloud) LoadBalancer() (cloudprovider.LoadBalancer, bool)
LoadBalancer returns a balancer interface. Also returns true if the interface is supported, false otherwise.
func (Cloud) ProviderName ¶
ProviderName returns the cloud provider ID.
type CloudConfiguration ¶
type CloudConfiguration struct { ClientSettings *clouddk.ClientSettings PrivateKey string PublicKey string }
CloudConfiguration stores the cloud configuration.
type CloudServer ¶
type CloudServer struct { CloudConfiguration *CloudConfiguration Information clouddk.ServerBody }
CloudServer manages a Cloud.dk server.
func (*CloudServer) Create ¶
func (s *CloudServer) Create(locationID string, packageID string, hostname string) error
Create creates a new Cloud.dk server.
func (*CloudServer) Destroy ¶
func (s *CloudServer) Destroy() error
Destroy destroys a Cloud.dk server.
func (*CloudServer) GetRandomPassword ¶
func (s *CloudServer) GetRandomPassword(length int) string
GetRandomPassword generates a random password of a fixed length.
func (*CloudServer) InitializeByHostname ¶
func (s *CloudServer) InitializeByHostname(hostname string) (notFound bool, e error)
InitializeByHostname initializes a CloudServer based on a hostname.
func (*CloudServer) InitializeByID ¶
func (s *CloudServer) InitializeByID(id string) (notFound bool, e error)
InitializeByID initializes a CloudServer based on an identifier.
func (*CloudServer) SSH ¶
func (s *CloudServer) SSH() (*ssh.Client, error)
SSH establishes a new SSH connection to a Cloud.dk server.
func (*CloudServer) UploadFile ¶
func (s *CloudServer) UploadFile(sftpClient *sftp.Client, filePath string, fileContents *bytes.Buffer) error
UploadFile uploads a file to the server.
type Instances ¶
type Instances struct {
// contains filtered or unexported fields
}
Instances implements the interface cloudprovider.Instances.
func (Instances) AddSSHKeyToAllInstances ¶
AddSSHKeyToAllInstances adds an SSH public key as a legal identity for all instances expected format for the key is standard ssh-keygen format: <protocol> <blob>.
func (Instances) CurrentNodeName ¶
CurrentNodeName returns the name of the node we are currently running on. On most clouds (e.g. GCE) this is the hostname, so we provide the hostname.
func (Instances) InstanceExistsByProviderID ¶
InstanceExistsByProviderID returns true if the instance for the given provider exists. If false is returned with no error, the instance will be immediately deleted by the cloud controller manager. This method should still return true for instances that exist but are stopped/sleeping.
func (Instances) InstanceID ¶
InstanceID returns the cloud provider ID of the node with the specified NodeName. Note that if the instance does not exist, we must return ("", cloudprovider.InstanceNotFound). cloudprovider.InstanceNotFound should NOT be returned for instances that exist but are stopped/sleeping.
func (Instances) InstanceShutdownByProviderID ¶
func (i Instances) InstanceShutdownByProviderID(ctx context.Context, providerID string) (bool, error)
InstanceShutdownByProviderID returns true if the instance is shutdown in cloudprovider.
func (Instances) InstanceType ¶
InstanceType returns the type of the specified instance.
func (Instances) InstanceTypeByProviderID ¶
InstanceTypeByProviderID returns the type of the specified instance.
func (Instances) NodeAddresses ¶
func (i Instances) NodeAddresses(ctx context.Context, name types.NodeName) ([]v1.NodeAddress, error)
NodeAddresses returns the addresses of the specified instance.
func (Instances) NodeAddressesByProviderID ¶
func (i Instances) NodeAddressesByProviderID(ctx context.Context, providerID string) ([]v1.NodeAddress, error)
NodeAddressesByProviderID returns the addresses of the specified instance. The instance is specified using the providerID of the node. The ProviderID is a unique identifier of the node. This will not be called from the node whose nodeaddresses are being queried. i.e. local metadata services cannot be used in this method to obtain nodeaddresses.
type LoadBalancers ¶
type LoadBalancers struct {
// contains filtered or unexported fields
}
LoadBalancers implements the interface cloudprovider.LoadBalancer.
func (LoadBalancers) EnsureLoadBalancer ¶
func (l LoadBalancers) EnsureLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error)
EnsureLoadBalancer creates a new load balancer 'name', or updates the existing one. Returns the status of the balancer. Implementations must treat the *v1.Service and *v1.Node parameters as read-only and not modify them. Parameter 'clusterName' is the name of the cluster as presented to kube-controller-manager
func (LoadBalancers) EnsureLoadBalancerDeleted ¶
func (l LoadBalancers) 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. This construction is useful because many cloud providers' load balancers have multiple underlying components, meaning a Get could say that the LB doesn't exist even if some part of it is still laying around. Implementations must treat the *v1.Service parameter as read-only and not modify it. Parameter 'clusterName' is the name of the cluster as presented to kube-controller-manager.
func (LoadBalancers) GetLoadBalancer ¶
func (l LoadBalancers) GetLoadBalancer(ctx context.Context, clusterName string, service *v1.Service) (status *v1.LoadBalancerStatus, exists bool, err error)
GetLoadBalancer returns whether the specified load balancer exists, and if so, what its status is. Implementations must treat the *v1.Service parameter as read-only and not modify it. Parameter 'clusterName' is the name of the cluster as presented to kube-controller-manager
func (LoadBalancers) GetLoadBalancerName ¶
func (l LoadBalancers) GetLoadBalancerName(ctx context.Context, clusterName string, service *v1.Service) string
GetLoadBalancerName returns the name of the load balancer. Implementations must treat the *v1.Service parameter as read-only and not modify it.
func (LoadBalancers) UpdateLoadBalancer ¶
func (l LoadBalancers) UpdateLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node) error
UpdateLoadBalancer updates hosts under the specified load balancer. Implementations must treat the *v1.Service and *v1.Node parameters as read-only and not modify them. Parameter 'clusterName' is the name of the cluster as presented to kube-controller-manager.
type Zones ¶
type Zones struct {
// contains filtered or unexported fields
}
Zones implements the interface cloudprovider.Zones.
func (Zones) GetZone ¶
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 (Zones) GetZoneByNodeName ¶
func (z Zones) 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 (Zones) GetZoneByProviderID ¶
func (z Zones) 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.