Documentation ¶
Index ¶
- Constants
- Variables
- func NewService(scope *actuators.MachineScope) azure.Service
- type AzureClient
- type Cache
- func (c *Cache) Get(ctx context.Context, name string, kind ResourceType) (SKU, error)
- func (c *Cache) GetZones(ctx context.Context, location string) ([]string, error)
- func (c *Cache) GetZonesWithVMSize(ctx context.Context, size, location string) ([]string, error)
- func (c *Cache) Map(ctx context.Context, mapFn func(sku SKU)) error
- type Cacher
- type Client
- type NewCacheFunc
- type ResourceSkusServiceBuilderFuncType
- type ResourceType
- type SKU
- type Service
- type Spec
- type Supported
Constants ¶
const ( // EphemeralOSDisk identifies the capability for ephemeral os support. EphemeralOSDisk = "EphemeralOSDiskSupported" // AcceleratedNetworking identifies the capability for accelerated networking support. AcceleratedNetworking = "AcceleratedNetworkingEnabled" // VCPUs identifies the capability for the number of vCPUS. VCPUs = "vCPUs" // GPUs identifies the capability for the number of GPUs. GPUs = "GPUs" // MemoryGB identifies the capability for memory Size. MemoryGB = "MemoryGB" // MinimumVCPUS is the minimum vCPUS allowed. MinimumVCPUS = 2 // MinimumMemory is the minimum memory allowed. MinimumMemory = 2 // EncryptionAtHost identifies the capability for encryption at host. EncryptionAtHost = "EncryptionAtHostSupported" // MaximumPlatformFaultDomainCount identifies the maximum fault domain count for an availability set in a region. MaximumPlatformFaultDomainCount = "MaximumPlatformFaultDomainCount" // UltraSSDAvailable identifies the capability for the support of UltraSSD data disks. UltraSSDAvailable = "UltraSSDAvailable" // CPUArchitectureType identifies the capability for the CPU architecture. CPUArchitectureType = "CpuArchitectureType" // X64 and Arm64 are the possible values for CPUArchitectureType, in the Azure APIs. We will adapt them in the controller // to the ones kubernetes expect. X64 = "x64" Arm64 = "Arm64" )
Variables ¶
var ( // ErrResourceNotFound is returned when a item is not found in a list. ErrResourceNotFound = errors.New("resource not found") )
Functions ¶
func NewService ¶
func NewService(scope *actuators.MachineScope) azure.Service
NewService creates a new groups service.
Types ¶
type AzureClient ¶
type AzureClient struct {
// contains filtered or unexported fields
}
AzureClient contains the Azure go-sdk Client.
func NewClient ¶
func NewClient(azureClients actuators.AzureClients) *AzureClient
NewClient creates a new Resource SKUs client from subscription ID.
func (*AzureClient) List ¶
func (ac *AzureClient) List(ctx context.Context, filter string) ([]compute.ResourceSku, error)
List returns all Resource SKUs available to the subscription.
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache loads resource SKUs at the beginning of reconcile to expose features available on compute resources. It exposes convenience functionality for trawling Azure SKU capabilities. It may be adapted to periodically refresh data in the background.
func GetCache ¶
func GetCache(azureClients actuators.AzureClients, location string) (*Cache, error)
GetCache either creates a new SKUs cache or returns an existing one based on the location + SubscriptionID().
func NewStaticCache ¶
func NewStaticCache(data []compute.ResourceSku, location string) *Cache
NewStaticCache initializes a cache with data and no ability to refresh. Used for testing.
func (*Cache) Get ¶
Get returns a resource SKU with the provided name and category. It returns an error if we could not find a match. We should consider enhancing this function to handle restrictions (e.g. SKU not supported in region), which is why it returns an error and not a boolean.
func (*Cache) GetZones ¶
GetZones looks at all virtual machine sizes and returns the unique set of zones into which some machine size may deploy. It removes restricted virtual machine sizes and duplicates.
func (*Cache) GetZonesWithVMSize ¶
GetZonesWithVMSize returns available zones for a virtual machine size in the given location.
type Cacher ¶
type Cacher interface { Get(key interface{}) (value interface{}, ok bool) Add(key interface{}, value interface{}) bool }
Cacher describes the ability to get and to add items to cache.
type NewCacheFunc ¶
type NewCacheFunc func(azureClients actuators.AzureClients, location string) *Cache
NewCacheFunc allows for mocking out the underlying client.
type ResourceSkusServiceBuilderFuncType ¶
type ResourceSkusServiceBuilderFuncType func(*actuators.MachineScope) azure.Service
type ResourceType ¶
type ResourceType string
ResourceType models available resource types as a set of known string constants.
const ( // VirtualMachines is a convenience constant to filter resource SKUs to only include VMs. VirtualMachines ResourceType = "virtualMachines" // Disks is a convenience constant to filter resource SKUs to only include disks. Disks ResourceType = "disks" // AvailabilitySets is a convenience constant to filter resource SKUs to only include availability sets. AvailabilitySets ResourceType = "availabilitySets" )
type SKU ¶
type SKU compute.ResourceSku
SKU is a thin layer over the Azure resource SKU API to better introspect capabilities.
func (SKU) GetCapability ¶
GetCapability gets the value assigned to the given capability. Eg. MaximumPlatformFaultDomainCount -> "3" will return "3" for the capability "MaximumPlatformFaultDomainCount".
func (SKU) HasCapability ¶
HasCapability return true for a capability which can be either supported or not. Examples include "EphemeralOSDiskSupported", "UltraSSDAvavailable" "EncryptionAtHostSupported", "AcceleratedNetworkingEnabled", and "RdmaEnabled".
func (SKU) HasCapabilityWithCapacity ¶
HasCapabilityWithCapacity returns true when the provided resource exposes a numeric capability and the maximum value exposed by that capability exceeds the value requested by the user. Examples include "MaxResourceVolumeMB", "OSVhdSizeMB", "vCPUs", "MemoryGB","MaxDataDiskCount", "CombinedTempDiskAndCachedIOPS", "CombinedTempDiskAndCachedReadBytesPerSecond", "CombinedTempDiskAndCachedWriteBytesPerSecond", "UncachedDiskIOPS", and "UncachedDiskBytesPerSecond".
func (SKU) HasLocationCapability ¶
HasLocationCapability returns true if the provided resource supports the location capability.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) CreateOrUpdate ¶
CreateOrUpdate no-op.
type Spec ¶
type Spec struct { Name string ResourceType ResourceType }
Spec holds search criteria for a SKU.
Directories ¶
Path | Synopsis |
---|---|
Run go generate to regenerate this mock.
|
Run go generate to regenerate this mock. |