Documentation ¶
Index ¶
- Constants
- Variables
- func BuildAzure(opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, ...) cloudprovider.CloudProvider
- func BuildAzureCloudProvider(azureManager *AzureManager, resourceLimiter *cloudprovider.ResourceLimiter) (cloudprovider.CloudProvider, error)
- func GetVMNameIndex(osType compute.OperatingSystemTypes, vmName string) (int, error)
- func ParseLabelAutoDiscoverySpecs(o cloudprovider.NodeGroupDiscoveryOptions) ([]labelAutoDiscoveryConfig, error)
- type AgentPool
- func (as *AgentPool) AtomicIncreaseSize(delta int) error
- func (as *AgentPool) Autoprovisioned() bool
- func (as *AgentPool) Belongs(node *apiv1.Node) (bool, error)
- func (as *AgentPool) Create() (cloudprovider.NodeGroup, 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) GetOptions(defaults config.NodeGroupAutoscalingOptions) (*config.NodeGroupAutoscalingOptions, error)
- func (as *AgentPool) GetVMIndexes() ([]int, map[int]string, 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() ([]cloudprovider.Instance, error)
- func (m *AgentPool) String() string
- func (as *AgentPool) TargetSize() (int, error)
- func (as *AgentPool) TemplateNodeInfo() (*schedulerframework.NodeInfo, error)
- type AzUtil
- type AzureCloudProvider
- func (azure *AzureCloudProvider) Cleanup() error
- func (azure *AzureCloudProvider) GPULabel() string
- func (azure *AzureCloudProvider) GetAvailableGPUTypes() map[string]struct{}
- func (azure *AzureCloudProvider) GetAvailableMachineTypes() ([]string, error)
- func (azure *AzureCloudProvider) GetNodeGpuConfig(node *apiv1.Node) *cloudprovider.GpuConfig
- func (azure *AzureCloudProvider) GetResourceLimiter() (*cloudprovider.ResourceLimiter, error)
- func (azure *AzureCloudProvider) HasInstance(*apiv1.Node) (bool, 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) GetNodeGroupForInstance(instance *azureRef) (cloudprovider.NodeGroup, error)
- func (m *AzureManager) GetScaleSetOptions(scaleSetName string, defaults config.NodeGroupAutoscalingOptions) *config.NodeGroupAutoscalingOptions
- func (m *AzureManager) Refresh() error
- func (m *AzureManager) RegisterNodeGroup(nodeGroup cloudprovider.NodeGroup) bool
- func (m *AzureManager) UnregisterNodeGroup(nodeGroup cloudprovider.NodeGroup) bool
- type CloudProviderRateLimitConfig
- type Config
- type DeploymentsClient
- type DeploymentsClientMock
- func (m *DeploymentsClientMock) CreateOrUpdate(ctx context.Context, resourceGroupName string, deploymentName string, ...) (resp *http.Response, err error)
- func (m *DeploymentsClientMock) Delete(ctx context.Context, resourceGroupName, deploymentName string) (resp *http.Response, err error)
- func (m *DeploymentsClientMock) ExportTemplate(ctx context.Context, resourceGroupName string, deploymentName string) (result resources.DeploymentExportResult, err error)
- func (m *DeploymentsClientMock) Get(ctx context.Context, resourceGroupName string, deploymentName string) (result resources.DeploymentExtended, err error)
- func (m *DeploymentsClientMock) List(ctx context.Context, resourceGroupName, filter string, top *int32) (result []resources.DeploymentExtended, err error)
- type InstanceType
- type ScaleSet
- func (scaleSet *ScaleSet) AtomicIncreaseSize(delta int) error
- func (scaleSet *ScaleSet) Autoprovisioned() bool
- func (scaleSet *ScaleSet) Belongs(node *apiv1.Node) (bool, error)
- func (scaleSet *ScaleSet) Create() (cloudprovider.NodeGroup, error)
- func (scaleSet *ScaleSet) Debug() string
- func (scaleSet *ScaleSet) DecreaseTargetSize(delta int) error
- func (scaleSet *ScaleSet) Delete() error
- func (scaleSet *ScaleSet) DeleteInstances(instances []*azureRef, hasUnregisteredNodes bool) error
- func (scaleSet *ScaleSet) DeleteNodes(nodes []*apiv1.Node) error
- func (scaleSet *ScaleSet) Exist() bool
- func (scaleSet *ScaleSet) GetFlexibleScaleSetVms() ([]compute.VirtualMachine, *retry.Error)
- func (m *ScaleSet) GetKey() string
- func (scaleSet *ScaleSet) GetOptions(defaults config.NodeGroupAutoscalingOptions) (*config.NodeGroupAutoscalingOptions, error)
- func (scaleSet *ScaleSet) GetScaleSetSize() (int64, error)
- func (scaleSet *ScaleSet) GetScaleSetVms() ([]compute.VirtualMachineScaleSetVM, *retry.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() ([]cloudprovider.Instance, error)
- func (scaleSet *ScaleSet) SetScaleSetSize(size int64) error
- func (m *ScaleSet) String() string
- func (scaleSet *ScaleSet) TargetSize() (int, error)
- func (scaleSet *ScaleSet) TemplateNodeInfo() (*schedulerframework.NodeInfo, error)
Constants ¶
const (
// GPULabel is the label added to nodes with GPU resource.
GPULabel = "accelerator"
)
Variables ¶
var GetVMSSTypeDynamically = func(template compute.VirtualMachineScaleSet, azCache *azureCache) (InstanceType, error) { ctx := context.Background() var vmssType InstanceType sku, err := azCache.GetSKU(ctx, *template.Sku.Name, *template.Location) if err != nil { promoRe := regexp.MustCompile(`(?i)_promo`) skuName := promoRe.ReplaceAllString(*template.Sku.Name, "") if skuName != *template.Sku.Name { klog.V(1).Infof("No exact match found for %q, checking standard type %q. Error %v", *template.Sku.Name, skuName, err) sku, err = azCache.GetSKU(ctx, skuName, *template.Location) } if err != nil { return vmssType, fmt.Errorf("instance type %q not supported. Error %v", *template.Sku.Name, err) } } vmssType.VCPU, err = sku.VCPU() if err != nil { klog.V(1).Infof("Failed to parse vcpu from sku %q %v", *template.Sku.Name, err) return vmssType, err } gpu, err := getGpuFromSku(sku) if err != nil { klog.V(1).Infof("Failed to parse gpu from sku %q %v", *template.Sku.Name, err) return vmssType, err } vmssType.GPU = gpu memoryGb, err := sku.Memory() if err != nil { klog.V(1).Infof("Failed to parse memoryMb from sku %q %v", *template.Sku.Name, err) return vmssType, err } vmssType.MemoryMb = int64(memoryGb) * 1024 return vmssType, nil }
GetVMSSTypeDynamically fetched vmss instance information using sku api calls. It is declared as a variable for testing purpose.
var GetVMSSTypeStatically = func(template compute.VirtualMachineScaleSet) (*InstanceType, error) { var vmssType *InstanceType for k := range InstanceTypes { if strings.EqualFold(k, *template.Sku.Name) { vmssType = InstanceTypes[k] break } } promoRe := regexp.MustCompile(`(?i)_promo`) if promoRe.MatchString(*template.Sku.Name) { if vmssType == nil { klog.V(4).Infof("No exact match found for %s, checking standard types", *template.Sku.Name) skuName := promoRe.ReplaceAllString(*template.Sku.Name, "") for k := range InstanceTypes { if strings.EqualFold(k, skuName) { vmssType = InstanceTypes[k] break } } } } if vmssType == nil { return vmssType, fmt.Errorf("instance type %q not supported", *template.Sku.Name) } return vmssType, nil }
GetVMSSTypeStatically uses static list of vmss generated at azure_instance_types.go to fetch vmss instance information. It is declared as a variable for testing purpose.
var InstanceTypes = map[string]*InstanceType{}/* 741 elements not displayed */
InstanceTypes is a map of azure resources
var ( // NvidiaEnabledSKUs represents a list of NVIDIA gpus. // If a new GPU sku becomes available, add a key to this map, but only if you have a confirmation // that we have an agreement with NVIDIA for this specific gpu. NvidiaEnabledSKUs = map[string]bool{ "standard_nc6": true, "standard_nc12": true, "standard_nc24": true, "standard_nc24r": true, "standard_nv6": true, "standard_nv12": true, "standard_nv12s_v3": true, "standard_nv24": true, "standard_nv24s_v3": true, "standard_nv24r": true, "standard_nv48s_v3": true, "standard_nd6s": true, "standard_nd12s": true, "standard_nd24s": true, "standard_nd24rs": true, "standard_nc6s_v2": true, "standard_nc12s_v2": true, "standard_nc24s_v2": true, "standard_nc24rs_v2": true, "standard_nc6s_v3": true, "standard_nc12s_v3": true, "standard_nc24s_v3": true, "standard_nc24rs_v3": true, "standard_nd40s_v3": true, "standard_nd40rs_v2": true, "standard_nc4as_t4_v3": true, "standard_nc8as_t4_v3": true, "standard_nc16as_t4_v3": true, "standard_nc64as_t4_v3": true, "standard_nd96asr_v4": true, "standard_nd112asr_a100_v4": true, "standard_nd120asr_a100_v4": true, "standard_nd96amsr_a100_v4": true, "standard_nd112amsr_a100_v4": true, "standard_nd120amsr_a100_v4": true, "standard_nc24ads_a100_v4": true, "standard_nc48ads_a100_v4": true, "standard_nc96ads_a100_v4": true, } )
Functions ¶
func BuildAzure ¶
func BuildAzure(opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, rl *cloudprovider.ResourceLimiter) cloudprovider.CloudProvider
BuildAzure builds Azure cloud provider, manager etc.
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.
func ParseLabelAutoDiscoverySpecs ¶
func ParseLabelAutoDiscoverySpecs(o cloudprovider.NodeGroupDiscoveryOptions) ([]labelAutoDiscoveryConfig, error)
ParseLabelAutoDiscoverySpecs returns any provided NodeGroupAutoDiscoverySpecs parsed into configuration appropriate for node group autodiscovery.
Types ¶
type AgentPool ¶
type AgentPool struct {
// contains filtered or unexported fields
}
AgentPool implements NodeGroup interface for agent pools deployed by aks-engine.
func NewAgentPool ¶
func NewAgentPool(spec *dynamic.NodeGroupSpec, az *AzureManager) (*AgentPool, error)
NewAgentPool creates a new AgentPool.
func (*AgentPool) AtomicIncreaseSize ¶
AtomicIncreaseSize is not implemented.
func (*AgentPool) Autoprovisioned ¶
Autoprovisioned returns true if the node group is autoprovisioned.
func (*AgentPool) Create ¶
func (as *AgentPool) Create() (cloudprovider.NodeGroup, error)
Create creates the node group on the cloud provider side.
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) GetOptions ¶
func (as *AgentPool) GetOptions(defaults config.NodeGroupAutoscalingOptions) (*config.NodeGroupAutoscalingOptions, error)
GetOptions returns NodeGroupAutoscalingOptions that should be used for this particular NodeGroup. Returning a nil will result in using default options.
func (*AgentPool) GetVMIndexes ¶
GetVMIndexes gets indexes of all virtual machines belonging to the agent pool.
func (*AgentPool) IncreaseSize ¶
IncreaseSize increases agent pool size
func (*AgentPool) Nodes ¶
func (as *AgentPool) Nodes() ([]cloudprovider.Instance, error)
Nodes returns a list of all nodes that belong to this node group.
func (*AgentPool) String ¶
func (m *AgentPool) String() string
String is represented by calling GetKey()
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() (*schedulerframework.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 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) GPULabel ¶
func (azure *AzureCloudProvider) GPULabel() string
GPULabel returns the label added to nodes with GPU resource.
func (*AzureCloudProvider) GetAvailableGPUTypes ¶
func (azure *AzureCloudProvider) GetAvailableGPUTypes() map[string]struct{}
GetAvailableGPUTypes return all available GPU types cloud provider supports
func (*AzureCloudProvider) GetAvailableMachineTypes ¶
func (azure *AzureCloudProvider) GetAvailableMachineTypes() ([]string, error)
GetAvailableMachineTypes get all machine types that can be requested from the cloud provider.
func (*AzureCloudProvider) GetNodeGpuConfig ¶
func (azure *AzureCloudProvider) GetNodeGpuConfig(node *apiv1.Node) *cloudprovider.GpuConfig
GetNodeGpuConfig returns the label, type and resource name for the GPU added to node. If node doesn't have any GPUs, it returns nil.
func (*AzureCloudProvider) GetResourceLimiter ¶
func (azure *AzureCloudProvider) GetResourceLimiter() (*cloudprovider.ResourceLimiter, error)
GetResourceLimiter returns struct containing limits (max, min) for resources (cores, memory etc.).
func (*AzureCloudProvider) HasInstance ¶
func (azure *AzureCloudProvider) HasInstance(*apiv1.Node) (bool, error)
HasInstance returns whether a given node has a corresponding instance in this cloud provider
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, taints []apiv1.Taint, 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) GetNodeGroupForInstance ¶
func (m *AzureManager) GetNodeGroupForInstance(instance *azureRef) (cloudprovider.NodeGroup, error)
GetNodeGroupForInstance returns the NodeGroup of the given Instance
func (*AzureManager) GetScaleSetOptions ¶
func (m *AzureManager) GetScaleSetOptions(scaleSetName string, defaults config.NodeGroupAutoscalingOptions) *config.NodeGroupAutoscalingOptions
GetScaleSetOptions parse options extracted from VMSS tags and merges them with provided defaults
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) RegisterNodeGroup ¶
func (m *AzureManager) RegisterNodeGroup(nodeGroup cloudprovider.NodeGroup) bool
RegisterNodeGroup registers an a NodeGroup.
func (*AzureManager) UnregisterNodeGroup ¶
func (m *AzureManager) UnregisterNodeGroup(nodeGroup cloudprovider.NodeGroup) bool
UnregisterNodeGroup unregisters a NodeGroup.
type CloudProviderRateLimitConfig ¶
type CloudProviderRateLimitConfig struct { // The default rate limit config options. azclients.RateLimitConfig // Rate limit config for each clients. Values would override default settings above. InterfaceRateLimit *azclients.RateLimitConfig `json:"interfaceRateLimit,omitempty" yaml:"interfaceRateLimit,omitempty"` VirtualMachineRateLimit *azclients.RateLimitConfig `json:"virtualMachineRateLimit,omitempty" yaml:"virtualMachineRateLimit,omitempty"` StorageAccountRateLimit *azclients.RateLimitConfig `json:"storageAccountRateLimit,omitempty" yaml:"storageAccountRateLimit,omitempty"` DiskRateLimit *azclients.RateLimitConfig `json:"diskRateLimit,omitempty" yaml:"diskRateLimit,omitempty"` VirtualMachineScaleSetRateLimit *azclients.RateLimitConfig `json:"virtualMachineScaleSetRateLimit,omitempty" yaml:"virtualMachineScaleSetRateLimit,omitempty"` KubernetesServiceRateLimit *azclients.RateLimitConfig `json:"kubernetesServiceRateLimit,omitempty" yaml:"kubernetesServiceRateLimit,omitempty"` }
CloudProviderRateLimitConfig indicates the rate limit config for each clients.
type Config ¶
type Config struct { CloudProviderRateLimitConfig Cloud string `json:"cloud" yaml:"cloud"` Location string `json:"location" yaml:"location"` TenantID string `json:"tenantId" yaml:"tenantId"` SubscriptionID string `json:"subscriptionId" yaml:"subscriptionId"` ResourceGroup string `json:"resourceGroup" yaml:"resourceGroup"` VMType string `json:"vmType" yaml:"vmType"` // AuthMethod determines how to authorize requests for the Azure // cloud. Valid options are "principal" (= the traditional // service principle approach) and "cli" (= load az command line // config file). The default is "principal". AuthMethod string `json:"authMethod" yaml:"authMethod"` AADClientID string `json:"aadClientId" yaml:"aadClientId"` AADClientSecret string `json:"aadClientSecret" yaml:"aadClientSecret"` AADClientCertPath string `json:"aadClientCertPath" yaml:"aadClientCertPath"` AADClientCertPassword string `json:"aadClientCertPassword" yaml:"aadClientCertPassword"` AADFederatedTokenFile string `json:"aadFederatedTokenFile" yaml:"aadFederatedTokenFile"` UseManagedIdentityExtension bool `json:"useManagedIdentityExtension" yaml:"useManagedIdentityExtension"` UseWorkloadIdentityExtension bool `json:"useWorkloadIdentityExtension" yaml:"useWorkloadIdentityExtension"` UserAssignedIdentityID string `json:"userAssignedIdentityID" yaml:"userAssignedIdentityID"` // Configs only for standard vmType (agent pools). Deployment string `json:"deployment" yaml:"deployment"` DeploymentParameters map[string]interface{} `json:"deploymentParameters" yaml:"deploymentParameters"` // VMSS metadata cache TTL in seconds, only applies for vmss type VmssCacheTTL int64 `json:"vmssCacheTTL" yaml:"vmssCacheTTL"` // VMSS instances cache TTL in seconds, only applies for vmss type VmssVmsCacheTTL int64 `json:"vmssVmsCacheTTL" yaml:"vmssVmsCacheTTL"` // Jitter in seconds subtracted from the VMSS cache TTL before the first refresh VmssVmsCacheJitter int `json:"vmssVmsCacheJitter" yaml:"vmssVmsCacheJitter"` // number of latest deployments that will not be deleted MaxDeploymentsCount int64 `json:"maxDeploymentsCount" yaml:"maxDeploymentsCount"` // Enable exponential backoff to manage resource request retries CloudProviderBackoff bool `json:"cloudProviderBackoff,omitempty" yaml:"cloudProviderBackoff,omitempty"` CloudProviderBackoffRetries int `json:"cloudProviderBackoffRetries,omitempty" yaml:"cloudProviderBackoffRetries,omitempty"` CloudProviderBackoffExponent float64 `json:"cloudProviderBackoffExponent,omitempty" yaml:"cloudProviderBackoffExponent,omitempty"` CloudProviderBackoffDuration int `json:"cloudProviderBackoffDuration,omitempty" yaml:"cloudProviderBackoffDuration,omitempty"` CloudProviderBackoffJitter float64 `json:"cloudProviderBackoffJitter,omitempty" yaml:"cloudProviderBackoffJitter,omitempty"` // EnableForceDelete defines whether to enable force deletion on the APIs EnableForceDelete bool `json:"enableForceDelete,omitempty" yaml:"enableForceDelete,omitempty"` // EnableDynamicInstanceList defines whether to enable dynamic instance workflow for instance information check EnableDynamicInstanceList bool `json:"enableDynamicInstanceList,omitempty" yaml:"enableDynamicInstanceList,omitempty"` // EnableVmssFlex defines whether to enable Vmss Flex support or not EnableVmssFlex bool `json:"enableVmssFlex,omitempty" yaml:"enableVmssFlex,omitempty"` }
Config holds the configuration parsed from the --cloud-config flag
func BuildAzureConfig ¶
BuildAzureConfig returns a Config object for the Azure clients
type DeploymentsClient ¶
type DeploymentsClient interface { Get(ctx context.Context, resourceGroupName string, deploymentName string) (result resources.DeploymentExtended, err error) List(ctx context.Context, resourceGroupName string, filter string, top *int32) (result []resources.DeploymentExtended, err error) ExportTemplate(ctx context.Context, resourceGroupName string, deploymentName string) (result resources.DeploymentExportResult, err error) CreateOrUpdate(ctx context.Context, resourceGroupName string, deploymentName string, parameters resources.Deployment) (resp *http.Response, err error) Delete(ctx context.Context, resourceGroupName string, deploymentName string) (resp *http.Response, err 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(ctx context.Context, resourceGroupName string, deploymentName string, parameters resources.Deployment) (resp *http.Response, err error)
CreateOrUpdate creates or updates the Deployment.
func (*DeploymentsClientMock) Delete ¶
func (m *DeploymentsClientMock) Delete(ctx context.Context, resourceGroupName, deploymentName string) (resp *http.Response, err error)
Delete deletes the given deployment
func (*DeploymentsClientMock) ExportTemplate ¶
func (m *DeploymentsClientMock) ExportTemplate(ctx context.Context, resourceGroupName string, deploymentName string) (result resources.DeploymentExportResult, err error)
ExportTemplate exports the deployment's template.
func (*DeploymentsClientMock) Get ¶
func (m *DeploymentsClientMock) Get(ctx context.Context, resourceGroupName string, deploymentName string) (result resources.DeploymentExtended, err error)
Get gets the DeploymentExtended by deploymentName.
func (*DeploymentsClientMock) List ¶
func (m *DeploymentsClientMock) List(ctx context.Context, resourceGroupName, filter string, top *int32) (result []resources.DeploymentExtended, err error)
List gets all the deployments for a resource group.
type InstanceType ¶
type InstanceType struct { InstanceType string SkuFamily string VCPU int64 MemoryMb int64 GPU int64 }
InstanceType is the sepc of Azure instance
type ScaleSet ¶
type ScaleSet struct {
// contains filtered or unexported fields
}
ScaleSet implements NodeGroup interface.
func NewScaleSet ¶
func NewScaleSet(spec *dynamic.NodeGroupSpec, az *AzureManager, curSize int64) (*ScaleSet, error)
NewScaleSet creates a new NewScaleSet.
func (*ScaleSet) AtomicIncreaseSize ¶
AtomicIncreaseSize is not implemented.
func (*ScaleSet) Autoprovisioned ¶
Autoprovisioned returns true if the node group is autoprovisioned.
func (*ScaleSet) Create ¶
func (scaleSet *ScaleSet) Create() (cloudprovider.NodeGroup, error)
Create creates the node group on the cloud provider side.
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) GetFlexibleScaleSetVms ¶
func (scaleSet *ScaleSet) GetFlexibleScaleSetVms() ([]compute.VirtualMachine, *retry.Error)
GetFlexibleScaleSetVms returns list of nodes for flexible scale set.
func (*ScaleSet) GetKey ¶
func (m *ScaleSet) GetKey() string
GetKey returns key of the given azure reference.
func (*ScaleSet) GetOptions ¶
func (scaleSet *ScaleSet) GetOptions(defaults config.NodeGroupAutoscalingOptions) (*config.NodeGroupAutoscalingOptions, error)
GetOptions returns NodeGroupAutoscalingOptions that should be used for this particular NodeGroup. Returning a nil will result in using default options.
func (*ScaleSet) GetScaleSetSize ¶
GetScaleSetSize gets Scale Set size.
func (*ScaleSet) GetScaleSetVms ¶
func (scaleSet *ScaleSet) GetScaleSetVms() ([]compute.VirtualMachineScaleSetVM, *retry.Error)
GetScaleSetVms returns list of nodes for the given scale set.
func (*ScaleSet) IncreaseSize ¶
IncreaseSize increases Scale Set size
func (*ScaleSet) Nodes ¶
func (scaleSet *ScaleSet) Nodes() ([]cloudprovider.Instance, error)
Nodes returns a list of all nodes that belong to this node group.
func (*ScaleSet) SetScaleSetSize ¶
SetScaleSetSize sets ScaleSet size.
func (*ScaleSet) String ¶
func (m *ScaleSet) String() string
String is represented by calling GetKey()
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() (*schedulerframework.NodeInfo, error)
TemplateNodeInfo returns a node template for this scale set.