qingcloud

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2018 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package qingcloud is an implementation of Interface, LoadBalancer and Instances for QingCloud.

Index

Constants

View Source
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"
)
View Source
const (
	ProviderName = "qingcloud"
)

Variables

View Source
var (
	VERSION     string = "dev"
	GIT_SHA1    string = "dev+git"
	BUILD_LABEL string = "please use make to generate build files"
)

Functions

func NodeNameToInstanceID

func NodeNameToInstanceID(name types.NodeName) string

Make sure qingcloud instance hostname or override-hostname (if provided) is equal to InstanceId Recommended to use override-hostname

Types

type Config

type Config struct {
	Global struct {
		QYConfigPath      string `gcfg:"qyConfigPath"`
		Zone              string `gcfg:"zone"`
		DefaultVxNetForLB string `gcfg:"defaultVxNetForLB"`
	}
}

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

func (qc *QingCloud) AddSSHKeyToAllInstances(user string, keyData []byte) error

AddSSHKeyToAllInstances adds an SSH public key as a legal identity for all instances. The method is currently only used in gce.

func (*QingCloud) Clusters

func (qc *QingCloud) Clusters() (cloudprovider.Clusters, bool)

func (*QingCloud) CurrentNodeName

func (qc *QingCloud) CurrentNodeName(hostname string) (types.NodeName, error)

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 (qc *QingCloud) DeleteSecurityGroup(sgID *string) error

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

func (qc *QingCloud) EnsureLoadBalancerDeleted(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.

func (*QingCloud) ExternalID

func (qc *QingCloud) ExternalID(nodeName types.NodeName) (string, error)

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

func (qc *QingCloud) GetInstanceByID(instanceID string) (*qcservice.Instance, error)

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) GetSelf

func (qc *QingCloud) GetSelf() *qcservice.Instance

func (*QingCloud) GetZone

func (qc *QingCloud) GetZone() (cloudprovider.Zone, error)

func (*QingCloud) GetZoneByNodeName

func (qc *QingCloud) GetZoneByNodeName(nodeName types.NodeName) (cloudprovider.Zone, error)

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

func (qc *QingCloud) HasClusterID() bool

HasClusterID returns true if the cluster has a clusterID

func (*QingCloud) Initialize

func (qc *QingCloud) Initialize(clientBuilder controller.ControllerClientBuilder)

func (*QingCloud) InstanceExistsByProviderID

func (qc *QingCloud) InstanceExistsByProviderID(providerID string) (bool, error)

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

func (qc *QingCloud) InstanceID(nodeName types.NodeName) (string, error)

InstanceID returns the cloud provider ID of the specified instance.

func (*QingCloud) InstanceType

func (qc *QingCloud) InstanceType(name types.NodeName) (string, error)

InstanceType returns the type of the specified instance.

func (*QingCloud) InstanceTypeByProviderID

func (qc *QingCloud) InstanceTypeByProviderID(providerID string) (string, error)

func (*QingCloud) Instances

func (qc *QingCloud) Instances() (cloudprovider.Instances, bool)

Instances returns an implementation of Instances for QingCloud.

func (*QingCloud) List

func (qc *QingCloud) List(filter string) ([]types.NodeName, error)

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

func (qc *QingCloud) NodeAddresses(nodeName types.NodeName) ([]v1.NodeAddress, error)

NodeAddresses returns the addresses of the specified instance.

func (*QingCloud) NodeAddressesByProviderID

func (qc *QingCloud) NodeAddressesByProviderID(providerId string) ([]v1.NodeAddress, error)

func (*QingCloud) ProviderName

func (qc *QingCloud) ProviderName() string

func (*QingCloud) Routes

func (qc *QingCloud) Routes() (cloudprovider.Routes, bool)

func (*QingCloud) ScrubDNS

func (qc *QingCloud) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []string)

ScrubDNS filters DNS settings for pods.

func (*QingCloud) UpdateLoadBalancer

func (qc *QingCloud) UpdateLoadBalancer(clusterName string, service *v1.Service, nodes []*v1.Node) error

UpdateLoadBalancer updates hosts under the specified load balancer.

func (*QingCloud) Zones

func (qc *QingCloud) Zones() (cloudprovider.Zones, bool)

Jump to

Keyboard shortcuts

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