azure

package
v1.2.0-alpha.2....-01cd7f3 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2016 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const CloudProviderName = "azure"

CloudProviderName is the value used for the --cloud-provider flag

Variables

This section is empty.

Functions

func NewCloud

func NewCloud(configReader io.Reader) (cloudprovider.Interface, error)

NewCloud returns a Cloud with initialized clients

Types

type Cloud

type Cloud struct {
	Config
	Environment             azure.Environment
	RoutesClient            network.RoutesClient
	SubnetsClient           network.SubnetsClient
	InterfacesClient        network.InterfacesClient
	RouteTablesClient       network.RouteTablesClient
	LoadBalancerClient      network.LoadBalancersClient
	PublicIPAddressesClient network.PublicIPAddressesClient
	SecurityGroupsClient    network.SecurityGroupsClient
	VirtualMachinesClient   compute.VirtualMachinesClient
}

Cloud holds the config and clients

func (*Cloud) AddSSHKeyToAllInstances

func (az *Cloud) AddSSHKeyToAllInstances(user string, keyData []byte) error

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 (*Cloud) Clusters

func (az *Cloud) Clusters() (cloudprovider.Clusters, bool)

Clusters returns a clusters interface. Also returns true if the interface is supported, false otherwise.

func (*Cloud) CreateRoute

func (az *Cloud) CreateRoute(clusterName string, nameHint string, kubeRoute *cloudprovider.Route) error

CreateRoute creates the described managed route route.Name will be ignored, although the cloud-provider may use nameHint to create a more user-meaningful name.

func (*Cloud) CurrentNodeName

func (az *Cloud) CurrentNodeName(hostname string) (string, 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 (*Cloud) DeleteRoute

func (az *Cloud) DeleteRoute(clusterName string, kubeRoute *cloudprovider.Route) error

DeleteRoute deletes the specified managed route Route should be as returned by ListRoutes

func (*Cloud) EnsureLoadBalancer

func (az *Cloud) EnsureLoadBalancer(clusterName string, service *api.Service, hosts []string) (*api.LoadBalancerStatus, error)

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

func (*Cloud) EnsureLoadBalancerDeleted

func (az *Cloud) EnsureLoadBalancerDeleted(clusterName string, service *api.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 (*Cloud) ExternalID

func (az *Cloud) ExternalID(name string) (string, error)

ExternalID returns the cloud provider ID of the specified instance (deprecated).

func (*Cloud) GetLoadBalancer

func (az *Cloud) GetLoadBalancer(clusterName string, service *api.Service) (status *api.LoadBalancerStatus, exists bool, err error)

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

func (*Cloud) GetZone

func (az *Cloud) GetZone() (cloudprovider.Zone, error)

GetZone returns the Zone containing the current failure zone and locality region that the program is running in

func (*Cloud) InstanceID

func (az *Cloud) InstanceID(name string) (string, error)

InstanceID returns the cloud provider ID of the specified instance. Note that if the instance does not exist or is no longer running, we must return ("", cloudprovider.InstanceNotFound)

func (*Cloud) InstanceType

func (az *Cloud) InstanceType(name string) (string, error)

InstanceType returns the type of the specified instance. Note that if the instance does not exist or is no longer running, we must return ("", cloudprovider.InstanceNotFound) (Implementer Note): This is used by kubelet. Kubelet will label the node. Real log from kubelet:

Adding node label from cloud provider: beta.kubernetes.io/instance-type=[value]

func (*Cloud) Instances

func (az *Cloud) Instances() (cloudprovider.Instances, bool)

Instances returns an instances interface. Also returns true if the interface is supported, false otherwise.

func (*Cloud) List

func (az *Cloud) List(filter string) ([]string, error)

List lists instances that match 'filter' which is a regular expression which must match the entire instance name (fqdn)

func (*Cloud) ListRoutes

func (az *Cloud) ListRoutes(clusterName string) (routes []*cloudprovider.Route, err error)

ListRoutes lists all managed routes that belong to the specified clusterName

func (*Cloud) LoadBalancer

func (az *Cloud) LoadBalancer() (cloudprovider.LoadBalancer, bool)

LoadBalancer returns a balancer interface. Also returns true if the interface is supported, false otherwise.

func (*Cloud) NodeAddresses

func (az *Cloud) NodeAddresses(name string) ([]api.NodeAddress, error)

NodeAddresses returns the addresses of the specified instance.

func (*Cloud) ProviderName

func (az *Cloud) ProviderName() string

ProviderName returns the cloud provider ID.

func (*Cloud) Routes

func (az *Cloud) Routes() (cloudprovider.Routes, bool)

Routes returns a routes interface along with whether the interface is supported.

func (*Cloud) ScrubDNS

func (az *Cloud) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []string)

ScrubDNS provides an opportunity for cloud-provider-specific code to process DNS settings for pods.

func (*Cloud) UpdateLoadBalancer

func (az *Cloud) UpdateLoadBalancer(clusterName string, service *api.Service, hosts []string) error

UpdateLoadBalancer updates hosts under the specified load balancer.

func (*Cloud) Zones

func (az *Cloud) Zones() (cloudprovider.Zones, bool)

Zones returns a zones interface. Also returns true if the interface is supported, false otherwise.

type Config

type Config struct {
	Cloud             string `json:"cloud" yaml:"cloud"`
	TenantID          string `json:"tenantId" yaml:"tenantId"`
	SubscriptionID    string `json:"subscriptionId" yaml:"subscriptionId"`
	ResourceGroup     string `json:"resourceGroup" yaml:"resourceGroup"`
	Location          string `json:"location" yaml:"location"`
	VnetName          string `json:"vnetName" yaml:"vnetName"`
	SubnetName        string `json:"subnetName" yaml:"subnetName"`
	SecurityGroupName string `json:"securityGroupName" yaml:"securityGroupName"`
	RouteTableName    string `json:"routeTableName" yaml:"routeTableName"`

	AADClientID     string `json:"aadClientId" yaml:"aadClientId"`
	AADClientSecret string `json:"aadClientSecret" yaml:"aadClientSecret"`
	AADTenantID     string `json:"aadTenantId" yaml:"aadTenantId"`
}

Config holds the configuration parsed from the --cloud-config flag

Jump to

Keyboard shortcuts

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