azure

package
v0.0.0-...-ca852fc Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2017 License: Apache-2.0 Imports: 17 Imported by: 0

README

Implementation of cloud provider for Azure.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServicePrincipalTokenFromCredentials

func NewServicePrincipalTokenFromCredentials(tenantId string, clientId string, clientSecret string, scope string) (*azure.ServicePrincipalToken, error)

NewServicePrincipalTokenFromCredentials creates a new ServicePrincipalToken using values of the passed credentials map.

Types

type AzureCloudProvider

type AzureCloudProvider struct {
	// contains filtered or unexported fields
}

AzureCloudProvider provides implementation of CloudProvider interface for Azure.

func BuildAzureCloudProvider

func BuildAzureCloudProvider(azureManager *AzureManager, specs []string) (*AzureCloudProvider, error)

BuildAzureCloudProvider creates new AzureCloudProvider

func (*AzureCloudProvider) Name

func (azure *AzureCloudProvider) Name() string

Name returns name of the cloud provider.

func (*AzureCloudProvider) NodeGroupForNode

func (azure *AzureCloudProvider) NodeGroupForNode(node *apiv1.Node) (cloudprovider.NodeGroup, error)

NodeGroupForNode returns the node group for the given node.

func (*AzureCloudProvider) NodeGroups

func (azure *AzureCloudProvider) NodeGroups() []cloudprovider.NodeGroup

NodeGroups returns all node groups configured for this cloud provider.

type AzureManager

type AzureManager struct {
	// contains filtered or unexported fields
}

AzureManager handles Azure communication and data caching.

func CreateAzureManager

func CreateAzureManager(configReader io.Reader) (*AzureManager, error)

CreateAzureManager creates Azure Manager object to work with Azure.

func (*AzureManager) DeleteInstances

func (m *AzureManager) DeleteInstances(instances []*AzureRef) error

DeleteInstances deletes the given instances. All instances must be controlled by the same ASG.

func (*AzureManager) GetScaleSetForInstance

func (m *AzureManager) GetScaleSetForInstance(instance *AzureRef) (*ScaleSet, error)

GetScaleSetForInstance returns ScaleSetConfig of the given Instance

func (*AzureManager) GetScaleSetSize

func (m *AzureManager) GetScaleSetSize(asConfig *ScaleSet) (int64, error)

GetScaleSetSize gets Scale Set size.

func (*AzureManager) GetScaleSetVms

func (m *AzureManager) GetScaleSetVms(scaleSet *ScaleSet) ([]string, error)

GetScaleSetVms returns list of nodes for the given scale set.

func (*AzureManager) RegisterScaleSet

func (m *AzureManager) RegisterScaleSet(scaleSet *ScaleSet)

RegisterScaleSet registers scale set in Azure Manager.

func (*AzureManager) SetScaleSetSize

func (m *AzureManager) SetScaleSetSize(asConfig *ScaleSet, size int64) error

SetScaleSetSize sets ScaleSet size.

type AzureRef

type AzureRef struct {
	Name string
}

AzureRef contains a reference to some entity in Azure world.

func AzureRefFromProviderId

func AzureRefFromProviderId(id string) (*AzureRef, error)

AzureRefFromProviderId creates InstanceConfig object from provider id which must be in format: azure:///resourceGroupName/name

func (*AzureRef) GetKey

func (m *AzureRef) GetKey() string

GetKey returns key of the given azure reference.

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"`
	PrimaryAvailabilitySetName string `json:"primaryAvailabilitySetName" yaml:"primaryAvailabilitySetName"`

	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

type ScaleSet

type ScaleSet struct {
	AzureRef
	// contains filtered or unexported fields
}

ScaleSet implements NodeGroup interface.

func (*ScaleSet) Belongs

func (scaleSet *ScaleSet) Belongs(node *apiv1.Node) (bool, error)

Belongs returns true if the given node belongs to the NodeGroup.

func (*ScaleSet) Debug

func (scaleSet *ScaleSet) Debug() string

Debug returns a debug string for the Scale Set.

func (*ScaleSet) DecreaseTargetSize

func (scaleSet *ScaleSet) DecreaseTargetSize(delta int) error

DecreaseTargetSize decreases the target size of the node group. This function doesn't permit to delete any existing node and can be used only to reduce the request for new nodes that have not been yet fulfilled. Delta should be negative. It is assumed that cloud provider will not delete the existing nodes if the size when there is an option to just decrease the target.

func (*ScaleSet) DeleteNodes

func (scaleSet *ScaleSet) DeleteNodes(nodes []*apiv1.Node) error

DeleteNodes deletes the nodes from the group.

func (*ScaleSet) Id

func (scaleSet *ScaleSet) Id() string

Id returns ScaleSet id.

func (*ScaleSet) IncreaseSize

func (scaleSet *ScaleSet) IncreaseSize(delta int) error

IncreaseSize increases Scale Set size

func (*ScaleSet) MaxSize

func (scaleSet *ScaleSet) MaxSize() int

MaxSize returns maximum size of the node group.

func (*ScaleSet) MinSize

func (scaleSet *ScaleSet) MinSize() int

MinSize returns minimum size of the node group.

func (*ScaleSet) Nodes

func (scaleSet *ScaleSet) Nodes() ([]string, error)

Nodes returns a list of all nodes that belong to this node group.

func (*ScaleSet) TargetSize

func (scaleSet *ScaleSet) TargetSize() (int, error)

TargetSize returns the current TARGET size of the node group. It is possible that the number is different from the number of nodes registered in Kuberentes.

Jump to

Keyboard shortcuts

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