Documentation ¶
Index ¶
- func GetHyperVGenerationVersion(capabilities map[string]string, imageHyperVGen string) (string, error)
- func GetHyperVGenerationVersions(capabilities map[string]string) (sets.Set[string], error)
- func GetVMNetworkingCapability(capabilities map[string]string) bool
- func Platform() (*azure.Platform, error)
- func Validate(client API, ic *types.InstallConfig) error
- func ValidateDiskEncryptionSet(client API, ic *types.InstallConfig) field.ErrorList
- func ValidateForProvisioning(client API, ic *types.InstallConfig) error
- func ValidateInstanceType(client API, fieldPath *field.Path, region, instanceType, diskType string, ...) field.ErrorList
- func ValidatePublicDNS(ic *types.InstallConfig, azureDNS *DNSConfig) error
- func ValidateSecurityProfileDiskEncryptionSet(client API, ic *types.InstallConfig) field.ErrorList
- type API
- type AuthenticationType
- type Client
- func (c *Client) AreMarketplaceImageTermsAccepted(ctx context.Context, publisher, offer, sku string) (bool, error)
- func (c *Client) GetAvailabilityZones(ctx context.Context, region string, instanceType string) ([]string, error)
- func (c *Client) GetComputeSubnet(ctx context.Context, resourceGroupName, virtualNetwork, subNetwork string) (*aznetwork.Subnet, error)
- func (c *Client) GetControlPlaneSubnet(ctx context.Context, resourceGroupName, virtualNetwork, subNetwork string) (*aznetwork.Subnet, error)
- func (c *Client) GetDiskEncryptionSet(ctx context.Context, subscriptionID, groupName, diskEncryptionSetName string) (*azenc.DiskEncryptionSet, error)
- func (c *Client) GetDiskSkus(ctx context.Context, region string) ([]azsku.ResourceSku, error)
- func (c *Client) GetGroup(ctx context.Context, groupName string) (*azres.Group, error)
- func (c *Client) GetHyperVGenerationVersion(ctx context.Context, instanceType string, region string, imageHyperVGen string) (version string, err error)
- func (c *Client) GetLocationInfo(ctx context.Context, region string, instanceType string) (*azenc.ResourceSkuLocationInfo, error)
- func (c *Client) GetMarketplaceImage(ctx context.Context, region, publisher, offer, sku, version string) (azenc.VirtualMachineImage, error)
- func (c *Client) GetResourcesProvider(ctx context.Context, resourceProviderNamespace string) (*azres.Provider, error)
- func (c *Client) GetStorageEndpointSuffix(ctx context.Context) (string, error)
- func (c *Client) GetVMCapabilities(ctx context.Context, instanceType, region string) (map[string]string, error)
- func (c *Client) GetVirtualMachineFamily(ctx context.Context, name, region string) (string, error)
- func (c *Client) GetVirtualMachineSku(ctx context.Context, name, region string) (*azsku.ResourceSku, error)
- func (c *Client) GetVirtualNetwork(ctx context.Context, resourceGroupName, virtualNetwork string) (*aznetwork.VirtualNetwork, error)
- func (c *Client) ListLocations(ctx context.Context) (*[]azsubs.Location, error)
- func (c *Client) ListResourceIDsByGroup(ctx context.Context, groupName string) ([]string, error)
- type Credentials
- type DNSConfig
- func (config DNSConfig) GetDNSRecordSet(rgName string, zoneName string, relativeRecordSetName string, ...) (*azdns.RecordSet, error)
- func (config DNSConfig) GetDNSZone() (*Zone, error)
- func (config DNSConfig) GetDNSZoneID(rgName string, zoneName string) string
- func (config DNSConfig) GetPrivateDNSZoneID(rgName string, zoneName string) string
- type Metadata
- type RecordSetsClient
- type Session
- type Zone
- type ZonesClient
- type ZonesGetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetHyperVGenerationVersion ¶
func GetHyperVGenerationVersion(capabilities map[string]string, imageHyperVGen string) (string, error)
GetHyperVGenerationVersion returns a HyperVGeneration version compatible with that of the image's. If imageHyperVGen is empty, it returns the highest supported version.
func GetHyperVGenerationVersions ¶
GetHyperVGenerationVersions returns all the HyperVGeneration versions supported by the instance type according to its capabilities as a string set V = {"V1", "V2", ...}
func GetVMNetworkingCapability ¶
GetVMNetworkingCapability returns true if Accelerated networking is supported by the instance type according to its capabilities or false, otherwise
func Validate ¶
func Validate(client API, ic *types.InstallConfig) error
Validate executes platform-specific validation.
func ValidateDiskEncryptionSet ¶
func ValidateDiskEncryptionSet(client API, ic *types.InstallConfig) field.ErrorList
ValidateDiskEncryptionSet ensures the disk encryption set exists and is valid.
func ValidateForProvisioning ¶
func ValidateForProvisioning(client API, ic *types.InstallConfig) error
ValidateForProvisioning validates if the install config is valid for provisioning the cluster.
func ValidateInstanceType ¶
func ValidateInstanceType(client API, fieldPath *field.Path, region, instanceType, diskType string, req resourceRequirements, ultraSSDEnabled bool, vmNetworkingType string, icZones []string, architecture types.Architecture, securityType aztypes.SecurityTypes) field.ErrorList
ValidateInstanceType ensures the instance type has sufficient Vcpu, Memory, and a valid family type.
func ValidatePublicDNS ¶
func ValidatePublicDNS(ic *types.InstallConfig, azureDNS *DNSConfig) error
ValidatePublicDNS checks DNS for CNAME, A, and AAA records for api.zoneName. If a record exists, it's likely a cluster already exists.
func ValidateSecurityProfileDiskEncryptionSet ¶ added in v0.9.153
func ValidateSecurityProfileDiskEncryptionSet(client API, ic *types.InstallConfig) field.ErrorList
ValidateSecurityProfileDiskEncryptionSet ensures the security profile disk encryption set exists and is valid.
Types ¶
type API ¶
type API interface { GetVirtualNetwork(ctx context.Context, resourceGroupName, virtualNetwork string) (*aznetwork.VirtualNetwork, error) GetComputeSubnet(ctx context.Context, resourceGroupName, virtualNetwork, subnet string) (*aznetwork.Subnet, error) GetControlPlaneSubnet(ctx context.Context, resourceGroupName, virtualNetwork, subnet string) (*aznetwork.Subnet, error) ListLocations(ctx context.Context) (*[]azsubs.Location, error) GetResourcesProvider(ctx context.Context, resourceProviderNamespace string) (*azres.Provider, error) GetVirtualMachineSku(ctx context.Context, name, region string) (*azsku.ResourceSku, error) GetVirtualMachineFamily(ctx context.Context, name, region string) (string, error) GetDiskSkus(ctx context.Context, region string) ([]azsku.ResourceSku, error) GetGroup(ctx context.Context, groupName string) (*azres.Group, error) ListResourceIDsByGroup(ctx context.Context, groupName string) ([]string, error) GetStorageEndpointSuffix(ctx context.Context) (string, error) GetDiskEncryptionSet(ctx context.Context, subscriptionID, groupName string, diskEncryptionSetName string) (*azenc.DiskEncryptionSet, error) GetHyperVGenerationVersion(ctx context.Context, instanceType string, region string, imageHyperVGen string) (string, error) GetMarketplaceImage(ctx context.Context, region, publisher, offer, sku, version string) (azenc.VirtualMachineImage, error) AreMarketplaceImageTermsAccepted(ctx context.Context, publisher, offer, sku string) (bool, error) GetVMCapabilities(ctx context.Context, instanceType, region string) (map[string]string, error) GetAvailabilityZones(ctx context.Context, region string, instanceType string) ([]string, error) GetLocationInfo(ctx context.Context, region string, instanceType string) (*azenc.ResourceSkuLocationInfo, error) }
API represents the calls made to the API.
type AuthenticationType ¶ added in v0.9.153
type AuthenticationType int
AuthenticationType identifies the authentication method used.
const ( ClientSecretAuth AuthenticationType = iota ClientCertificateAuth ManagedIdentityAuth )
The authentication types supported by the installer.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client makes calls to the Azure API.
func (*Client) AreMarketplaceImageTermsAccepted ¶
func (c *Client) AreMarketplaceImageTermsAccepted(ctx context.Context, publisher, offer, sku string) (bool, error)
AreMarketplaceImageTermsAccepted tests whether the terms have been accepted for the specified marketplace VM image.
func (*Client) GetAvailabilityZones ¶
func (c *Client) GetAvailabilityZones(ctx context.Context, region string, instanceType string) ([]string, error)
GetAvailabilityZones retrieves a list of availability zones for the given region, and instance type.
func (*Client) GetComputeSubnet ¶
func (c *Client) GetComputeSubnet(ctx context.Context, resourceGroupName, virtualNetwork, subNetwork string) (*aznetwork.Subnet, error)
GetComputeSubnet gets the Azure compute subnet
func (*Client) GetControlPlaneSubnet ¶
func (c *Client) GetControlPlaneSubnet(ctx context.Context, resourceGroupName, virtualNetwork, subNetwork string) (*aznetwork.Subnet, error)
GetControlPlaneSubnet gets the Azure control plane subnet
func (*Client) GetDiskEncryptionSet ¶
func (c *Client) GetDiskEncryptionSet(ctx context.Context, subscriptionID, groupName, diskEncryptionSetName string) (*azenc.DiskEncryptionSet, error)
GetDiskEncryptionSet retrieves the specified disk encryption set.
func (*Client) GetDiskSkus ¶
GetDiskSkus returns all the disk SKU pages for a given region.
func (*Client) GetHyperVGenerationVersion ¶
func (c *Client) GetHyperVGenerationVersion(ctx context.Context, instanceType string, region string, imageHyperVGen string) (version string, err error)
GetHyperVGenerationVersion gets the HyperVGeneration version for the given instance type and marketplace image version, if specified. Defaults to V2 if either V1 or V2 available.
func (*Client) GetLocationInfo ¶
func (c *Client) GetLocationInfo(ctx context.Context, region string, instanceType string) (*azenc.ResourceSkuLocationInfo, error)
GetLocationInfo retrieves the location info associated with the instance type in region
func (*Client) GetMarketplaceImage ¶
func (c *Client) GetMarketplaceImage(ctx context.Context, region, publisher, offer, sku, version string) (azenc.VirtualMachineImage, error)
GetMarketplaceImage get the specified marketplace VM image.
func (*Client) GetResourcesProvider ¶
func (c *Client) GetResourcesProvider(ctx context.Context, resourceProviderNamespace string) (*azres.Provider, error)
GetResourcesProvider gets the Azure resource provider
func (*Client) GetStorageEndpointSuffix ¶
GetStorageEndpointSuffix retrieves the StorageEndpointSuffix from the session environment
func (*Client) GetVMCapabilities ¶
func (c *Client) GetVMCapabilities(ctx context.Context, instanceType, region string) (map[string]string, error)
GetVMCapabilities retrieves the capabilities of an instant type in a specific region. Returns these values in a map with the capability name as the key and the corresponding value.
func (*Client) GetVirtualMachineFamily ¶
GetVirtualMachineFamily retrieves the VM family of an instance type.
func (*Client) GetVirtualMachineSku ¶
func (c *Client) GetVirtualMachineSku(ctx context.Context, name, region string) (*azsku.ResourceSku, error)
GetVirtualMachineSku retrieves the resource SKU of a specified virtual machine SKU in the specified region.
func (*Client) GetVirtualNetwork ¶
func (c *Client) GetVirtualNetwork(ctx context.Context, resourceGroupName, virtualNetwork string) (*aznetwork.VirtualNetwork, error)
GetVirtualNetwork gets an Azure virtual network by name
func (*Client) ListLocations ¶
ListLocations lists the Azure regions dir the given subscription
type Credentials ¶
type Credentials struct { SubscriptionID string `json:"subscriptionId,omitempty"` ClientID string `json:"clientId,omitempty"` ClientSecret string `json:"clientSecret,omitempty"` TenantID string `json:"tenantId,omitempty"` ClientCertificatePath string `json:"clientCertificate,omitempty"` ClientCertificatePassword string `json:"clientCertificatePassword,omitempty"` }
Credentials is the data type for credentials as understood by the azure sdk
type DNSConfig ¶
type DNSConfig struct {
// contains filtered or unexported fields
}
DNSConfig exposes functions to choose the DNS settings
func NewDNSConfig ¶
NewDNSConfig returns a new DNSConfig struct that helps configuring the DNS by querying your subscription and letting you choose which domain you wish to use for the cluster
func (DNSConfig) GetDNSRecordSet ¶
func (config DNSConfig) GetDNSRecordSet(rgName string, zoneName string, relativeRecordSetName string, recordType azdns.RecordType) (*azdns.RecordSet, error)
GetDNSRecordSet gets a record set for the zone identified by publicZoneID
func (DNSConfig) GetDNSZone ¶
GetDNSZone returns a DNS zone selected by survey
func (DNSConfig) GetDNSZoneID ¶
GetDNSZoneID returns the Azure DNS zone resourceID by interpolating the subscriptionID, the resource group and the zone name
type Metadata ¶
type Metadata struct { // CloudName indicates the Azure cloud environment (e.g. public, gov't). CloudName typesazure.CloudEnvironment `json:"cloudName,omitempty"` // ARMEndpoint indicates the resource management API endpoint used by AzureStack. ARMEndpoint string `json:"armEndpoint,omitempty"` // Credentials hold prepopulated Azure credentials. // At the moment the installer doesn't use it and reads credentials // from the file system, but external consumers of the package can // provide credentials. This is useful when we run the installer // as a service (Azure Red Hat OpenShift, for example): in this case // we do not want to rely on the filesystem or user input as we // serve multiple users with different credentials via a web server. Credentials *Credentials `json:"credentials,omitempty"` // contains filtered or unexported fields }
Metadata holds additional metadata for InstallConfig resources that does not need to be user-supplied (e.g. because it can be retrieved from external APIs).
func NewMetadata ¶
func NewMetadata(cloudName typesazure.CloudEnvironment, armEndpoint string) *Metadata
NewMetadata initializes a new Metadata object.
func NewMetadataWithCredentials ¶
func NewMetadataWithCredentials(cloudName typesazure.CloudEnvironment, armEndpoint string, credentials *Credentials) *Metadata
NewMetadataWithCredentials initializes a new Metadata object with prepopulated Azure credentials.
type RecordSetsClient ¶
type RecordSetsClient struct {
// contains filtered or unexported fields
}
RecordSetsClient wraps the azure RecordSetsClient internal
func (*RecordSetsClient) GetRecordSet ¶
func (client *RecordSetsClient) GetRecordSet(rgName string, zoneName string, relativeRecordSetName string, recordType azdns.RecordType) (*azdns.RecordSet, error)
GetRecordSet gets an Azure DNS recordset by zone, name and recordset type
type Session ¶
type Session struct { Authorizer autorest.Authorizer Credentials Credentials Environment azureenv.Environment AuthProvider *azurekiota.AzureIdentityAuthenticationProvider TokenCreds azcore.TokenCredential CloudConfig cloud.Configuration AuthType AuthenticationType }
Session is an object representing session for subscription
func GetSession ¶
func GetSession(cloudName azure.CloudEnvironment, armEndpoint string) (*Session, error)
GetSession returns an azure session by using credentials found in ~/.azure/osServicePrincipal.json and, if no creds are found, asks for them and stores them on disk in a config file
func GetSessionWithCredentials ¶
func GetSessionWithCredentials(cloudName azure.CloudEnvironment, armEndpoint string, credentials *Credentials) (*Session, error)
GetSessionWithCredentials returns an Azure session by using prepopulated credentials. If there are no prepopulated credentials it falls back to reading credentials from file system or from user input.
type ZonesClient ¶
type ZonesClient struct {
// contains filtered or unexported fields
}
ZonesClient wraps the azure ZonesClient internal
func (*ZonesClient) GetAllPublicZones ¶
func (client *ZonesClient) GetAllPublicZones() (map[string]string, error)
GetAllPublicZones get all public zones from the current subscription
type ZonesGetter ¶
ZonesGetter fetches the DNS zones available for the installer