Documentation ¶
Overview ¶
Package qingcloud is an implementation of Interface, LoadBalancer and Instances for QingCloud.
Index ¶
- Constants
- Variables
- func NodeNameToInstanceID(name types.NodeName) string
- type Config
- type QingCloud
- func (qc *QingCloud) AddSSHKeyToAllInstances(user string, keyData []byte) error
- func (qc *QingCloud) Clusters() (cloudprovider.Clusters, bool)
- func (qc *QingCloud) CurrentNodeName(hostname string) (types.NodeName, error)
- func (qc *QingCloud) DeleteSecurityGroup(sgID *string) error
- func (qc *QingCloud) EnsureLoadBalancer(clusterName string, service *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error)
- func (qc *QingCloud) EnsureLoadBalancerDeleted(clusterName string, service *v1.Service) error
- func (qc *QingCloud) ExternalID(nodeName types.NodeName) (string, error)
- func (qc *QingCloud) GetInstanceByID(instanceID string) (*qcservice.Instance, error)
- func (qc *QingCloud) GetLoadBalancer(clusterName string, service *v1.Service) (status *v1.LoadBalancerStatus, exists bool, err error)
- func (qc *QingCloud) GetSelf() *qcservice.Instance
- func (qc *QingCloud) GetZone() (cloudprovider.Zone, error)
- func (qc *QingCloud) GetZoneByNodeName(nodeName types.NodeName) (cloudprovider.Zone, error)
- func (qc *QingCloud) GetZoneByProviderID(providerID string) (cloudprovider.Zone, error)
- func (qc *QingCloud) HasClusterID() bool
- func (qc *QingCloud) Initialize(clientBuilder controller.ControllerClientBuilder)
- func (qc *QingCloud) InstanceExistsByProviderID(providerID string) (bool, error)
- func (qc *QingCloud) InstanceID(nodeName types.NodeName) (string, error)
- func (qc *QingCloud) InstanceType(name types.NodeName) (string, error)
- func (qc *QingCloud) InstanceTypeByProviderID(providerID string) (string, error)
- func (qc *QingCloud) Instances() (cloudprovider.Instances, bool)
- func (qc *QingCloud) List(filter string) ([]types.NodeName, error)
- func (qc *QingCloud) LoadBalancer() (cloudprovider.LoadBalancer, bool)
- func (qc *QingCloud) NodeAddresses(nodeName types.NodeName) ([]v1.NodeAddress, error)
- func (qc *QingCloud) NodeAddressesByProviderID(providerId string) ([]v1.NodeAddress, error)
- func (qc *QingCloud) ProviderName() string
- func (qc *QingCloud) Routes() (cloudprovider.Routes, bool)
- func (qc *QingCloud) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []string)
- func (qc *QingCloud) UpdateLoadBalancer(clusterName string, service *v1.Service, nodes []*v1.Node) error
- func (qc *QingCloud) Zones() (cloudprovider.Zones, bool)
Constants ¶
const ( // ServiceAnnotationLoadBalancerEipIds is the annotation which specifies a list of eip ids. // The ids in list are separated by ',', e.g. "eip-j38f2h3h,eip-ornz2xq7". And this annotation should // NOT be used with ServiceAnnotationLoadBalancerVxnetId. Please make sure there is one and only one // of them being set ServiceAnnotationLoadBalancerEipIds = "service.beta.kubernetes.io/qingcloud-load-balancer-eip-ids" /* ServiceAnnotationLoadBalancerVxnetId is the annotation which indicates the very vxnet where load * balancer resides. This annotation should NOT be used when ServiceAnnotationLoadBalancerEipIds is * set. */ ServiceAnnotationLoadBalancerVxnetId = "service.beta.kubernetes.io/qingcloud-load-balancer-vxnet-id" // ServiceAnnotationLoadBalancerType is the annotation used on the // service to indicate that we want a qingcloud loadBalancer type. // value "0" means the LB can max support 5000 concurrency connections, it's default type. // value "1" means the LB can max support 20000 concurrency connections. // value "2" means the LB can max support 40000 concurrency connections. // value "3" means the LB can max support 100000 concurrency connections. // value "4" means the LB can max support 200000 concurrency connections. // value "5" means the LB can max support 500000 concurrency connections. ServiceAnnotationLoadBalancerType = "service.beta.kubernetes.io/qingcloud-load-balancer-type" )
const (
ProviderName = "qingcloud"
)
Variables ¶
var ( VERSION string = "dev" GIT_SHA1 string = "dev+git" BUILD_LABEL string = "please use make to generate build files" )
Functions ¶
func NodeNameToInstanceID ¶
Make sure qingcloud instance hostname or override-hostname (if provided) is equal to InstanceId Recommended to use override-hostname
Types ¶
type QingCloud ¶
type QingCloud struct {
// contains filtered or unexported fields
}
A single Kubernetes cluster can run in multiple zones, but only within the same region (and cloud provider).
func (*QingCloud) AddSSHKeyToAllInstances ¶
AddSSHKeyToAllInstances adds an SSH public key as a legal identity for all instances. The method is currently only used in gce.
func (*QingCloud) 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 (*QingCloud) DeleteSecurityGroup ¶
func (*QingCloud) EnsureLoadBalancer ¶
func (qc *QingCloud) EnsureLoadBalancer(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 To create a LoadBalancer for kubernetes, we do the following: 1. create a qingcloud loadBalancer; 2. create listeners for the new loadBalancer, number of listeners = number of service ports; 3. add backends to the new loadBalancer. will update this LB for below cases, otherwise, deleting existing one and recreate it 1. LB type is changed 2. balance mode is changed 3. previously use eip and now still use another eip 4. ports is different with previous setting, this will just bring changes on listeners
func (*QingCloud) EnsureLoadBalancerDeleted ¶
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.
func (*QingCloud) ExternalID ¶
ExternalID returns the cloud provider ID of the specified instance (deprecated). Note that if the instance does not exist or is no longer running, we must return ("", cloudprovider.InstanceNotFound)
func (*QingCloud) GetInstanceByID ¶
GetInstanceByID get instance.Instance by instanceId
func (*QingCloud) GetLoadBalancer ¶
func (qc *QingCloud) GetLoadBalancer(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.
func (*QingCloud) GetZoneByNodeName ¶
GetZoneByNodeName implements Zones.GetZoneByNodeName This is particularly useful in external cloud providers where the kubelet does not initialize node data.
func (*QingCloud) GetZoneByProviderID ¶
func (qc *QingCloud) GetZoneByProviderID(providerID string) (cloudprovider.Zone, error)
GetZoneByProviderID implements Zones.GetZoneByProviderID This is particularly useful in external cloud providers where the kubelet does not initialize node data.
func (*QingCloud) HasClusterID ¶
HasClusterID returns true if the cluster has a clusterID
func (*QingCloud) Initialize ¶
func (qc *QingCloud) Initialize(clientBuilder controller.ControllerClientBuilder)
func (*QingCloud) InstanceExistsByProviderID ¶
InstanceExistsByProviderID returns true if the instance with the given provider id still exists and is running. If false is returned with no error, the instance will be immediately deleted by the cloud controller manager.
func (*QingCloud) InstanceID ¶
InstanceID returns the cloud provider ID of the specified instance.
func (*QingCloud) InstanceType ¶
InstanceType returns the type of the specified instance.
func (*QingCloud) InstanceTypeByProviderID ¶
func (*QingCloud) Instances ¶
func (qc *QingCloud) Instances() (cloudprovider.Instances, bool)
Instances returns an implementation of Instances for QingCloud.
func (*QingCloud) List ¶
List lists instances that match 'filter' which is a regular expression which must match the entire instance name (fqdn)
func (*QingCloud) LoadBalancer ¶
func (qc *QingCloud) LoadBalancer() (cloudprovider.LoadBalancer, bool)
LoadBalancer returns an implementation of LoadBalancer for QingCloud.
func (*QingCloud) NodeAddresses ¶
NodeAddresses returns the addresses of the specified instance.
func (*QingCloud) NodeAddressesByProviderID ¶
func (qc *QingCloud) NodeAddressesByProviderID(providerId string) ([]v1.NodeAddress, error)