Documentation ¶
Index ¶
- Constants
- Variables
- func BuildAzureCloudProvider(azureManager *AzureManager, resourceLimiter *cloudprovider.ResourceLimiter) (cloudprovider.CloudProvider, error)
- func GetVMNameIndex(osType compute.OperatingSystemTypes, vmName string) (int, error)
- type AccountsClient
- type AccountsClientMock
- type AgentPool
- func (as *AgentPool) Autoprovisioned() bool
- func (as *AgentPool) Belongs(node *apiv1.Node) (bool, error)
- func (as *AgentPool) Create() error
- func (as *AgentPool) Debug() string
- func (as *AgentPool) DecreaseTargetSize(delta int) error
- func (as *AgentPool) Delete() error
- func (as *AgentPool) DeleteInstances(instances []*azureRef) error
- func (as *AgentPool) DeleteNodes(nodes []*apiv1.Node) error
- func (as *AgentPool) Exist() bool
- func (m *AgentPool) GetKey() string
- func (as *AgentPool) GetVMIndexes() ([]int, map[int]string, error)
- func (as *AgentPool) GetVirtualMachines() (instances []compute.VirtualMachine, err error)
- func (as *AgentPool) Id() string
- func (as *AgentPool) IncreaseSize(delta int) error
- func (as *AgentPool) MaxSize() int
- func (as *AgentPool) MinSize() int
- func (as *AgentPool) Nodes() ([]string, error)
- func (as *AgentPool) TargetSize() (int, error)
- func (as *AgentPool) TemplateNodeInfo() (*schedulercache.NodeInfo, error)
- type AzUtil
- 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) GetAsgForInstance(instance *azureRef) (cloudprovider.NodeGroup, error)
- func (m *AzureManager) Refresh() error
- func (m *AzureManager) RegisterAsg(asg cloudprovider.NodeGroup) bool
- func (m *AzureManager) UnregisterAsg(asg cloudprovider.NodeGroup) bool
- type Config
- type ContainerServiceAgentPool
- func (agentPool *ContainerServiceAgentPool) Autoprovisioned() bool
- func (agentPool *ContainerServiceAgentPool) Create() error
- func (agentPool *ContainerServiceAgentPool) Debug() string
- func (agentPool *ContainerServiceAgentPool) DecreaseTargetSize(delta int) error
- func (agentPool *ContainerServiceAgentPool) Delete() error
- func (agentPool *ContainerServiceAgentPool) DeleteNodes(nodes []*apiv1.Node) error
- func (agentPool *ContainerServiceAgentPool) DeleteNodesInternal(providerIDs []string) error
- func (agentPool *ContainerServiceAgentPool) Exist() bool
- func (m *ContainerServiceAgentPool) GetKey() string
- func (agentPool *ContainerServiceAgentPool) GetName(providerID string) (string, error)
- func (agentPool *ContainerServiceAgentPool) GetNodeCount(agentProfiles *[]containerservice.AgentPoolProfile) (count int, err error)
- func (agentPool *ContainerServiceAgentPool) GetNodes() ([]string, error)
- func (agentPool *ContainerServiceAgentPool) GetPool(agentProfiles *[]containerservice.AgentPoolProfile) (ret *containerservice.AgentPoolProfile)
- func (agentPool *ContainerServiceAgentPool) GetProviderID(name string) string
- func (agentPool *ContainerServiceAgentPool) Id() string
- func (agentPool *ContainerServiceAgentPool) IncreaseSize(delta int) error
- func (agentPool *ContainerServiceAgentPool) IsContainerServiceNode(tags *map[string]*string) bool
- func (agentPool *ContainerServiceAgentPool) MaxSize() int
- func (agentPool *ContainerServiceAgentPool) MinSize() int
- func (agentPool *ContainerServiceAgentPool) Nodes() ([]string, error)
- func (agentPool *ContainerServiceAgentPool) SetNodeCount(agentProfiles *[]containerservice.AgentPoolProfile, count int) (err error)
- func (agentPool *ContainerServiceAgentPool) SetSize(targetSize int) error
- func (agentPool *ContainerServiceAgentPool) TargetSize() (int, error)
- func (agentPool *ContainerServiceAgentPool) TemplateNodeInfo() (*schedulercache.NodeInfo, error)
- type DeploymentsClient
- type DeploymentsClientMock
- func (m *DeploymentsClientMock) CreateOrUpdate(resourceGroupName string, deploymentName string, ...) (<-chan resources.DeploymentExtended, <-chan error)
- func (m *DeploymentsClientMock) ExportTemplate(resourceGroupName string, deploymentName string) (result resources.DeploymentExportResult, err error)
- func (m *DeploymentsClientMock) Get(resourceGroupName string, deploymentName string) (result resources.DeploymentExtended, err error)
- type DisksClient
- type DisksClientMock
- type InterfacesClient
- type InterfacesClientMock
- 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) DeleteInstances(instances []*azureRef) error
- func (scaleSet *ScaleSet) DeleteNodes(nodes []*apiv1.Node) error
- func (scaleSet *ScaleSet) Exist() bool
- func (m *ScaleSet) GetKey() string
- func (scaleSet *ScaleSet) GetScaleSetSize() (int64, error)
- func (scaleSet *ScaleSet) GetScaleSetVms() ([]compute.VirtualMachineScaleSetVM, 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) SetScaleSetSize(size int64) error
- func (scaleSet *ScaleSet) TargetSize() (int, error)
- func (scaleSet *ScaleSet) TemplateNodeInfo() (*schedulercache.NodeInfo, error)
- type VirtualMachineScaleSetVMsClient
- type VirtualMachineScaleSetVMsClientMock
- func (m *VirtualMachineScaleSetVMsClientMock) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, ...) (result compute.VirtualMachineScaleSetVM, err error)
- func (m *VirtualMachineScaleSetVMsClientMock) List(ctx context.Context, resourceGroupName string, ...) (result []compute.VirtualMachineScaleSetVM, err error)
- type VirtualMachineScaleSetsClient
- type VirtualMachineScaleSetsClientMock
- func (client *VirtualMachineScaleSetsClientMock) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, ...) (resp *http.Response, err error)
- func (client *VirtualMachineScaleSetsClientMock) DeleteInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (resp *http.Response, err error)
- func (client *VirtualMachineScaleSetsClientMock) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string) (result compute.VirtualMachineScaleSet, err error)
- func (client *VirtualMachineScaleSetsClientMock) List(ctx context.Context, resourceGroupName string) (result []compute.VirtualMachineScaleSet, err error)
- type VirtualMachinesClient
- type VirtualMachinesClientMock
- func (m *VirtualMachinesClientMock) Delete(ctx context.Context, resourceGroupName string, VMName string) (resp *http.Response, err error)
- func (m *VirtualMachinesClientMock) Get(ctx context.Context, resourceGroupName string, VMName string, ...) (result compute.VirtualMachine, err error)
- func (m *VirtualMachinesClientMock) List(ctx context.Context, resourceGroupName string) (result []compute.VirtualMachine, err error)
Constants ¶
const (
// ProviderName is the cloud provider name for Azure
ProviderName = "azure"
)
Variables ¶
var InstanceTypes = map[string]*instanceType{}/* 192 elements not displayed */
InstanceTypes is a map of azure resources
Functions ¶
func BuildAzureCloudProvider ¶
func BuildAzureCloudProvider(azureManager *AzureManager, resourceLimiter *cloudprovider.ResourceLimiter) (cloudprovider.CloudProvider, error)
BuildAzureCloudProvider creates new AzureCloudProvider
func GetVMNameIndex ¶
func GetVMNameIndex(osType compute.OperatingSystemTypes, vmName string) (int, error)
GetVMNameIndex return the index of VM in the node pools.
Types ¶
type AccountsClient ¶
type AccountsClient interface {
ListKeys(resourceGroupName string, accountName string) (result storage.AccountListKeysResult, err error)
}
AccountsClient defines needed functions for azure storage.AccountsClient.
type AccountsClientMock ¶
AccountsClientMock mocks for AccountsClient.
func (*AccountsClientMock) ListKeys ¶
func (m *AccountsClientMock) ListKeys(resourceGroupName string, accountName string) (result storage.AccountListKeysResult, err error)
ListKeys get a list of keys by accountName.
type AgentPool ¶
type AgentPool struct {
// contains filtered or unexported fields
}
AgentPool implements NodeGroup interface for agent pools deployed by acs-engine.
func NewAgentPool ¶
func NewAgentPool(spec *dynamic.NodeGroupSpec, az *AzureManager) (*AgentPool, error)
NewAgentPool creates a new AgentPool.
func (*AgentPool) Autoprovisioned ¶
Autoprovisioned returns true if the node group is autoprovisioned.
func (*AgentPool) 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 (*AgentPool) 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 (*AgentPool) DeleteInstances ¶
DeleteInstances deletes the given instances. All instances must be controlled by the same ASG.
func (*AgentPool) DeleteNodes ¶
DeleteNodes deletes the nodes from the group.
func (*AgentPool) 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 (*AgentPool) GetKey ¶
func (m *AgentPool) GetKey() string
GetKey returns key of the given azure reference.
func (*AgentPool) GetVMIndexes ¶
GetVMIndexes gets indexes of all virtual machines belonging to the agent pool.
func (*AgentPool) GetVirtualMachines ¶
func (as *AgentPool) GetVirtualMachines() (instances []compute.VirtualMachine, err error)
GetVirtualMachines returns list of nodes for the given agent pool.
func (*AgentPool) IncreaseSize ¶
IncreaseSize increases agent pool size
func (*AgentPool) 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 (*AgentPool) TemplateNodeInfo ¶
func (as *AgentPool) TemplateNodeInfo() (*schedulercache.NodeInfo, error)
TemplateNodeInfo returns a node template for this agent pool.
type AzUtil ¶
type AzUtil struct {
// contains filtered or unexported fields
}
AzUtil consists of utility functions which utilizes clients to different services. Since they span across various clients they cannot be fitted into individual client structs so adding them here.
func (*AzUtil) DeleteBlob ¶
DeleteBlob deletes the blob using the storage storage client.
type AzureCloudProvider ¶
type AzureCloudProvider struct {
// contains filtered or unexported fields
}
AzureCloudProvider provides implementation of CloudProvider interface for Azure.
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, discoveryOpts cloudprovider.NodeGroupDiscoveryOptions) (*AzureManager, error)
CreateAzureManager creates Azure Manager object to work with Azure.
func (*AzureManager) GetAsgForInstance ¶
func (m *AzureManager) GetAsgForInstance(instance *azureRef) (cloudprovider.NodeGroup, error)
GetAsgForInstance returns AsgConfig of the given Instance
func (*AzureManager) Refresh ¶
func (m *AzureManager) 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().
func (*AzureManager) RegisterAsg ¶
func (m *AzureManager) RegisterAsg(asg cloudprovider.NodeGroup) bool
RegisterAsg registers an ASG.
func (*AzureManager) UnregisterAsg ¶
func (m *AzureManager) UnregisterAsg(asg cloudprovider.NodeGroup) bool
UnregisterAsg unregisters an ASG.
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"` VMType string `json:"vmType" yaml:"vmType"` AADClientID string `json:"aadClientId" yaml:"aadClientId"` AADClientSecret string `json:"aadClientSecret" yaml:"aadClientSecret"` AADClientCertPath string `json:"aadClientCertPath" yaml:"aadClientCertPath"` AADClientCertPassword string `json:"aadClientCertPassword" yaml:"aadClientCertPassword"` UseManagedIdentityExtension bool `json:"useManagedIdentityExtension" yaml:"useManagedIdentityExtension"` // Configs only for standard vmType (agent pools). Deployment string `json:"deployment" yaml:"deployment"` DeploymentParameters map[string]interface{} `json:"deploymentParameters" yaml:"deploymentParameters"` //Configs only for ACS/AKS ClusterName string `json:"clusterName" yaml:"clusterName"` //Config only for AKS NodeResourceGroup string `json:"nodeResourceGroup" yaml:"nodeResourceGroup"` }
Config holds the configuration parsed from the --cloud-config flag
type ContainerServiceAgentPool ¶
type ContainerServiceAgentPool struct {
// contains filtered or unexported fields
}
ContainerServiceAgentPool implements NodeGroup interface for agent pool deployed in ACS/AKS
func NewContainerServiceAgentPool ¶
func NewContainerServiceAgentPool(spec *dynamic.NodeGroupSpec, am *AzureManager) (*ContainerServiceAgentPool, error)
NewContainerServiceAgentPool constructs ContainerServiceAgentPool from the --node param and azure manager
func (*ContainerServiceAgentPool) Autoprovisioned ¶
func (agentPool *ContainerServiceAgentPool) Autoprovisioned() bool
Autoprovisioned is set to false to indicate that this code does not create agentPools by itself.
func (*ContainerServiceAgentPool) Create ¶
func (agentPool *ContainerServiceAgentPool) Create() error
Create is returns already exists since we don't support the agent pool creation.
func (*ContainerServiceAgentPool) Debug ¶
func (agentPool *ContainerServiceAgentPool) Debug() string
Debug returns a string with basic details of the agentPool
func (*ContainerServiceAgentPool) DecreaseTargetSize ¶
func (agentPool *ContainerServiceAgentPool) DecreaseTargetSize(delta int) error
DecreaseTargetSize requests the underlying service to decrease the node count.
func (*ContainerServiceAgentPool) Delete ¶
func (agentPool *ContainerServiceAgentPool) Delete() error
Delete is not implemented since we don't support agent pool deletion.
func (*ContainerServiceAgentPool) DeleteNodes ¶
func (agentPool *ContainerServiceAgentPool) DeleteNodes(nodes []*apiv1.Node) error
DeleteNodes extracts the providerIDs from the node spec and calls into the internal delete method.
func (*ContainerServiceAgentPool) DeleteNodesInternal ¶
func (agentPool *ContainerServiceAgentPool) DeleteNodesInternal(providerIDs []string) error
DeleteNodesInternal calls the underlying vm service to delete the node. Additionally it also call into the container service to reflect the node count resulting from the deletion.
func (*ContainerServiceAgentPool) Exist ¶
func (agentPool *ContainerServiceAgentPool) Exist() bool
Exist is always true since we are initialized with an existing agentpool
func (*ContainerServiceAgentPool) GetKey ¶
func (m *ContainerServiceAgentPool) GetKey() string
GetKey returns key of the given azure reference.
func (*ContainerServiceAgentPool) GetName ¶
func (agentPool *ContainerServiceAgentPool) GetName(providerID string) (string, error)
GetName extracts the name of the node (a format which underlying cloud service understands) from the cloud providerID (format which kubernetes understands)
func (*ContainerServiceAgentPool) GetNodeCount ¶
func (agentPool *ContainerServiceAgentPool) GetNodeCount(agentProfiles *[]containerservice.AgentPoolProfile) (count int, err error)
GetNodeCount returns the count of nodes from the agent pool profile
func (*ContainerServiceAgentPool) GetNodes ¶
func (agentPool *ContainerServiceAgentPool) GetNodes() ([]string, error)
GetNodes extracts the node list from the underlying vm service and returns back equivalent providerIDs as list.
func (*ContainerServiceAgentPool) GetPool ¶
func (agentPool *ContainerServiceAgentPool) GetPool(agentProfiles *[]containerservice.AgentPoolProfile) (ret *containerservice.AgentPoolProfile)
GetPool is an internal function which figures out agentPoolProfile from the list based on the pool name provided in the --node parameter passed to the autoscaler main
func (*ContainerServiceAgentPool) GetProviderID ¶
func (agentPool *ContainerServiceAgentPool) GetProviderID(name string) string
GetProviderID converts the name of a node into the form that kubernetes cloud provider id is presented in.
func (*ContainerServiceAgentPool) Id ¶
func (agentPool *ContainerServiceAgentPool) Id() string
Id returns the name of the agentPool
func (*ContainerServiceAgentPool) IncreaseSize ¶
func (agentPool *ContainerServiceAgentPool) IncreaseSize(delta int) error
IncreaseSize calls in the underlying SetSize to increase the size in response to a scale up. It calculates the expected size based on a delta provided as parameter
func (*ContainerServiceAgentPool) IsContainerServiceNode ¶
func (agentPool *ContainerServiceAgentPool) IsContainerServiceNode(tags *map[string]*string) bool
IsContainerServiceNode checks if the tag from the vm matches the agentPool name
func (*ContainerServiceAgentPool) MaxSize ¶
func (agentPool *ContainerServiceAgentPool) MaxSize() int
MaxSize returns the maximum size scale limit provided by --node parameter to the autoscaler main
func (*ContainerServiceAgentPool) MinSize ¶
func (agentPool *ContainerServiceAgentPool) MinSize() int
MinSize returns the minimum size the cluster is allowed to scaled down to as provided by the node spec in --node parameter.
func (*ContainerServiceAgentPool) Nodes ¶
func (agentPool *ContainerServiceAgentPool) Nodes() ([]string, error)
Nodes returns the list of nodes in the agentPool.
func (*ContainerServiceAgentPool) SetNodeCount ¶
func (agentPool *ContainerServiceAgentPool) SetNodeCount(agentProfiles *[]containerservice.AgentPoolProfile, count int) (err error)
SetNodeCount sets the count of nodes in the in memory pool profile
func (*ContainerServiceAgentPool) SetSize ¶
func (agentPool *ContainerServiceAgentPool) SetSize(targetSize int) error
SetSize contacts the underlying service and sets the size of the pool. This will be called when a scale up occurs and will be called just after a delete is performed from a scale down.
func (*ContainerServiceAgentPool) TargetSize ¶
func (agentPool *ContainerServiceAgentPool) TargetSize() (int, error)
TargetSize gathers the target node count set for the cluster by querying the underlying service.
func (*ContainerServiceAgentPool) TemplateNodeInfo ¶
func (agentPool *ContainerServiceAgentPool) TemplateNodeInfo() (*schedulercache.NodeInfo, error)
TemplateNodeInfo is not implemented.
type DeploymentsClient ¶
type DeploymentsClient interface { Get(resourceGroupName string, deploymentName string) (result resources.DeploymentExtended, err error) ExportTemplate(resourceGroupName string, deploymentName string) (result resources.DeploymentExportResult, err error) CreateOrUpdate(resourceGroupName string, deploymentName string, parameters resources.Deployment, cancel <-chan struct{}) (<-chan resources.DeploymentExtended, <-chan error) }
DeploymentsClient defines needed functions for azure network.DeploymentsClient.
type DeploymentsClientMock ¶
type DeploymentsClientMock struct { mock.Mock FakeStore map[string]resources.DeploymentExtended // contains filtered or unexported fields }
DeploymentsClientMock mocks for DeploymentsClient.
func (*DeploymentsClientMock) CreateOrUpdate ¶
func (m *DeploymentsClientMock) CreateOrUpdate(resourceGroupName string, deploymentName string, parameters resources.Deployment, cancel <-chan struct{}) (<-chan resources.DeploymentExtended, <-chan error)
CreateOrUpdate creates or updates the Deployment.
func (*DeploymentsClientMock) ExportTemplate ¶
func (m *DeploymentsClientMock) ExportTemplate(resourceGroupName string, deploymentName string) (result resources.DeploymentExportResult, err error)
ExportTemplate exports the deployment's template.
func (*DeploymentsClientMock) Get ¶
func (m *DeploymentsClientMock) Get(resourceGroupName string, deploymentName string) (result resources.DeploymentExtended, err error)
Get gets the DeploymentExtended by deploymentName.
type DisksClient ¶
type DisksClient interface {
Delete(resourceGroupName string, diskName string, cancel <-chan struct{}) (<-chan disk.OperationStatusResponse, <-chan error)
}
DisksClient defines needed functions for azure disk.DisksClient.
type DisksClientMock ¶
DisksClientMock mocks for DisksClient.
func (*DisksClientMock) Delete ¶
func (m *DisksClientMock) Delete(resourceGroupName string, diskName string, cancel <-chan struct{}) (<-chan disk.OperationStatusResponse, <-chan error)
Delete deletes the disk by diskName.
type InterfacesClient ¶
type InterfacesClient interface {
Delete(resourceGroupName string, networkInterfaceName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error)
}
InterfacesClient defines needed functions for azure network.InterfacesClient.
type InterfacesClientMock ¶
InterfacesClientMock mocks for InterfacesClient.
type ScaleSet ¶
type ScaleSet struct {
// contains filtered or unexported fields
}
ScaleSet implements NodeGroup interface.
func NewScaleSet ¶
func NewScaleSet(spec *dynamic.NodeGroupSpec, az *AzureManager) (*ScaleSet, error)
NewScaleSet creates a new NewScaleSet.
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) DeleteInstances ¶
DeleteInstances deletes the given instances. All instances must be controlled by the same ASG.
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) GetKey ¶
func (m *ScaleSet) GetKey() string
GetKey returns key of the given azure reference.
func (*ScaleSet) GetScaleSetSize ¶
GetScaleSetSize gets Scale Set size.
func (*ScaleSet) GetScaleSetVms ¶
func (scaleSet *ScaleSet) GetScaleSetVms() ([]compute.VirtualMachineScaleSetVM, error)
GetScaleSetVms returns list of nodes for the given scale set. Note that the list results is not used directly because their resource ID format is not consistent with Get results. TODO(feiskyer): use list results directly after the issue fixed in Azure VMSS API.
func (*ScaleSet) IncreaseSize ¶
IncreaseSize increases Scale Set size
func (*ScaleSet) SetScaleSetSize ¶
SetScaleSetSize sets ScaleSet 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.
type VirtualMachineScaleSetVMsClient ¶
type VirtualMachineScaleSetVMsClient interface { Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result compute.VirtualMachineScaleSetVM, err error) List(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result []compute.VirtualMachineScaleSetVM, err error) }
VirtualMachineScaleSetVMsClient defines needed functions for azure compute.VirtualMachineScaleSetVMsClient.
type VirtualMachineScaleSetVMsClientMock ¶
VirtualMachineScaleSetVMsClientMock mocks for VirtualMachineScaleSetVMsClient.
func (*VirtualMachineScaleSetVMsClientMock) Get ¶
func (m *VirtualMachineScaleSetVMsClientMock) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result compute.VirtualMachineScaleSetVM, err error)
Get gets a VirtualMachineScaleSetVM by VMScaleSetName and instanceID.
func (*VirtualMachineScaleSetVMsClientMock) List ¶
func (m *VirtualMachineScaleSetVMsClientMock) List(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result []compute.VirtualMachineScaleSetVM, err error)
List gets a list of VirtualMachineScaleSetVMs.
type VirtualMachineScaleSetsClient ¶
type VirtualMachineScaleSetsClient interface { Get(ctx context.Context, resourceGroupName string, vmScaleSetName string) (result compute.VirtualMachineScaleSet, err error) CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, parameters compute.VirtualMachineScaleSet) (resp *http.Response, err error) DeleteInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs compute.VirtualMachineScaleSetVMInstanceRequiredIDs) (resp *http.Response, err error) List(ctx context.Context, resourceGroupName string) (result []compute.VirtualMachineScaleSet, err error) }
VirtualMachineScaleSetsClient defines needed functions for azure compute.VirtualMachineScaleSetsClient.
type VirtualMachineScaleSetsClientMock ¶
type VirtualMachineScaleSetsClientMock struct { mock.Mock FakeStore map[string]map[string]compute.VirtualMachineScaleSet // contains filtered or unexported fields }
VirtualMachineScaleSetsClientMock mocks for VirtualMachineScaleSetsClient.
func (*VirtualMachineScaleSetsClientMock) CreateOrUpdate ¶
func (client *VirtualMachineScaleSetsClientMock) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters compute.VirtualMachineScaleSet) (resp *http.Response, err error)
CreateOrUpdate creates or updates the VirtualMachineScaleSet.
func (*VirtualMachineScaleSetsClientMock) DeleteInstances ¶
func (client *VirtualMachineScaleSetsClientMock) DeleteInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs compute.VirtualMachineScaleSetVMInstanceRequiredIDs) (resp *http.Response, err error)
DeleteInstances deletes a set of instances for specified VirtualMachineScaleSet.
func (*VirtualMachineScaleSetsClientMock) Get ¶
func (client *VirtualMachineScaleSetsClientMock) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string) (result compute.VirtualMachineScaleSet, err error)
Get gets the VirtualMachineScaleSet by vmScaleSetName.
func (*VirtualMachineScaleSetsClientMock) List ¶
func (client *VirtualMachineScaleSetsClientMock) List(ctx context.Context, resourceGroupName string) (result []compute.VirtualMachineScaleSet, err error)
List gets a list of VirtualMachineScaleSets.
type VirtualMachinesClient ¶
type VirtualMachinesClient interface { Get(ctx context.Context, resourceGroupName string, VMName string, expand compute.InstanceViewTypes) (result compute.VirtualMachine, err error) Delete(ctx context.Context, resourceGroupName string, VMName string) (resp *http.Response, err error) List(ctx context.Context, resourceGroupName string) (result []compute.VirtualMachine, err error) }
VirtualMachinesClient defines needed functions for azure compute.VirtualMachinesClient.
type VirtualMachinesClientMock ¶
type VirtualMachinesClientMock struct { mock.Mock FakeStore map[string]map[string]compute.VirtualMachine // contains filtered or unexported fields }
VirtualMachinesClientMock mocks for VirtualMachinesClient.
func (*VirtualMachinesClientMock) Delete ¶
func (m *VirtualMachinesClientMock) Delete(ctx context.Context, resourceGroupName string, VMName string) (resp *http.Response, err error)
Delete deletes the VirtualMachine by VMName.
func (*VirtualMachinesClientMock) Get ¶
func (m *VirtualMachinesClientMock) Get(ctx context.Context, resourceGroupName string, VMName string, expand compute.InstanceViewTypes) (result compute.VirtualMachine, err error)
Get gets the VirtualMachine by VMName.
func (*VirtualMachinesClientMock) List ¶
func (m *VirtualMachinesClientMock) List(ctx context.Context, resourceGroupName string) (result []compute.VirtualMachine, err error)
List gets a lit of VirtualMachine inside the resource group.