Documentation ¶
Index ¶
- func NewServicePrincipalTokenFromCredentials(tenantId string, clientId string, clientSecret string, scope string) (*azure.ServicePrincipalToken, error)
- type AzureCloudProvider
- func (azure *AzureCloudProvider) Name() string
- func (azure *AzureCloudProvider) NodeGroupForNode(node *apiv1.Node) (cloudprovider.NodeGroup, error)
- func (azure *AzureCloudProvider) NodeGroups() []cloudprovider.NodeGroup
- func (azure *AzureCloudProvider) Pricing() (cloudprovider.PricingModel, errors.AutoscalerError)
- type AzureManager
- func (m *AzureManager) DeleteInstances(instances []*AzureRef) error
- func (m *AzureManager) GetScaleSetForInstance(instance *AzureRef) (*ScaleSet, error)
- func (m *AzureManager) GetScaleSetSize(asConfig *ScaleSet) (int64, error)
- func (m *AzureManager) GetScaleSetVms(scaleSet *ScaleSet) ([]string, error)
- func (m *AzureManager) RegisterScaleSet(scaleSet *ScaleSet)
- func (m *AzureManager) SetScaleSetSize(asConfig *ScaleSet, size int64) error
- type AzureRef
- type Config
- type ScaleSet
- func (scaleSet *ScaleSet) Belongs(node *apiv1.Node) (bool, error)
- func (scaleSet *ScaleSet) Debug() string
- func (scaleSet *ScaleSet) DecreaseTargetSize(delta int) error
- func (scaleSet *ScaleSet) DeleteNodes(nodes []*apiv1.Node) error
- func (scaleSet *ScaleSet) Id() string
- func (scaleSet *ScaleSet) IncreaseSize(delta int) error
- func (scaleSet *ScaleSet) MaxSize() int
- func (scaleSet *ScaleSet) MinSize() int
- func (scaleSet *ScaleSet) Nodes() ([]string, error)
- func (scaleSet *ScaleSet) TargetSize() (int, error)
- func (scaleSet *ScaleSet) TemplateNodeInfo() (*schedulercache.NodeInfo, error)
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.
func (*AzureCloudProvider) Pricing ¶
func (azure *AzureCloudProvider) Pricing() (cloudprovider.PricingModel, errors.AutoscalerError)
Pricing returns pricing model for this cloud provider or error if not available.
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 ¶
AzureRefFromProviderId creates InstanceConfig object from provider id which must be in format: azure:///resourceGroupName/name
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) DecreaseTargetSize ¶
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 ¶
DeleteNodes deletes the nodes from the group.
func (*ScaleSet) IncreaseSize ¶
IncreaseSize increases Scale Set size
func (*ScaleSet) TargetSize ¶
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.
func (*ScaleSet) TemplateNodeInfo ¶
func (scaleSet *ScaleSet) TemplateNodeInfo() (*schedulercache.NodeInfo, error)
TemplateNodeInfo returns a node template for this scale set.