Documentation
¶
Overview ¶
Package provider is an implementation of CloudProvider Interface, LoadBalancer and Instances for Azure.
Index ¶
- Constants
- Variables
- func ConvertTagsToMap(tags string) (map[string]string, error)
- func InitializeCloudProviderRateLimitConfig(config *CloudProviderRateLimitConfig)
- func MakeCRC32(str string) string
- func NewCloud(configReader io.Reader) (cloudprovider.Interface, error)
- type AccountOptions
- type AttachDiskOptions
- type BlobDiskController
- func (c *BlobDiskController) CreateBlobDisk(dataDiskName string, storageAccountType storage.SkuName, sizeGB int) (string, error)
- func (c *BlobDiskController) CreateVolume(blobName, accountName, accountType, location string, requestGB int) (string, string, int, error)
- func (c *BlobDiskController) DeleteBlobDisk(diskURI string) error
- func (c *BlobDiskController) DeleteVolume(diskURI string) error
- type Cloud
- func (az *Cloud) AddSSHKeyToAllInstances(ctx context.Context, user string, keyData []byte) error
- func (az *Cloud) AddStorageAccountTags(resourceGroup, account string, tags map[string]*string) *retry.Error
- func (az *Cloud) AliasRangesByProviderID(id string) ([]string, error)
- func (c Cloud) AttachDisk(isManagedDisk bool, diskName, diskURI string, nodeName types.NodeName, ...) (int32, error)
- func (az *Cloud) Clusters() (cloudprovider.Clusters, bool)
- func (az *Cloud) CreateFileShare(accountOptions *AccountOptions, shareOptions *fileclient.ShareOptions) (string, string, error)
- func (az *Cloud) CreateOrUpdateInterface(service *v1.Service, nic network.Interface) error
- func (az *Cloud) CreateOrUpdateLB(service *v1.Service, lb network.LoadBalancer) error
- func (az *Cloud) CreateOrUpdatePIP(service *v1.Service, pipResourceGroup string, pip network.PublicIPAddress) error
- func (az *Cloud) CreateOrUpdateRoute(route network.Route) error
- func (az *Cloud) CreateOrUpdateRouteTable(routeTable network.RouteTable) error
- func (az *Cloud) CreateOrUpdateSecurityGroup(sg network.SecurityGroup) error
- func (az *Cloud) CreateOrUpdateVMSS(resourceGroupName string, VMScaleSetName string, ...) *retry.Error
- func (az *Cloud) CreateRoute(ctx context.Context, clusterName string, nameHint string, ...) error
- func (az *Cloud) CurrentNodeName(ctx context.Context, hostname string) (types.NodeName, error)
- func (az *Cloud) DeleteFileShare(resourceGroup, accountName, shareName string) error
- func (az *Cloud) DeleteLB(service *v1.Service, lbName string) error
- func (az *Cloud) DeletePublicIP(service *v1.Service, pipResourceGroup string, pipName string) error
- func (az *Cloud) DeleteRoute(ctx context.Context, clusterName string, kubeRoute *cloudprovider.Route) error
- func (az *Cloud) DeleteRouteWithName(routeName string) error
- func (c Cloud) DetachDisk(diskName, diskURI string, nodeName types.NodeName) error
- func (c Cloud) DisksAreAttached(diskNames []string, nodeName types.NodeName) (map[string]bool, error)
- func (az *Cloud) EnsureLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error)
- func (az *Cloud) EnsureLoadBalancerDeleted(ctx context.Context, clusterName string, service *v1.Service) error
- func (az *Cloud) EnsureStorageAccount(accountOptions *AccountOptions, genAccountNamePrefix string) (string, string, error)
- func (az *Cloud) Event(obj runtime.Object, eventType, reason, message string)
- func (az *Cloud) GetActiveZones() (sets.String, error)
- func (c *Cloud) GetAzureDiskLabels(diskURI string) (map[string]string, error)
- func (c Cloud) GetDiskLun(diskName, diskURI string, nodeName types.NodeName) (int32, error)
- func (az *Cloud) GetFileShare(resourceGroupName, accountName, name string) (storage.FileShare, error)
- func (az *Cloud) GetIPForMachineWithRetry(name types.NodeName) (string, string, error)
- func (c *Cloud) GetLabelsForVolume(ctx context.Context, pv *v1.PersistentVolume) (map[string]string, error)
- func (az *Cloud) GetLoadBalancer(ctx context.Context, clusterName string, service *v1.Service) (status *v1.LoadBalancerStatus, exists bool, err error)
- func (az *Cloud) GetLoadBalancerName(ctx context.Context, clusterName string, service *v1.Service) string
- func (az *Cloud) GetLocation() string
- func (az *Cloud) GetNodeResourceGroup(nodeName string) (string, error)
- func (az *Cloud) GetResourceGroups() (sets.String, error)
- func (az *Cloud) GetStorageAccesskey(account, resourceGroup string) (string, error)
- func (az *Cloud) GetUnmanagedNodes() (sets.String, error)
- func (az *Cloud) GetVirtualMachineWithRetry(name types.NodeName, crt azcache.AzureCacheReadType) (compute.VirtualMachine, error)
- func (az *Cloud) GetZone(ctx context.Context) (cloudprovider.Zone, error)
- func (az *Cloud) GetZoneByNodeName(ctx context.Context, nodeName types.NodeName) (cloudprovider.Zone, error)
- func (az *Cloud) GetZoneByProviderID(ctx context.Context, providerID string) (cloudprovider.Zone, error)
- func (az *Cloud) GetZoneID(zoneLabel string) string
- func (az *Cloud) HasClusterID() bool
- func (az *Cloud) Initialize(clientBuilder cloudprovider.ControllerClientBuilder, stop <-chan struct{})
- func (az *Cloud) InitializeCloudFromConfig(config *Config, fromSecret bool) error
- func (az *Cloud) InitializeCloudFromSecret()
- func (az *Cloud) InstanceExists(ctx context.Context, node *v1.Node) (bool, error)
- func (az *Cloud) InstanceExistsByProviderID(ctx context.Context, providerID string) (bool, error)
- func (az *Cloud) InstanceID(ctx context.Context, name types.NodeName) (string, error)
- func (az *Cloud) InstanceMetadata(ctx context.Context, node *v1.Node) (*cloudprovider.InstanceMetadata, error)
- func (az *Cloud) InstanceShutdown(ctx context.Context, node *v1.Node) (bool, error)
- func (az *Cloud) InstanceShutdownByProviderID(ctx context.Context, providerID string) (bool, error)
- func (az *Cloud) InstanceType(ctx context.Context, name types.NodeName) (string, error)
- func (az *Cloud) InstanceTypeByProviderID(ctx context.Context, providerID string) (string, error)
- func (az *Cloud) Instances() (cloudprovider.Instances, bool)
- func (az *Cloud) InstancesV2() (cloudprovider.InstancesV2, bool)
- func (az *Cloud) IsNodeUnmanaged(nodeName string) (bool, error)
- func (az *Cloud) IsNodeUnmanagedByProviderID(providerID string) bool
- func (az *Cloud) ListLB(service *v1.Service) ([]network.LoadBalancer, error)
- func (az *Cloud) ListPIP(service *v1.Service, pipResourceGroup string) ([]network.PublicIPAddress, error)
- func (az *Cloud) ListRoutes(ctx context.Context, clusterName string) ([]*cloudprovider.Route, error)
- func (az *Cloud) ListVirtualMachines(resourceGroup string) ([]compute.VirtualMachine, error)
- func (az *Cloud) LoadBalancer() (cloudprovider.LoadBalancer, bool)
- func (az *Cloud) NodeAddresses(ctx context.Context, name types.NodeName) ([]v1.NodeAddress, error)
- func (az *Cloud) NodeAddressesByProviderID(ctx context.Context, providerID string) ([]v1.NodeAddress, error)
- func (az *Cloud) ProviderName() string
- func (az *Cloud) RemoveStorageAccountTag(resourceGroup, account, key string) *retry.Error
- func (az *Cloud) RequestBackoff() (resourceRequestBackoff wait.Backoff)
- func (az *Cloud) ResizeFileShare(resourceGroup, accountName, name string, sizeGiB int) error
- func (az *Cloud) Routes() (cloudprovider.Routes, bool)
- func (c Cloud) SetDiskLun(nodeName types.NodeName, diskURI string, diskMap map[string]*AttachDiskOptions) (int32, error)
- func (az *Cloud) SetInformers(informerFactory informers.SharedInformerFactory)
- func (az *Cloud) ShouldNodeExcludedFromLoadBalancer(node *v1.Node) bool
- func (az *Cloud) UpdateLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node) error
- func (az *Cloud) Zones() (cloudprovider.Zones, bool)
- type CloudProviderRateLimitConfig
- type ComputeMetadata
- type Config
- type IPAddress
- type InstanceMetadata
- type InstanceMetadataService
- type ManagedDiskController
- func (c *ManagedDiskController) CreateManagedDisk(options *ManagedDiskOptions) (string, error)
- func (c *ManagedDiskController) DeleteManagedDisk(diskURI string) error
- func (c *ManagedDiskController) GetDisk(resourceGroup, diskName string) (string, string, error)
- func (c *ManagedDiskController) ResizeDisk(diskURI string, oldSize resource.Quantity, newSize resource.Quantity) (resource.Quantity, error)
- type ManagedDiskOptions
- type MockVMSet
- func (m *MockVMSet) AttachDisk(nodeName types.NodeName, diskMap map[string]*AttachDiskOptions) error
- func (m *MockVMSet) DetachDisk(nodeName types.NodeName, diskMap map[string]string) error
- func (m *MockVMSet) EXPECT() *MockVMSetMockRecorder
- func (m *MockVMSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoolID, vmSetName string, ...) error
- func (m *MockVMSet) EnsureHostInPool(service *v1.Service, nodeName types.NodeName, backendPoolID, vmSetName string, ...) (string, string, string, *compute.VirtualMachineScaleSetVM, error)
- func (m *MockVMSet) EnsureHostsInPool(service *v1.Service, nodes []*v1.Node, backendPoolID, vmSetName string, ...) error
- func (m *MockVMSet) GetDataDisks(nodeName types.NodeName, string cache.AzureCacheReadType) ([]compute.DataDisk, error)
- func (m *MockVMSet) GetIPByNodeName(name string) (string, string, error)
- func (m *MockVMSet) GetInstanceIDByNodeName(name string) (string, error)
- func (m *MockVMSet) GetInstanceTypeByNodeName(name string) (string, error)
- func (m *MockVMSet) GetNodeNameByIPConfigurationID(ipConfigurationID string) (string, string, error)
- func (m *MockVMSet) GetNodeNameByProviderID(providerID string) (types.NodeName, error)
- func (m *MockVMSet) GetPowerStatusByNodeName(name string) (string, error)
- func (m *MockVMSet) GetPrimaryInterface(nodeName string) (network.Interface, error)
- func (m *MockVMSet) GetPrimaryVMSetName() string
- func (m *MockVMSet) GetPrivateIPsByNodeName(name string) ([]string, error)
- func (m *MockVMSet) GetVMSetNames(service *v1.Service, nodes []*v1.Node) (*[]string, error)
- func (m *MockVMSet) GetZoneByNodeName(name string) (cloudprovider.Zone, error)
- type MockVMSetMockRecorder
- func (mr *MockVMSetMockRecorder) AttachDisk(nodeName, diskMap interface{}) *gomock.Call
- func (mr *MockVMSetMockRecorder) DetachDisk(nodeName, diskMap interface{}) *gomock.Call
- func (mr *MockVMSetMockRecorder) EnsureBackendPoolDeleted(service, backendPoolID, vmSetName, backendAddressPools interface{}) *gomock.Call
- func (mr *MockVMSetMockRecorder) EnsureHostInPool(service, nodeName, backendPoolID, vmSetName, isInternal interface{}) *gomock.Call
- func (mr *MockVMSetMockRecorder) EnsureHostsInPool(service, nodes, backendPoolID, vmSetName, isInternal interface{}) *gomock.Call
- func (mr *MockVMSetMockRecorder) GetDataDisks(nodeName, string interface{}) *gomock.Call
- func (mr *MockVMSetMockRecorder) GetIPByNodeName(name interface{}) *gomock.Call
- func (mr *MockVMSetMockRecorder) GetInstanceIDByNodeName(name interface{}) *gomock.Call
- func (mr *MockVMSetMockRecorder) GetInstanceTypeByNodeName(name interface{}) *gomock.Call
- func (mr *MockVMSetMockRecorder) GetNodeNameByIPConfigurationID(ipConfigurationID interface{}) *gomock.Call
- func (mr *MockVMSetMockRecorder) GetNodeNameByProviderID(providerID interface{}) *gomock.Call
- func (mr *MockVMSetMockRecorder) GetPowerStatusByNodeName(name interface{}) *gomock.Call
- func (mr *MockVMSetMockRecorder) GetPrimaryInterface(nodeName interface{}) *gomock.Call
- func (mr *MockVMSetMockRecorder) GetPrimaryVMSetName() *gomock.Call
- func (mr *MockVMSetMockRecorder) GetPrivateIPsByNodeName(name interface{}) *gomock.Call
- func (mr *MockVMSetMockRecorder) GetVMSetNames(service, nodes interface{}) *gomock.Call
- func (mr *MockVMSetMockRecorder) GetZoneByNodeName(name interface{}) *gomock.Call
- type NetworkData
- type NetworkInterface
- type NetworkMetadata
- type Subnet
- type VMSet
Constants ¶
const ( // CloudProviderName is the value used for the --cloud-provider flag CloudProviderName = "azure" // AzureStackCloudName is the cloud name of Azure Stack AzureStackCloudName = "AZURESTACKCLOUD" // LabelFailureDomainBetaZone refer to https://github.com/kubernetes/api/blob/8519c5ea46199d57724725d5b969c5e8e0533692/core/v1/well_known_labels.go#L22-L23 LabelFailureDomainBetaZone = "failure-domain.beta.kubernetes.io/zone" // LabelFailureDomainBetaRegion failure-domain region label LabelFailureDomainBetaRegion = "failure-domain.beta.kubernetes.io/region" )
const ( // PreConfiguredBackendPoolLoadBalancerTypesNone means that the load balancers are not pre-configured PreConfiguredBackendPoolLoadBalancerTypesNone = "" // PreConfiguredBackendPoolLoadBalancerTypesInternal means that the `internal` load balancers are pre-configured PreConfiguredBackendPoolLoadBalancerTypesInternal = "internal" // PreConfiguredBackendPoolLoadBalancerTypesExternal means that the `external` load balancers are pre-configured PreConfiguredBackendPoolLoadBalancerTypesExternal = "external" // PreConfiguredBackendPoolLoadBalancerTypesAll means that all load balancers are pre-configured PreConfiguredBackendPoolLoadBalancerTypesAll = "all" )
const ( // ServiceAnnotationLoadBalancerInternal is the annotation used on the service ServiceAnnotationLoadBalancerInternal = "service.beta.kubernetes.io/azure-load-balancer-internal" // ServiceAnnotationLoadBalancerInternalSubnet is the annotation used on the service // to specify what subnet it is exposed on ServiceAnnotationLoadBalancerInternalSubnet = "service.beta.kubernetes.io/azure-load-balancer-internal-subnet" // ServiceAnnotationLoadBalancerMode is the annotation used on the service to specify // which load balancer should be associated with the service. This is valid when using the basic // load balancer or turn on the multiple standard load balancers mode, or it would be ignored. // 1. Default mode - service has no annotation ("service.beta.kubernetes.io/azure-load-balancer-mode") // In this case the Loadbalancer of the primary VMSS/VMAS is selected. // 2. "__auto__" mode - service is annotated with __auto__ value, this when loadbalancer from any VMSS/VMAS // is selected which has the minimum rules associated with it. // 3. "name" mode - this is when the load balancer from the specified VMSS/VMAS that has the // minimum rules associated with it is selected. ServiceAnnotationLoadBalancerMode = "service.beta.kubernetes.io/azure-load-balancer-mode" // ServiceAnnotationLoadBalancerAutoModeValue is the annotation used on the service to specify the // Azure load balancer auto selection from the availability sets ServiceAnnotationLoadBalancerAutoModeValue = "__auto__" // ServiceAnnotationDNSLabelName is the annotation used on the service // to specify the DNS label name for the service. ServiceAnnotationDNSLabelName = "service.beta.kubernetes.io/azure-dns-label-name" // to specify that the service should be exposed using an Azure security rule // that may be shared with other service, trading specificity of rules for an // increase in the number of services that can be exposed. This relies on the // Azure "augmented security rules" feature. ServiceAnnotationSharedSecurityRule = "service.beta.kubernetes.io/azure-shared-securityrule" // ServiceAnnotationLoadBalancerResourceGroup is the annotation used on the service // to specify the resource group of load balancer objects that are not in the same resource group as the cluster. ServiceAnnotationLoadBalancerResourceGroup = "service.beta.kubernetes.io/azure-load-balancer-resource-group" // ServiceAnnotationPIPName specifies the pip that will be applied to load balancer ServiceAnnotationPIPName = "service.beta.kubernetes.io/azure-pip-name" // ServiceAnnotationIPTagsForPublicIP specifies the iptags used when dynamically creating a public ip ServiceAnnotationIPTagsForPublicIP = "service.beta.kubernetes.io/azure-pip-ip-tags" // ServiceAnnotationAllowedServiceTag is the annotation used on the service // to specify a list of allowed service tags separated by comma // Refer https://docs.microsoft.com/en-us/azure/virtual-network/security-overview#service-tags for all supported service tags. ServiceAnnotationAllowedServiceTag = "service.beta.kubernetes.io/azure-allowed-service-tags" // ServiceAnnotationDenyAllExceptLoadBalancerSourceRanges denies all traffic to the load balancer except those // within the service.Spec.LoadBalancerSourceRanges. Ref: https://github.com/kubernetes-sigs/cloud-provider-azure/issues/374. ServiceAnnotationDenyAllExceptLoadBalancerSourceRanges = "service.beta.kubernetes.io/azure-deny-all-except-load-balancer-source-ranges" // ServiceAnnotationLoadBalancerIdleTimeout is the annotation used on the service // to specify the idle timeout for connections on the load balancer in minutes. ServiceAnnotationLoadBalancerIdleTimeout = "service.beta.kubernetes.io/azure-load-balancer-tcp-idle-timeout" // ServiceAnnotationLoadBalancerEnableHighAvailabilityPorts is the annotation used on the service // to enable the high availability ports on the standard internal load balancer. ServiceAnnotationLoadBalancerEnableHighAvailabilityPorts = "service.beta.kubernetes.io/azure-load-balancer-enable-high-availability-ports" // ServiceAnnotationLoadBalancerDisableTCPReset is the annotation used on the service // to set enableTcpReset to false in load balancer rule. This only works for Azure standard load balancer backed service. // TODO(feiskyer): disable-tcp-reset annotations has been depracated since v1.18, it would removed on v1.20. ServiceAnnotationLoadBalancerDisableTCPReset = "service.beta.kubernetes.io/azure-load-balancer-disable-tcp-reset" // ServiceAnnotationLoadBalancerHealthProbeProtocol determines the network protocol that the load balancer health probe use. // If not set, the local service would use the HTTP and the cluster service would use the TCP by default. ServiceAnnotationLoadBalancerHealthProbeProtocol = "service.beta.kubernetes.io/azure-load-balancer-health-probe-protocol" // ServiceAnnotationLoadBalancerHealthProbeRequestPath determines the request path of the load balancer health probe. // This is only useful for the HTTP and HTTPS, and would be ignored when using TCP. If not set, // `/healthz` would be configured by default. ServiceAnnotationLoadBalancerHealthProbeRequestPath = "service.beta.kubernetes.io/azure-load-balancer-health-probe-request-path" // ServiceAnnotationAzurePIPTags determines what tags should be applied to the public IP of the service. The cluster name // and service names tags (which is managed by controller manager itself) would keep unchanged. The supported format // is `a=b,c=d,...`. After updated, the old user-assigned tags would not be replaced by the new ones. ServiceAnnotationAzurePIPTags = "service.beta.kubernetes.io/azure-pip-tags" )
const ( // IPv6DualStack is here to avoid having to import features pkg // and violate import rules IPv6DualStack featuregate.Feature = "IPv6DualStack" // InternalLoadBalancerNameSuffix is load balancer suffix InternalLoadBalancerNameSuffix = "-internal" )
const SkipMatchingTag = "skip-matching"
SkipMatchingTag skip account matching tag
const ( // WriteAcceleratorEnabled support for Azure Write Accelerator on Azure Disks // https://docs.microsoft.com/azure/virtual-machines/windows/how-to-enable-write-accelerator WriteAcceleratorEnabled = "writeacceleratorenabled" )
Variables ¶
var ( // ErrorNotVmssInstance indicates an instance is not belonging to any vmss. ErrorNotVmssInstance = errors.New("not a vmss instance") )
Functions ¶
func ConvertTagsToMap ¶
ConvertTagsToMap convert the tags from string to map the valid tags format is "key1=value1,key2=value2", which could be converted to {"key1": "value1", "key2": "value2"}
func InitializeCloudProviderRateLimitConfig ¶
func InitializeCloudProviderRateLimitConfig(config *CloudProviderRateLimitConfig)
InitializeCloudProviderRateLimitConfig initializes rate limit configs.
Types ¶
type AccountOptions ¶
type AccountOptions struct {
Name, Type, Kind, ResourceGroup, Location string
EnableHTTPSTrafficOnly bool
Tags map[string]string
VirtualNetworkResourceIDs []string
// indicate whether create new account when Name is empty
CreateAccount bool
}
AccountOptions contains the fields which are used to create storage account.
type AttachDiskOptions ¶
type AttachDiskOptions struct {
// contains filtered or unexported fields
}
AttachDiskOptions attach disk options
type BlobDiskController ¶
type BlobDiskController struct {
// contains filtered or unexported fields
}
BlobDiskController : blob disk controller struct
func (*BlobDiskController) CreateBlobDisk ¶
func (c *BlobDiskController) CreateBlobDisk(dataDiskName string, storageAccountType storage.SkuName, sizeGB int) (string, error)
CreateBlobDisk : create a blob disk in a node
func (*BlobDiskController) CreateVolume ¶
func (c *BlobDiskController) CreateVolume(blobName, accountName, accountType, location string, requestGB int) (string, string, int, error)
CreateVolume creates a VHD blob in a storage account that has storageType and location using the given storage account. If no storage account is given, search all the storage accounts associated with the resource group and pick one that fits storage type and location.
func (*BlobDiskController) DeleteBlobDisk ¶
func (c *BlobDiskController) DeleteBlobDisk(diskURI string) error
DeleteBlobDisk : delete a blob disk from a node
func (*BlobDiskController) DeleteVolume ¶
func (c *BlobDiskController) DeleteVolume(diskURI string) error
DeleteVolume deletes a VHD blob
type Cloud ¶
type Cloud struct { Config Environment azure.Environment RoutesClient routeclient.Interface SubnetsClient subnetclient.Interface InterfacesClient interfaceclient.Interface RouteTablesClient routetableclient.Interface LoadBalancerClient loadbalancerclient.Interface PublicIPAddressesClient publicipclient.Interface SecurityGroupsClient securitygroupclient.Interface VirtualMachinesClient vmclient.Interface StorageAccountClient storageaccountclient.Interface DisksClient diskclient.Interface SnapshotsClient snapshotclient.Interface FileClient fileclient.Interface VirtualMachineScaleSetsClient vmssclient.Interface VirtualMachineScaleSetVMsClient vmssvmclient.Interface VirtualMachineSizesClient vmsizeclient.Interface ResourceRequestBackoff wait.Backoff VMSet VMSet KubeClient clientset.Interface *BlobDiskController *ManagedDiskController // contains filtered or unexported fields }
Cloud holds the config and clients
func GetTestCloud ¶
func GetTestCloud(ctrl *gomock.Controller) (az *Cloud)
GetTestCloud returns a fake azure cloud for unit tests in Azure related CSI drivers
func GetTestCloudWithExtendedLocation ¶ added in v0.7.1
func GetTestCloudWithExtendedLocation(ctrl *gomock.Controller) (az *Cloud)
GetTestCloudWithExtendedLocation returns a fake azure cloud for unit tests in Azure related CSI drivers with extended location.
func NewCloudWithoutFeatureGates ¶
NewCloudWithoutFeatureGates returns a Cloud without trying to wire the feature gates. This is used by the unit tests that don't load the actual features being used in the cluster.
func (*Cloud) AddSSHKeyToAllInstances ¶
AddSSHKeyToAllInstances adds an SSH public key as a legal identity for all instances expected format for the key is standard ssh-keygen format: <protocol> <blob>
func (*Cloud) AddStorageAccountTags ¶ added in v0.7.1
func (az *Cloud) AddStorageAccountTags(resourceGroup, account string, tags map[string]*string) *retry.Error
AddStorageAccountTags add tags to storage account
func (*Cloud) AliasRangesByProviderID ¶ added in v0.7.1
AliasRangesByProviderID to be implemented
func (Cloud) AttachDisk ¶
func (c Cloud) AttachDisk(isManagedDisk bool, diskName, diskURI string, nodeName types.NodeName, cachingMode compute.CachingTypes) (int32, error)
AttachDisk attaches a vhd to vm. The vhd must exist, can be identified by diskName, diskURI. return (lun, error)
func (*Cloud) Clusters ¶
func (az *Cloud) Clusters() (cloudprovider.Clusters, bool)
Clusters returns a clusters interface. Also returns true if the interface is supported, false otherwise.
func (*Cloud) CreateFileShare ¶
func (az *Cloud) CreateFileShare(accountOptions *AccountOptions, shareOptions *fileclient.ShareOptions) (string, string, error)
CreateFileShare creates a file share, using a matching storage account type, account kind, etc. storage account will be created if specified account is not found
func (*Cloud) CreateOrUpdateInterface ¶
CreateOrUpdateInterface invokes az.PublicIPAddressesClient.CreateOrUpdate with exponential backoff retry
func (*Cloud) CreateOrUpdateLB ¶
CreateOrUpdateLB invokes az.LoadBalancerClient.CreateOrUpdate with exponential backoff retry
func (*Cloud) CreateOrUpdatePIP ¶
func (az *Cloud) CreateOrUpdatePIP(service *v1.Service, pipResourceGroup string, pip network.PublicIPAddress) error
CreateOrUpdatePIP invokes az.PublicIPAddressesClient.CreateOrUpdate with exponential backoff retry
func (*Cloud) CreateOrUpdateRoute ¶
CreateOrUpdateRoute invokes az.RoutesClient.CreateOrUpdate with exponential backoff retry
func (*Cloud) CreateOrUpdateRouteTable ¶
func (az *Cloud) CreateOrUpdateRouteTable(routeTable network.RouteTable) error
CreateOrUpdateRouteTable invokes az.RouteTablesClient.CreateOrUpdate with exponential backoff retry
func (*Cloud) CreateOrUpdateSecurityGroup ¶
func (az *Cloud) CreateOrUpdateSecurityGroup(sg network.SecurityGroup) error
CreateOrUpdateSecurityGroup invokes az.SecurityGroupsClient.CreateOrUpdate with exponential backoff retry
func (*Cloud) CreateOrUpdateVMSS ¶
func (az *Cloud) CreateOrUpdateVMSS(resourceGroupName string, VMScaleSetName string, parameters compute.VirtualMachineScaleSet) *retry.Error
CreateOrUpdateVMSS invokes az.VirtualMachineScaleSetsClient.Update().
func (*Cloud) CreateRoute ¶
func (az *Cloud) CreateRoute(ctx context.Context, clusterName string, nameHint string, kubeRoute *cloudprovider.Route) error
CreateRoute creates the described managed route route.Name will be ignored, although the cloud-provider may use nameHint to create a more user-meaningful name.
func (*Cloud) CurrentNodeName ¶
CurrentNodeName returns the name of the node we are currently running on. On Azure this is the hostname, so we just return the hostname.
func (*Cloud) DeleteFileShare ¶
DeleteFileShare deletes a file share using storage account name and key
func (*Cloud) DeleteLB ¶
DeleteLB invokes az.LoadBalancerClient.Delete with exponential backoff retry
func (*Cloud) DeletePublicIP ¶
DeletePublicIP invokes az.PublicIPAddressesClient.Delete with exponential backoff retry
func (*Cloud) DeleteRoute ¶
func (az *Cloud) DeleteRoute(ctx context.Context, clusterName string, kubeRoute *cloudprovider.Route) error
DeleteRoute deletes the specified managed route Route should be as returned by ListRoutes
func (*Cloud) DeleteRouteWithName ¶
DeleteRouteWithName invokes az.RoutesClient.CreateOrUpdate with exponential backoff retry
func (Cloud) DetachDisk ¶
DetachDisk detaches a disk from VM
func (Cloud) DisksAreAttached ¶
func (c Cloud) DisksAreAttached(diskNames []string, nodeName types.NodeName) (map[string]bool, error)
DisksAreAttached checks if a list of volumes are attached to the node with the specified NodeName.
func (*Cloud) EnsureLoadBalancer ¶
func (az *Cloud) EnsureLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error)
EnsureLoadBalancer creates a new load balancer 'name', or updates the existing one. Returns the status of the balancer
func (*Cloud) EnsureLoadBalancerDeleted ¶
func (az *Cloud) EnsureLoadBalancerDeleted(ctx context.Context, clusterName string, service *v1.Service) error
EnsureLoadBalancerDeleted deletes the specified load balancer if it exists, returning nil if the load balancer specified either didn't exist or was successfully deleted. This construction is useful because many cloud providers' load balancers have multiple underlying components, meaning a Get could say that the LB doesn't exist even if some part of it is still laying around.
func (*Cloud) EnsureStorageAccount ¶
func (az *Cloud) EnsureStorageAccount(accountOptions *AccountOptions, genAccountNamePrefix string) (string, string, error)
EnsureStorageAccount search storage account, create one storage account(with genAccountNamePrefix) if not found, return accountName, accountKey
func (*Cloud) GetActiveZones ¶
GetActiveZones returns all the zones in which k8s nodes are currently running.
func (*Cloud) GetAzureDiskLabels ¶
GetAzureDiskLabels gets availability zone labels for Azuredisk.
func (Cloud) GetDiskLun ¶
GetDiskLun finds the lun on the host that the vhd is attached to, given a vhd's diskName and diskURI.
func (*Cloud) GetFileShare ¶
func (az *Cloud) GetFileShare(resourceGroupName, accountName, name string) (storage.FileShare, error)
GetFileShare gets a file share
func (*Cloud) GetIPForMachineWithRetry ¶
GetIPForMachineWithRetry invokes az.getIPForMachine with exponential backoff retry
func (*Cloud) GetLabelsForVolume ¶
func (c *Cloud) GetLabelsForVolume(ctx context.Context, pv *v1.PersistentVolume) (map[string]string, error)
GetLabelsForVolume implements PVLabeler.GetLabelsForVolume
func (*Cloud) GetLoadBalancer ¶
func (az *Cloud) GetLoadBalancer(ctx context.Context, clusterName string, service *v1.Service) (status *v1.LoadBalancerStatus, exists bool, err error)
GetLoadBalancer returns whether the specified load balancer and its components exist, and if so, what its status is.
func (*Cloud) GetLoadBalancerName ¶
func (az *Cloud) GetLoadBalancerName(ctx context.Context, clusterName string, service *v1.Service) string
GetLoadBalancerName returns the LoadBalancer name.
func (*Cloud) GetLocation ¶
GetLocation returns the location in which k8s cluster is currently running.
func (*Cloud) GetNodeResourceGroup ¶
GetNodeResourceGroup gets resource group for given node.
func (*Cloud) GetResourceGroups ¶
GetResourceGroups returns a set of resource groups that all nodes are running on.
func (*Cloud) GetStorageAccesskey ¶
GetStorageAccesskey gets the storage account access key
func (*Cloud) GetUnmanagedNodes ¶
GetUnmanagedNodes returns a list of nodes not managed by Azure cloud provider (e.g. on-prem nodes).
func (*Cloud) GetVirtualMachineWithRetry ¶
func (az *Cloud) GetVirtualMachineWithRetry(name types.NodeName, crt azcache.AzureCacheReadType) (compute.VirtualMachine, error)
GetVirtualMachineWithRetry invokes az.getVirtualMachine with exponential backoff retry
func (*Cloud) GetZone ¶
GetZone returns the Zone containing the current availability zone and locality region that the program is running in. If the node is not running with availability zones, then it will fall back to fault domain.
func (*Cloud) GetZoneByNodeName ¶
func (az *Cloud) GetZoneByNodeName(ctx context.Context, nodeName types.NodeName) (cloudprovider.Zone, error)
GetZoneByNodeName implements Zones.GetZoneByNodeName This is particularly useful in external cloud providers where the kubelet does not initialize node data.
func (*Cloud) GetZoneByProviderID ¶
func (az *Cloud) GetZoneByProviderID(ctx context.Context, providerID string) (cloudprovider.Zone, error)
GetZoneByProviderID implements Zones.GetZoneByProviderID This is particularly useful in external cloud providers where the kubelet does not initialize node data.
func (*Cloud) HasClusterID ¶
HasClusterID returns true if the cluster has a clusterID
func (*Cloud) Initialize ¶
func (az *Cloud) Initialize(clientBuilder cloudprovider.ControllerClientBuilder, stop <-chan struct{})
Initialize passes a Kubernetes clientBuilder interface to the cloud provider
func (*Cloud) InitializeCloudFromConfig ¶
InitializeCloudFromConfig initializes the Cloud from config.
func (*Cloud) InitializeCloudFromSecret ¶
func (az *Cloud) InitializeCloudFromSecret()
InitializeCloudFromSecret initializes Azure cloud provider from Kubernetes secret.
func (*Cloud) InstanceExists ¶ added in v0.7.1
InstanceExists returns true if the instance for the given node exists according to the cloud provider. Use the node.name or node.spec.providerID field to find the node in the cloud provider.
func (*Cloud) InstanceExistsByProviderID ¶
InstanceExistsByProviderID returns true if the instance with the given provider id still exists and is running. If false is returned with no error, the instance will be immediately deleted by the cloud controller manager.
func (*Cloud) InstanceID ¶
InstanceID returns the cloud provider ID of the specified instance. Note that if the instance does not exist or is no longer running, we must return ("", cloudprovider.InstanceNotFound)
func (*Cloud) InstanceMetadata ¶ added in v0.7.1
func (az *Cloud) InstanceMetadata(ctx context.Context, node *v1.Node) (*cloudprovider.InstanceMetadata, error)
InstanceMetadata returns the instance's metadata. The values returned in InstanceMetadata are translated into specific fields in the Node object on registration. Use the node.name or node.spec.providerID field to find the node in the cloud provider.
func (*Cloud) InstanceShutdown ¶ added in v0.7.1
InstanceShutdown returns true if the instance is shutdown according to the cloud provider. Use the node.name or node.spec.providerID field to find the node in the cloud provider.
func (*Cloud) InstanceShutdownByProviderID ¶
InstanceShutdownByProviderID returns true if the instance is in safe state to detach volumes
func (*Cloud) InstanceType ¶
InstanceType returns the type of the specified instance. Note that if the instance does not exist or is no longer running, we must return ("", cloudprovider.InstanceNotFound) (Implementer Note): This is used by kubelet. Kubelet will label the node. Real log from kubelet:
Adding node label from cloud provider: beta.kubernetes.io/instance-type=[value]
func (*Cloud) InstanceTypeByProviderID ¶
InstanceTypeByProviderID returns the cloudprovider instance type of the node with the specified unique providerID This method will not be called from the node that is requesting this ID. i.e. metadata service and other local methods cannot be used here
func (*Cloud) Instances ¶
func (az *Cloud) Instances() (cloudprovider.Instances, bool)
Instances returns an instances interface. Also returns true if the interface is supported, false otherwise.
func (*Cloud) InstancesV2 ¶
func (az *Cloud) InstancesV2() (cloudprovider.InstancesV2, bool)
InstancesV2 returns an instancesV2 interface. Also returns true if the interface is supported, false otherwise.
func (*Cloud) IsNodeUnmanaged ¶
IsNodeUnmanaged returns true if the node is not managed by Azure cloud provider. Those nodes includes on-prem or VMs from other clouds. They will not be added to load balancer backends. Azure routes and managed disks are also not supported for them.
func (*Cloud) IsNodeUnmanagedByProviderID ¶
IsNodeUnmanagedByProviderID returns true if the node is not managed by Azure cloud provider. All managed node's providerIDs are in format 'azure:///subscriptions/<id>/resourceGroups/<rg>/providers/Microsoft.Compute/.*'
func (*Cloud) ListPIP ¶
func (az *Cloud) ListPIP(service *v1.Service, pipResourceGroup string) ([]network.PublicIPAddress, error)
ListPIP list the PIP resources in the given resource group
func (*Cloud) ListRoutes ¶
func (az *Cloud) ListRoutes(ctx context.Context, clusterName string) ([]*cloudprovider.Route, error)
ListRoutes lists all managed routes that belong to the specified clusterName
func (*Cloud) ListVirtualMachines ¶
func (az *Cloud) ListVirtualMachines(resourceGroup string) ([]compute.VirtualMachine, error)
ListVirtualMachines invokes az.VirtualMachinesClient.List with exponential backoff retry
func (*Cloud) LoadBalancer ¶
func (az *Cloud) LoadBalancer() (cloudprovider.LoadBalancer, bool)
LoadBalancer returns a balancer interface. Also returns true if the interface is supported, false otherwise.
func (*Cloud) NodeAddresses ¶
NodeAddresses returns the addresses of the specified instance.
func (*Cloud) NodeAddressesByProviderID ¶
func (az *Cloud) NodeAddressesByProviderID(ctx context.Context, providerID string) ([]v1.NodeAddress, error)
NodeAddressesByProviderID returns the node addresses of an instances with the specified unique providerID This method will not be called from the node that is requesting this ID. i.e. metadata service and other local methods cannot be used here
func (*Cloud) ProviderName ¶
ProviderName returns the cloud provider ID.
func (*Cloud) RemoveStorageAccountTag ¶ added in v0.7.1
RemoveStorageAccountTag remove tag from storage account
func (*Cloud) RequestBackoff ¶
RequestBackoff if backoff is disabled in cloud provider it returns a new Backoff object steps = 1 This is to make sure that the requested command executes at least once
func (*Cloud) ResizeFileShare ¶
ResizeFileShare resizes a file share
func (*Cloud) Routes ¶
func (az *Cloud) Routes() (cloudprovider.Routes, bool)
Routes returns a routes interface along with whether the interface is supported.
func (Cloud) SetDiskLun ¶
func (c Cloud) SetDiskLun(nodeName types.NodeName, diskURI string, diskMap map[string]*AttachDiskOptions) (int32, error)
SetDiskLun find unused luns and allocate lun for every disk in diskMap. Return lun of diskURI, -1 if all luns are used.
func (*Cloud) SetInformers ¶
func (az *Cloud) SetInformers(informerFactory informers.SharedInformerFactory)
SetInformers sets informers for Azure cloud provider.
func (*Cloud) ShouldNodeExcludedFromLoadBalancer ¶
ShouldNodeExcludedFromLoadBalancer returns true if node is unmanaged or in external resource group.
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. RouteRateLimit *azclients.RateLimitConfig `json:"routeRateLimit,omitempty" yaml:"routeRateLimit,omitempty"` SubnetsRateLimit *azclients.RateLimitConfig `json:"subnetsRateLimit,omitempty" yaml:"subnetsRateLimit,omitempty"` InterfaceRateLimit *azclients.RateLimitConfig `json:"interfaceRateLimit,omitempty" yaml:"interfaceRateLimit,omitempty"` RouteTableRateLimit *azclients.RateLimitConfig `json:"routeTableRateLimit,omitempty" yaml:"routeTableRateLimit,omitempty"` LoadBalancerRateLimit *azclients.RateLimitConfig `json:"loadBalancerRateLimit,omitempty" yaml:"loadBalancerRateLimit,omitempty"` PublicIPAddressRateLimit *azclients.RateLimitConfig `json:"publicIPAddressRateLimit,omitempty" yaml:"publicIPAddressRateLimit,omitempty"` SecurityGroupRateLimit *azclients.RateLimitConfig `json:"securityGroupRateLimit,omitempty" yaml:"securityGroupRateLimit,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"` SnapshotRateLimit *azclients.RateLimitConfig `json:"snapshotRateLimit,omitempty" yaml:"snapshotRateLimit,omitempty"` VirtualMachineScaleSetRateLimit *azclients.RateLimitConfig `json:"virtualMachineScaleSetRateLimit,omitempty" yaml:"virtualMachineScaleSetRateLimit,omitempty"` VirtualMachineSizeRateLimit *azclients.RateLimitConfig `json:"virtualMachineSizesRateLimit,omitempty" yaml:"virtualMachineSizesRateLimit,omitempty"` }
CloudProviderRateLimitConfig indicates the rate limit config for each clients.
type ComputeMetadata ¶
type ComputeMetadata struct { Environment string `json:"azEnvironment,omitempty"` SKU string `json:"sku,omitempty"` Name string `json:"name,omitempty"` Zone string `json:"zone,omitempty"` VMSize string `json:"vmSize,omitempty"` OSType string `json:"osType,omitempty"` Location string `json:"location,omitempty"` FaultDomain string `json:"platformFaultDomain,omitempty"` UpdateDomain string `json:"platformUpdateDomain,omitempty"` ResourceGroup string `json:"resourceGroupName,omitempty"` VMScaleSetName string `json:"vmScaleSetName,omitempty"` SubscriptionID string `json:"subscriptionId,omitempty"` }
ComputeMetadata represents compute information
type Config ¶
type Config struct { auth.AzureAuthConfig CloudProviderRateLimitConfig // The name of the resource group that the cluster is deployed in ResourceGroup string `json:"resourceGroup,omitempty" yaml:"resourceGroup,omitempty"` // The location of the resource group that the cluster is deployed in Location string `json:"location,omitempty" yaml:"location,omitempty"` // The name of site where the cluster will be deployed to that is more granular than the region specified by the "location" field. // Currently only public ip and load balancer support this. ExtendedLocationName string `json:"extendedLocationName,omitempty" yaml:"extendedLocationName,omitempty"` // The type of site that is being targeted. // Currently only public ip and load balancer support this. ExtendedLocationType string `json:"extendedLocationType,omitempty" yaml:"extendedLocationType,omitempty"` // The name of the VNet that the cluster is deployed in VnetName string `json:"vnetName,omitempty" yaml:"vnetName,omitempty"` // The name of the resource group that the Vnet is deployed in VnetResourceGroup string `json:"vnetResourceGroup,omitempty" yaml:"vnetResourceGroup,omitempty"` // The name of the subnet that the cluster is deployed in SubnetName string `json:"subnetName,omitempty" yaml:"subnetName,omitempty"` // The name of the security group attached to the cluster's subnet SecurityGroupName string `json:"securityGroupName,omitempty" yaml:"securityGroupName,omitempty"` // The name of the resource group that the security group is deployed in SecurityGroupResourceGroup string `json:"securityGroupResourceGroup,omitempty" yaml:"securityGroupResourceGroup,omitempty"` // (Optional in 1.6) The name of the route table attached to the subnet that the cluster is deployed in RouteTableName string `json:"routeTableName,omitempty" yaml:"routeTableName,omitempty"` // The name of the resource group that the RouteTable is deployed in RouteTableResourceGroup string `json:"routeTableResourceGroup,omitempty" yaml:"routeTableResourceGroup,omitempty"` // (Optional) The name of the availability set that should be used as the load balancer backend // If this is set, the Azure cloudprovider will only add nodes from that availability set to the load // balancer backend pool. If this is not set, and multiple agent pools (availability sets) are used, then // the cloudprovider will try to add all nodes to a single backend pool which is forbidden. // In other words, if you use multiple agent pools (availability sets), you MUST set this field. PrimaryAvailabilitySetName string `json:"primaryAvailabilitySetName,omitempty" yaml:"primaryAvailabilitySetName,omitempty"` // The type of azure nodes. Candidate values are: vmss and standard. // If not set, it will be default to standard. VMType string `json:"vmType,omitempty" yaml:"vmType,omitempty"` // The name of the scale set that should be used as the load balancer backend. // If this is set, the Azure cloudprovider will only add nodes from that scale set to the load // balancer backend pool. If this is not set, and multiple agent pools (scale sets) are used, then // the cloudprovider will try to add all nodes to a single backend pool which is forbidden. // In other words, if you use multiple agent pools (scale sets), you MUST set this field. PrimaryScaleSetName string `json:"primaryScaleSetName,omitempty" yaml:"primaryScaleSetName,omitempty"` // Enable exponential backoff to manage resource request retries CloudProviderBackoff bool `json:"cloudProviderBackoff,omitempty" yaml:"cloudProviderBackoff,omitempty"` // Backoff retry limit CloudProviderBackoffRetries int `json:"cloudProviderBackoffRetries,omitempty" yaml:"cloudProviderBackoffRetries,omitempty"` // Backoff exponent CloudProviderBackoffExponent float64 `json:"cloudProviderBackoffExponent,omitempty" yaml:"cloudProviderBackoffExponent,omitempty"` // Backoff duration CloudProviderBackoffDuration int `json:"cloudProviderBackoffDuration,omitempty" yaml:"cloudProviderBackoffDuration,omitempty"` // Backoff jitter CloudProviderBackoffJitter float64 `json:"cloudProviderBackoffJitter,omitempty" yaml:"cloudProviderBackoffJitter,omitempty"` // Use instance metadata service where possible UseInstanceMetadata bool `json:"useInstanceMetadata,omitempty" yaml:"useInstanceMetadata,omitempty"` // Sku of Load Balancer and Public IP. Candidate values are: basic and standard. // If not set, it will be default to basic. LoadBalancerSku string `json:"loadBalancerSku,omitempty" yaml:"loadBalancerSku,omitempty"` // ExcludeMasterFromStandardLB excludes master nodes from standard load balancer. // If not set, it will be default to true. ExcludeMasterFromStandardLB *bool `json:"excludeMasterFromStandardLB,omitempty" yaml:"excludeMasterFromStandardLB,omitempty"` // DisableOutboundSNAT disables the outbound SNAT for public load balancer rules. // It should only be set when loadBalancerSku is standard. If not set, it will be default to false. DisableOutboundSNAT *bool `json:"disableOutboundSNAT,omitempty" yaml:"disableOutboundSNAT,omitempty"` // Maximum allowed LoadBalancer Rule Count is the limit enforced by Azure Load balancer MaximumLoadBalancerRuleCount int `json:"maximumLoadBalancerRuleCount,omitempty" yaml:"maximumLoadBalancerRuleCount,omitempty"` // The cloud configure type for Azure cloud provider. Supported values are file, secret and merge. CloudConfigType cloudConfigType `json:"cloudConfigType,omitempty" yaml:"cloudConfigType,omitempty"` // LoadBalancerName determines the specific name of the load balancer user want to use, working with // LoadBalancerResourceGroup LoadBalancerName string `json:"loadBalancerName,omitempty" yaml:"loadBalancerName,omitempty"` // LoadBalancerResourceGroup determines the specific resource group of the load balancer user want to use, working // with LoadBalancerName LoadBalancerResourceGroup string `json:"loadBalancerResourceGroup,omitempty" yaml:"loadBalancerResourceGroup,omitempty"` // PreConfiguredBackendPoolLoadBalancerTypes determines whether the LoadBalancer BackendPool has been preconfigured. // Candidate values are: // "": exactly with today (not pre-configured for any LBs) // "internal": for internal LoadBalancer // "external": for external LoadBalancer // "all": for both internal and external LoadBalancer PreConfiguredBackendPoolLoadBalancerTypes string `json:"preConfiguredBackendPoolLoadBalancerTypes,omitempty" yaml:"preConfiguredBackendPoolLoadBalancerTypes,omitempty"` // EnableMultipleStandardLoadBalancers determines the behavior of the standard load balancer. If set to true // there would be one standard load balancer per VMAS or VMSS, which is similar with the behavior of the basic // load balancer. Users could select the specific standard load balancer for their service by the service // annotation `service.beta.kubernetes.io/azure-load-balancer-mode`, If set to false, the same standard load balancer // would be shared by all services in the cluster. In this case, the mode selection annotation would be ignored. EnableMultipleStandardLoadBalancers bool `json:"enableMultipleStandardLoadBalancers,omitempty" yaml:"enableMultipleStandardLoadBalancers,omitempty"` // AvailabilitySetNodesCacheTTLInSeconds sets the Cache TTL for availabilitySetNodesCache // if not set, will use default value AvailabilitySetNodesCacheTTLInSeconds int `json:"availabilitySetNodesCacheTTLInSeconds,omitempty" yaml:"availabilitySetNodesCacheTTLInSeconds,omitempty"` // VmssCacheTTLInSeconds sets the cache TTL for VMSS VmssCacheTTLInSeconds int `json:"vmssCacheTTLInSeconds,omitempty" yaml:"vmssCacheTTLInSeconds,omitempty"` // VmssVirtualMachinesCacheTTLInSeconds sets the cache TTL for vmssVirtualMachines VmssVirtualMachinesCacheTTLInSeconds int `json:"vmssVirtualMachinesCacheTTLInSeconds,omitempty" yaml:"vmssVirtualMachinesCacheTTLInSeconds,omitempty"` // VmCacheTTLInSeconds sets the cache TTL for vm VMCacheTTLInSeconds int `json:"vmCacheTTLInSeconds,omitempty" yaml:"vmCacheTTLInSeconds,omitempty"` // LoadBalancerCacheTTLInSeconds sets the cache TTL for load balancer LoadBalancerCacheTTLInSeconds int `json:"loadBalancerCacheTTLInSeconds,omitempty" yaml:"loadBalancerCacheTTLInSeconds,omitempty"` // NsgCacheTTLInSeconds sets the cache TTL for network security group NsgCacheTTLInSeconds int `json:"nsgCacheTTLInSeconds,omitempty" yaml:"nsgCacheTTLInSeconds,omitempty"` // RouteTableCacheTTLInSeconds sets the cache TTL for route table RouteTableCacheTTLInSeconds int `json:"routeTableCacheTTLInSeconds,omitempty" yaml:"routeTableCacheTTLInSeconds,omitempty"` // DisableAvailabilitySetNodes disables VMAS nodes support when "VMType" is set to "vmss". DisableAvailabilitySetNodes bool `json:"disableAvailabilitySetNodes,omitempty" yaml:"disableAvailabilitySetNodes,omitempty"` // DisableAzureStackCloud disables AzureStackCloud support. It should be used // when setting AzureAuthConfig.Cloud with "AZURESTACKCLOUD" to customize ARM endpoints // while the cluster is not running on AzureStack. DisableAzureStackCloud bool `json:"disableAzureStackCloud,omitempty" yaml:"disableAzureStackCloud,omitempty"` // Tags determines what tags shall be applied to the shared resources managed by controller manager, which // includes load balancer, security group and route table. The supported format is `a=b,c=d,...`. After updated // this config, the old tags would be replaced by the new ones. Tags string `json:"tags,omitempty" yaml:"tags,omitempty"` }
Config holds the configuration parsed from the --cloud-config flag All fields are required unless otherwise specified NOTE: Cloud config files should follow the same Kubernetes deprecation policy as flags or CLIs. Config fields should not change behavior in incompatible ways and should be deprecated for at least 2 release prior to removing. See https://kubernetes.io/docs/reference/using-api/deprecation-policy/#deprecating-a-flag-or-cli for more details.
func (*Config) HasExtendedLocation ¶ added in v0.7.1
HasExtendedLocation returns true if extendedlocation prop are specified.
type IPAddress ¶
type IPAddress struct { PrivateIP string `json:"privateIpAddress"` PublicIP string `json:"publicIpAddress"` }
IPAddress represents IP address information.
type InstanceMetadata ¶
type InstanceMetadata struct { Compute *ComputeMetadata `json:"compute,omitempty"` Network *NetworkMetadata `json:"network,omitempty"` }
InstanceMetadata represents instance information.
type InstanceMetadataService ¶
type InstanceMetadataService struct {
// contains filtered or unexported fields
}
InstanceMetadataService knows how to query the Azure instance metadata server.
func NewInstanceMetadataService ¶
func NewInstanceMetadataService(metadataURL string) (*InstanceMetadataService, error)
NewInstanceMetadataService creates an instance of the InstanceMetadataService accessor object.
func (*InstanceMetadataService) GetMetadata ¶
func (ims *InstanceMetadataService) GetMetadata(crt azcache.AzureCacheReadType) (*InstanceMetadata, error)
GetMetadata gets instance metadata from cache. crt determines if we can get data from stalled cache/need fresh if cache expired.
type ManagedDiskController ¶
type ManagedDiskController struct {
// contains filtered or unexported fields
}
ManagedDiskController : managed disk controller struct
func (*ManagedDiskController) CreateManagedDisk ¶
func (c *ManagedDiskController) CreateManagedDisk(options *ManagedDiskOptions) (string, error)
CreateManagedDisk : create managed disk
func (*ManagedDiskController) DeleteManagedDisk ¶
func (c *ManagedDiskController) DeleteManagedDisk(diskURI string) error
DeleteManagedDisk : delete managed disk
type ManagedDiskOptions ¶
type ManagedDiskOptions struct { // The name of the disk. DiskName string // The size in GB. SizeGB int // The name of PVC. PVCName string // The name of resource group. ResourceGroup string // The AvailabilityZone to create the disk. AvailabilityZone string // The tags of the disk. Tags map[string]string // The SKU of storage account. StorageAccountType compute.DiskStorageAccountTypes // IOPS Caps for UltraSSD disk DiskIOPSReadWrite string // Throughput Cap (MBps) for UltraSSD disk DiskMBpsReadWrite string // Logical sector size in bytes for Ultra disks LogicalSectorSize int32 // if SourceResourceID is not empty, then it's a disk copy operation(for snapshot) SourceResourceID string // The type of source SourceType string // ResourceId of the disk encryption set to use for enabling encryption at rest. DiskEncryptionSetID string MaxShares int32 }
ManagedDiskOptions specifies the options of managed disks.
type MockVMSet ¶
type MockVMSet struct {
// contains filtered or unexported fields
}
MockVMSet is a mock of VMSet interface
func NewMockVMSet ¶
func NewMockVMSet(ctrl *gomock.Controller) *MockVMSet
NewMockVMSet creates a new mock instance
func (*MockVMSet) AttachDisk ¶
func (m *MockVMSet) AttachDisk(nodeName types.NodeName, diskMap map[string]*AttachDiskOptions) error
AttachDisk mocks base method
func (*MockVMSet) DetachDisk ¶
DetachDisk mocks base method
func (*MockVMSet) EXPECT ¶
func (m *MockVMSet) EXPECT() *MockVMSetMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockVMSet) EnsureBackendPoolDeleted ¶
func (m *MockVMSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoolID, vmSetName string, backendAddressPools *[]network.BackendAddressPool) error
EnsureBackendPoolDeleted mocks base method
func (*MockVMSet) EnsureHostInPool ¶
func (m *MockVMSet) EnsureHostInPool(service *v1.Service, nodeName types.NodeName, backendPoolID, vmSetName string, isInternal bool) (string, string, string, *compute.VirtualMachineScaleSetVM, error)
EnsureHostInPool mocks base method
func (*MockVMSet) EnsureHostsInPool ¶
func (m *MockVMSet) EnsureHostsInPool(service *v1.Service, nodes []*v1.Node, backendPoolID, vmSetName string, isInternal bool) error
EnsureHostsInPool mocks base method
func (*MockVMSet) GetDataDisks ¶
func (m *MockVMSet) GetDataDisks(nodeName types.NodeName, string cache.AzureCacheReadType) ([]compute.DataDisk, error)
GetDataDisks mocks base method
func (*MockVMSet) GetIPByNodeName ¶
GetIPByNodeName mocks base method
func (*MockVMSet) GetInstanceIDByNodeName ¶
GetInstanceIDByNodeName mocks base method
func (*MockVMSet) GetInstanceTypeByNodeName ¶
GetInstanceTypeByNodeName mocks base method
func (*MockVMSet) GetNodeNameByIPConfigurationID ¶
func (m *MockVMSet) GetNodeNameByIPConfigurationID(ipConfigurationID string) (string, string, error)
GetNodeNameByIPConfigurationID mocks base method
func (*MockVMSet) GetNodeNameByProviderID ¶
GetNodeNameByProviderID mocks base method
func (*MockVMSet) GetPowerStatusByNodeName ¶
GetPowerStatusByNodeName mocks base method
func (*MockVMSet) GetPrimaryInterface ¶
GetPrimaryInterface mocks base method
func (*MockVMSet) GetPrimaryVMSetName ¶
GetPrimaryVMSetName mocks base method
func (*MockVMSet) GetPrivateIPsByNodeName ¶
GetPrivateIPsByNodeName mocks base method
func (*MockVMSet) GetVMSetNames ¶
GetVMSetNames mocks base method
func (*MockVMSet) GetZoneByNodeName ¶
func (m *MockVMSet) GetZoneByNodeName(name string) (cloudprovider.Zone, error)
GetZoneByNodeName mocks base method
type MockVMSetMockRecorder ¶
type MockVMSetMockRecorder struct {
// contains filtered or unexported fields
}
MockVMSetMockRecorder is the mock recorder for MockVMSet
func (*MockVMSetMockRecorder) AttachDisk ¶
func (mr *MockVMSetMockRecorder) AttachDisk(nodeName, diskMap interface{}) *gomock.Call
AttachDisk indicates an expected call of AttachDisk
func (*MockVMSetMockRecorder) DetachDisk ¶
func (mr *MockVMSetMockRecorder) DetachDisk(nodeName, diskMap interface{}) *gomock.Call
DetachDisk indicates an expected call of DetachDisk
func (*MockVMSetMockRecorder) EnsureBackendPoolDeleted ¶
func (mr *MockVMSetMockRecorder) EnsureBackendPoolDeleted(service, backendPoolID, vmSetName, backendAddressPools interface{}) *gomock.Call
EnsureBackendPoolDeleted indicates an expected call of EnsureBackendPoolDeleted
func (*MockVMSetMockRecorder) EnsureHostInPool ¶
func (mr *MockVMSetMockRecorder) EnsureHostInPool(service, nodeName, backendPoolID, vmSetName, isInternal interface{}) *gomock.Call
EnsureHostInPool indicates an expected call of EnsureHostInPool
func (*MockVMSetMockRecorder) EnsureHostsInPool ¶
func (mr *MockVMSetMockRecorder) EnsureHostsInPool(service, nodes, backendPoolID, vmSetName, isInternal interface{}) *gomock.Call
EnsureHostsInPool indicates an expected call of EnsureHostsInPool
func (*MockVMSetMockRecorder) GetDataDisks ¶
func (mr *MockVMSetMockRecorder) GetDataDisks(nodeName, string interface{}) *gomock.Call
GetDataDisks indicates an expected call of GetDataDisks
func (*MockVMSetMockRecorder) GetIPByNodeName ¶
func (mr *MockVMSetMockRecorder) GetIPByNodeName(name interface{}) *gomock.Call
GetIPByNodeName indicates an expected call of GetIPByNodeName
func (*MockVMSetMockRecorder) GetInstanceIDByNodeName ¶
func (mr *MockVMSetMockRecorder) GetInstanceIDByNodeName(name interface{}) *gomock.Call
GetInstanceIDByNodeName indicates an expected call of GetInstanceIDByNodeName
func (*MockVMSetMockRecorder) GetInstanceTypeByNodeName ¶
func (mr *MockVMSetMockRecorder) GetInstanceTypeByNodeName(name interface{}) *gomock.Call
GetInstanceTypeByNodeName indicates an expected call of GetInstanceTypeByNodeName
func (*MockVMSetMockRecorder) GetNodeNameByIPConfigurationID ¶
func (mr *MockVMSetMockRecorder) GetNodeNameByIPConfigurationID(ipConfigurationID interface{}) *gomock.Call
GetNodeNameByIPConfigurationID indicates an expected call of GetNodeNameByIPConfigurationID
func (*MockVMSetMockRecorder) GetNodeNameByProviderID ¶
func (mr *MockVMSetMockRecorder) GetNodeNameByProviderID(providerID interface{}) *gomock.Call
GetNodeNameByProviderID indicates an expected call of GetNodeNameByProviderID
func (*MockVMSetMockRecorder) GetPowerStatusByNodeName ¶
func (mr *MockVMSetMockRecorder) GetPowerStatusByNodeName(name interface{}) *gomock.Call
GetPowerStatusByNodeName indicates an expected call of GetPowerStatusByNodeName
func (*MockVMSetMockRecorder) GetPrimaryInterface ¶
func (mr *MockVMSetMockRecorder) GetPrimaryInterface(nodeName interface{}) *gomock.Call
GetPrimaryInterface indicates an expected call of GetPrimaryInterface
func (*MockVMSetMockRecorder) GetPrimaryVMSetName ¶
func (mr *MockVMSetMockRecorder) GetPrimaryVMSetName() *gomock.Call
GetPrimaryVMSetName indicates an expected call of GetPrimaryVMSetName
func (*MockVMSetMockRecorder) GetPrivateIPsByNodeName ¶
func (mr *MockVMSetMockRecorder) GetPrivateIPsByNodeName(name interface{}) *gomock.Call
GetPrivateIPsByNodeName indicates an expected call of GetPrivateIPsByNodeName
func (*MockVMSetMockRecorder) GetVMSetNames ¶
func (mr *MockVMSetMockRecorder) GetVMSetNames(service, nodes interface{}) *gomock.Call
GetVMSetNames indicates an expected call of GetVMSetNames
func (*MockVMSetMockRecorder) GetZoneByNodeName ¶
func (mr *MockVMSetMockRecorder) GetZoneByNodeName(name interface{}) *gomock.Call
GetZoneByNodeName indicates an expected call of GetZoneByNodeName
type NetworkData ¶
type NetworkData struct { IPAddress []IPAddress `json:"ipAddress"` Subnet []Subnet `json:"subnet"` }
NetworkData contains IP information for a network.
type NetworkInterface ¶
type NetworkInterface struct { IPV4 NetworkData `json:"ipv4"` IPV6 NetworkData `json:"ipv6"` MAC string `json:"macAddress"` }
NetworkInterface represents an instances network interface.
type NetworkMetadata ¶
type NetworkMetadata struct {
Interface []NetworkInterface `json:"interface"`
}
NetworkMetadata contains metadata about an instance's network
type VMSet ¶
type VMSet interface { // GetInstanceIDByNodeName gets the cloud provider ID by node name. // It must return ("", cloudprovider.InstanceNotFound) if the instance does // not exist or is no longer running. GetInstanceIDByNodeName(name string) (string, error) // GetInstanceTypeByNodeName gets the instance type by node name. GetInstanceTypeByNodeName(name string) (string, error) // GetIPByNodeName gets machine private IP and public IP by node name. GetIPByNodeName(name string) (string, string, error) // GetPrimaryInterface gets machine primary network interface by node name. GetPrimaryInterface(nodeName string) (network.Interface, error) // GetNodeNameByProviderID gets the node name by provider ID. GetNodeNameByProviderID(providerID string) (types.NodeName, error) // GetZoneByNodeName gets cloudprovider.Zone by node name. GetZoneByNodeName(name string) (cloudprovider.Zone, error) // GetPrimaryVMSetName returns the VM set name depending on the configured vmType. // It returns config.PrimaryScaleSetName for vmss and config.PrimaryAvailabilitySetName for standard vmType. GetPrimaryVMSetName() string // GetVMSetNames selects all possible availability sets or scale sets // (depending vmType configured) for service load balancer, if the service has // no loadbalancer mode annotation returns the primary VMSet. If service annotation // for loadbalancer exists then return the eligible VMSet. GetVMSetNames(service *v1.Service, nodes []*v1.Node) (availabilitySetNames *[]string, err error) // EnsureHostsInPool ensures the given Node's primary IP configurations are // participating in the specified LoadBalancer Backend Pool. EnsureHostsInPool(service *v1.Service, nodes []*v1.Node, backendPoolID string, vmSetName string, isInternal bool) error // EnsureHostInPool ensures the given VM's Primary NIC's Primary IP Configuration is // participating in the specified LoadBalancer Backend Pool. EnsureHostInPool(service *v1.Service, nodeName types.NodeName, backendPoolID string, vmSetName string, isInternal bool) (string, string, string, *compute.VirtualMachineScaleSetVM, error) // EnsureBackendPoolDeleted ensures the loadBalancer backendAddressPools deleted from the specified nodes. EnsureBackendPoolDeleted(service *v1.Service, backendPoolID, vmSetName string, backendAddressPools *[]network.BackendAddressPool) error // AttachDisk attaches a disk to vm AttachDisk(nodeName types.NodeName, diskMap map[string]*AttachDiskOptions) error // DetachDisk detaches a disk from vm DetachDisk(nodeName types.NodeName, diskMap map[string]string) error // GetDataDisks gets a list of data disks attached to the node. GetDataDisks(nodeName types.NodeName, string azcache.AzureCacheReadType) ([]compute.DataDisk, error) // GetPowerStatusByNodeName returns the power state of the specified node. GetPowerStatusByNodeName(name string) (string, error) // GetPrivateIPsByNodeName returns a slice of all private ips assigned to node (ipv6 and ipv4) GetPrivateIPsByNodeName(name string) ([]string, error) // GetNodeNameByIPConfigurationID gets the nodeName and vmSetName by IP configuration ID. GetNodeNameByIPConfigurationID(ipConfigurationID string) (string, string, error) }
VMSet defines functions all vmsets (including scale set and availability set) should be implemented. Don't forget to run the following command to generate the mock client: mockgen -source=$GOPATH/src/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmsets.go -package=mockvmsets VMSet > $GOPATH/src/sigs.k8s.io/cloud-provider-azure/pkg/mockvmsets/azure_mock_vmsets.go
Source Files
¶
- azure.go
- azure_backoff.go
- azure_blobDiskController.go
- azure_config.go
- azure_controller_common.go
- azure_controller_standard.go
- azure_controller_vmss.go
- azure_fakes.go
- azure_file.go
- azure_instance_metadata.go
- azure_instances.go
- azure_loadbalancer.go
- azure_managedDiskController.go
- azure_mock_vmsets.go
- azure_ratelimit.go
- azure_routes.go
- azure_standard.go
- azure_storage.go
- azure_storageaccount.go
- azure_utils.go
- azure_vmsets.go
- azure_vmss.go
- azure_vmss_cache.go
- azure_wrap.go
- azure_zones.go
- doc.go