azure

package
v3.11.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2018 License: Apache-2.0 Imports: 39 Imported by: 0

README

Cluster Autoscaler on Azure

The cluster autoscaler on Azure scales worker nodes within any specified autoscaling group. It will run as a Kubernetes deployment in your cluster. This README will go over some of the necessary steps required to get the cluster autoscaler up and running.

Kubernetes Version

Cluster autoscaler support two VM types with Azure cloud provider:

  • vmss: For kubernetes cluster running on VMSS instances. Azure cloud provider's vmType parameter must be configured as 'vmss'. It requires Kubernetes with Azure VMSS support (kubernetes#43287), which is planed in Kubernetes v1.10.
  • standard: For kubernetes cluster running on VMAS instances. Azure cloud provider's vmType parameter must be configured as 'standard'. It only supports Kubernetes cluster deployed via acs-engine. And useInstanceMetadata should be set to false for all nodes.

Permissions

Get azure credentials by running the following command

# replace <subscription-id> with yours.
az ad sp create-for-rbac --role="Contributor" --scopes="/subscriptions/<subscription-id>" --output json

Deployment manifests

VMSS deployment

Pre-requirements:

  • Get credentials from above permissions step.
  • Get the scale set name which is used for nodes scaling.
  • Encode each data with base64.

Fill the values of cluster-autoscaler-azure secret in cluster-autoscaler-vmss.yaml, including

  • ClientID: <base64-encoded-client-id>
  • ClientSecret: <base64-encoded-client-secret>
  • ResourceGroup: <base64-encoded-resource-group>
  • SubscriptionID: <base64-encode-subscription-id>
  • TenantID: <base64-encoded-tenant-id>

Note that all data above should be encoded with base64.

And fill the node groups in container command by --nodes, e.g.

        - --nodes=1:10:vmss1

or multiple node groups:

        - --nodes=1:10:vmss1
        - --nodes=1:10:vmss2

Then deploy cluster-autoscaler by running

kubectl create -f cluster-autoscaler-vmss.yaml

To run a CA pod in master node - CA deployment should tolerate the master taint and nodeSelector should be used to schedule the pods in master node.

kubectl create -f cluster-autoscaler-vmss-master.yaml
Standard deployment

Pre-requirements:

  • Get credentials from above permissions step.
  • Get the initial Azure deployment name from azure portal. If you have multiple deployments (e.g. have run acs-engine scale command), make sure to get the first one.
  • Get a node pool name for nodes scaling from acs-engine deployment manifests
  • Encode each data with base64.

Fill the values of cluster-autoscaler-azure secret in cluster-autoscaler-standard-master.yaml, including

  • ClientID: <base64-encoded-client-id>
  • ClientSecret: <base64-encoded-client-secret>
  • ResourceGroup: <base64-encoded-resource-group>
  • SubscriptionID: <base64-encode-subscription-id>
  • TenantID: <base64-encoded-tenant-id>
  • Deployment: <base64-encoded-azure-initial-deploy-name>

Note that all data above should be encoded with base64.

And fill the node groups in container command by --nodes, e.g.

        - --nodes=1:10:agentpool1

or multiple node groups:

        - --nodes=1:10:agentpool1
        - --nodes=1:10:agentpool2

Create Azure deploy parameters secret cluster-autoscaler-azure-deploy-parameters by running

kubectl -n kube-system create secret generic cluster-autoscaler-azure-deploy-parameters --from-file=deploy-parameters=./_output/<your-output-path>/azuredeploy.parameters.json

Then deploy cluster-autoscaler by running

kubectl create -f cluster-autoscaler-standard-master.yaml

Documentation

Index

Constants

View Source
const (
	// ProviderName is the cloud provider name for Azure
	ProviderName = "azure"
)

Variables

This section is empty.

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

type AccountsClientMock struct {
	mock.Mock
}

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

func (as *AgentPool) Autoprovisioned() bool

Autoprovisioned returns true if the node group is autoprovisioned.

func (*AgentPool) Belongs

func (as *AgentPool) Belongs(node *apiv1.Node) (bool, error)

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

