Documentation ¶
Index ¶
- func NewServicePrincipalTokenFromCredentials(tenantID string, clientID string, clientSecret string, scope string) (*adal.ServicePrincipalToken, error)
- type AzureCloudProvider
- func (azure *AzureCloudProvider) Cleanup() error
- func (azure *AzureCloudProvider) GetAvailableMachineTypes() ([]string, error)
- func (azure *AzureCloudProvider) GetResourceLimiter() (*cloudprovider.ResourceLimiter, error)
- func (azure *AzureCloudProvider) Name() string
- func (azure *AzureCloudProvider) NewNodeGroup(machineType string, labels map[string]string, systemLabels map[string]string, ...) (cloudprovider.NodeGroup, error)
- func (azure *AzureCloudProvider) NodeGroupForNode(node *apiv1.Node) (cloudprovider.NodeGroup, error)
- func (azure *AzureCloudProvider) NodeGroups() []cloudprovider.NodeGroup
- func (azure *AzureCloudProvider) Pricing() (cloudprovider.PricingModel, errors.AutoscalerError)
- func (azure *AzureCloudProvider) Refresh() error
- type AzureManager
- func (m *AzureManager) Cleanup()
- 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) Autoprovisioned() bool
- func (scaleSet *ScaleSet) Belongs(node *apiv1.Node) (bool, error)
- func (scaleSet *ScaleSet) Create() error
- func (scaleSet *ScaleSet) Debug() string
- func (scaleSet *ScaleSet) DecreaseTargetSize(delta int) error
- func (scaleSet *ScaleSet) Delete() error
- func (scaleSet *ScaleSet) DeleteNodes(nodes []*apiv1.Node) error
- func (scaleSet *ScaleSet) Exist() bool
- 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) (*adal.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, resourceLimiter *cloudprovider.ResourceLimiter) (*AzureCloudProvider, error)
BuildAzureCloudProvider creates new AzureCloudProvider
func (*AzureCloudProvider) Cleanup ¶
func (azure *AzureCloudProvider) Cleanup() error
Cleanup stops the go routine that is handling the current view of the ASGs in the form of a cache
func (*AzureCloudProvider) GetAvailableMachineTypes ¶
func (azure *AzureCloudProvider) GetAvailableMachineTypes() ([]string, error)
GetAvailableMachineTypes get all machine types that can be requested from the cloud provider.
func (*AzureCloudProvider) GetResourceLimiter ¶
func (azure *AzureCloudProvider) GetResourceLimiter() (*cloudprovider.ResourceLimiter, error)
GetResourceLimiter returns struct containing limits (max, min) for resources (cores, memory etc.).
func (*AzureCloudProvider) Name ¶
func (azure *AzureCloudProvider) Name() string
Name returns name of the cloud provider.
func (*AzureCloudProvider) NewNodeGroup ¶
func (azure *AzureCloudProvider) NewNodeGroup(machineType string, labels map[string]string, systemLabels map[string]string, extraResources map[string]resource.Quantity) (cloudprovider.NodeGroup, error)
NewNodeGroup builds a theoretical node group based on the node definition provided. The node group is not automatically created on the cloud provider side. The node group is not returned by NodeGroups() until it is created.
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.
func (*AzureCloudProvider) Refresh ¶
func (azure *AzureCloudProvider) Refresh() error
Refresh is called before every main loop and can be used to dynamically update cloud provider state. In particular the list of node groups returned by NodeGroups can change as a result of CloudProvider.Refresh().
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) Cleanup ¶
func (m *AzureManager) Cleanup()
Cleanup closes the channel to signal the go routine to stop that is handling the cache
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) Autoprovisioned ¶
Autoprovisioned returns true if the node group is autoprovisioned.
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) Delete ¶
Delete deletes the node group on the cloud provider side. This will be executed only for autoprovisioned node groups, once their size drops to 0.
func (*ScaleSet) DeleteNodes ¶
DeleteNodes deletes the nodes from the group.
func (*ScaleSet) Exist ¶
Exist checks if the node group really exists on the cloud provider side. Allows to tell the theoretical node group from the real one.
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 Kubernetes.
func (*ScaleSet) TemplateNodeInfo ¶
func (scaleSet *ScaleSet) TemplateNodeInfo() (*schedulercache.NodeInfo, error)
TemplateNodeInfo returns a node template for this scale set.