func (*AgentPool) Create

func (as *AgentPool) Create() error

Create creates the node group on the cloud provider side.

func (*AgentPool) Debug

func (as *AgentPool) Debug() string

Debug returns a debug string for the agent pool.

func (*AgentPool) DecreaseTargetSize

func (as *AgentPool) 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 (*AgentPool) Delete

func (as *AgentPool) Delete() error

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

func (as *AgentPool) DeleteInstances(instances []*azureRef) error

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

func (*AgentPool) DeleteNodes

func (as *AgentPool) DeleteNodes(nodes []*apiv1.Node) error

DeleteNodes deletes the nodes from the group.

func (*AgentPool) Exist

func (as *AgentPool) Exist() bool

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

func (as *AgentPool) GetVMIndexes() ([]int, map[int]string, error)

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) Id

func (as *AgentPool) Id() string

Id returns AgentPool id.

func (*AgentPool) IncreaseSize

func (as *AgentPool) IncreaseSize(delta int) error

IncreaseSize increases agent pool size

func (*AgentPool) MaxSize

func (as *AgentPool) MaxSize() int

MaxSize returns maximum size of the node group.

func (*AgentPool) MinSize

func (as *AgentPool) MinSize() int

MinSize returns minimum size of the node group.

func (*AgentPool) Nodes

func (as *AgentPool) Nodes() ([]string, error)

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

func (*AgentPool) TargetSize

func (as *AgentPool) 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 Kubernetes.

func (*AgentPool) TemplateNodeInfo

func (as *AgentPool) TemplateNodeInfo() (*schedulercache.NodeInfo, error)

TemplateNodeInfo returns a node template for this agent pool.

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

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) Cleanup

func (m *AzureManager) Cleanup()

Cleanup the ASG cache.

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"`
}

Config holds the configuration parsed from the --cloud-config flag

func (*Config) TrimSpace

func (c *Config) TrimSpace()

TrimSpace removes all leading and trailing white spaces.

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

type DisksClientMock struct {
	mock.Mock
}

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

type InterfacesClientMock struct {
	mock.Mock
}

InterfacesClientMock mocks for InterfacesClient.

func (*InterfacesClientMock) Delete

func (m *InterfacesClientMock) Delete(resourceGroupName string, networkInterfaceName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error)

Delete deletes the interface by networkInterfaceName.

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

func (scaleSet *ScaleSet) Autoprovisioned() bool

Autoprovisioned returns true if the node group is autoprovisioned.

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) Create

func (scaleSet *ScaleSet) Create() error

Create creates the node group on the cloud provider side.

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) Delete

func (scaleSet *ScaleSet) Delete() error

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

func (scaleSet *ScaleSet) DeleteInstances(instances []*azureRef) error

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

func (*ScaleSet) DeleteNodes

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

DeleteNodes deletes the nodes from the group.

func (*ScaleSet) Exist

func (scaleSet *ScaleSet) Exist() bool

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

func (scaleSet *ScaleSet) GetScaleSetSize() (int64, error)

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) 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) SetScaleSetSize

func (scaleSet *ScaleSet) SetScaleSetSize(size int64) error

SetScaleSetSize sets ScaleSet size.

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 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(resourceGroupName string, VMScaleSetName string, instanceID string) (result compute.VirtualMachineScaleSetVM, err error)
	List(resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result compute.VirtualMachineScaleSetVMListResult, err error)
	ListNextResults(lastResults compute.VirtualMachineScaleSetVMListResult) (result compute.VirtualMachineScaleSetVMListResult, err error)
}

VirtualMachineScaleSetVMsClient defines needed functions for azure compute.VirtualMachineScaleSetVMsClient.

type VirtualMachineScaleSetVMsClientMock

type VirtualMachineScaleSetVMsClientMock struct {
	mock.Mock
}

VirtualMachineScaleSetVMsClientMock mocks for VirtualMachineScaleSetVMsClient.

func (*VirtualMachineScaleSetVMsClientMock) Get

func (m *VirtualMachineScaleSetVMsClientMock) Get(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(resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result compute.VirtualMachineScaleSetVMListResult, err error)

List gets a list of VirtualMachineScaleSetVMs.

func (*VirtualMachineScaleSetVMsClientMock) ListNextResults

ListNextResults gets more results from previous VirtualMachineScaleSetVMListResult.

type VirtualMachineScaleSetsClient

type VirtualMachineScaleSetsClient interface {
	Get(resourceGroupName string, vmScaleSetName string) (result compute.VirtualMachineScaleSet, err error)
	CreateOrUpdate(resourceGroupName string, name string, parameters compute.VirtualMachineScaleSet, cancel <-chan struct{}) (<-chan compute.VirtualMachineScaleSet, <-chan error)
	DeleteInstances(resourceGroupName string, vmScaleSetName string, vmInstanceIDs compute.VirtualMachineScaleSetVMInstanceRequiredIDs, cancel <-chan struct{}) (<-chan compute.OperationStatusResponse, <-chan error)
	List(resourceGroupName string) (result compute.VirtualMachineScaleSetListResult, err error)
	ListNextResults(lastResults compute.VirtualMachineScaleSetListResult) (result compute.VirtualMachineScaleSetListResult, 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(resourceGroupName string, VMScaleSetName string, parameters compute.VirtualMachineScaleSet, cancel <-chan struct{}) (<-chan compute.VirtualMachineScaleSet, <-chan error)

CreateOrUpdate creates or updates the VirtualMachineScaleSet.

func (*VirtualMachineScaleSetsClientMock) DeleteInstances

func (client *VirtualMachineScaleSetsClientMock) DeleteInstances(resourceGroupName string, vmScaleSetName string,
	vmInstanceIDs compute.VirtualMachineScaleSetVMInstanceRequiredIDs, cancel <-chan struct{}) (<-chan compute.OperationStatusResponse, <-chan error)

DeleteInstances deletes a set of instances for specified VirtualMachineScaleSet.

func (*VirtualMachineScaleSetsClientMock) Get

func (client *VirtualMachineScaleSetsClientMock) Get(resourceGroupName string,
	vmScaleSetName string) (result compute.VirtualMachineScaleSet, err error)

Get gets the VirtualMachineScaleSet by vmScaleSetName.

func (*VirtualMachineScaleSetsClientMock) List

func (client *VirtualMachineScaleSetsClientMock) List(resourceGroupName string) (result compute.VirtualMachineScaleSetListResult, err error)

List gets a list of VirtualMachineScaleSets.

func (*VirtualMachineScaleSetsClientMock) ListNextResults

ListNextResults gets more results of VirtualMachineScaleSets.

type VirtualMachinesClient

type VirtualMachinesClient interface {
	Get(resourceGroupName string, VMName string, expand compute.InstanceViewTypes) (result compute.VirtualMachine, err error)
	Delete(resourceGroupName string, VMName string, cancel <-chan struct{}) (<-chan compute.OperationStatusResponse, <-chan error)
	List(resourceGroupName string) (result compute.VirtualMachineListResult, err error)
	ListNextResults(lastResults compute.VirtualMachineListResult) (result compute.VirtualMachineListResult, 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) CreateOrUpdate

func (m *VirtualMachinesClientMock) CreateOrUpdate(resourceGroupName string, VMName string, parameters compute.VirtualMachine, cancel <-chan struct{}) (<-chan compute.VirtualMachine, <-chan error)

CreateOrUpdate creates or updates the VirtualMachine.

func (*VirtualMachinesClientMock) Delete

func (m *VirtualMachinesClientMock) Delete(resourceGroupName string, VMName string, cancel <-chan struct{}) (<-chan compute.OperationStatusResponse, <-chan error)

Delete deletes the VirtualMachine by VMName.

func (*VirtualMachinesClientMock) Get

func (m *VirtualMachinesClientMock) Get(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(resourceGroupName string) (result compute.VirtualMachineListResult, err error)

List gets a lit of VirtualMachine inside the resource group.

func (*VirtualMachinesClientMock) ListNextResults

ListNextResults gets more results from previous VirtualMachineListResult.

Jump to

Keyboard shortcuts

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