azure

package
v0.9.0-master.0...-3485fdd Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package azure contains Azure-specific structures for installer configuration and management.

Index

Constants

View Source
const DefaultDiskType string = "Premium_LRS"

DefaultDiskType holds the default Azure disk type used by the VMs.

View Source
const Name string = "azure"

Name is the name for the Azure platform.

View Source
const StackTerraformName string = "azurestack"

StackTerraformName is the name used for Terraform code when installing to the Azure Stack platform.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudEnvironment

type CloudEnvironment string

CloudEnvironment is the name of the Azure cloud environment +kubebuilder:validation:Enum="";AzurePublicCloud;AzureUSGovernmentCloud;AzureChinaCloud;AzureGermanCloud;AzureStackCloud

const (
	// PublicCloud is the general-purpose, public Azure cloud environment.
	PublicCloud CloudEnvironment = "AzurePublicCloud"

	// USGovernmentCloud is the Azure cloud environment for the US government.
	USGovernmentCloud CloudEnvironment = "AzureUSGovernmentCloud"

	// ChinaCloud is the Azure cloud environment used in China.
	ChinaCloud CloudEnvironment = "AzureChinaCloud"

	// GermanCloud is the Azure cloud environment used in Germany.
	GermanCloud CloudEnvironment = "AzureGermanCloud"

	// StackCloud is the Azure cloud environment used at the edge and on premises.
	StackCloud CloudEnvironment = "AzureStackCloud"
)

func (CloudEnvironment) Name

func (e CloudEnvironment) Name() string

Name returns name that Azure uses for the cloud environment. See https://github.com/Azure/go-autorest/blob/ec5f4903f77ed9927ac95b19ab8e44ada64c1356/autorest/azure/environments.go#L13

type DiskEncryptionSet

type DiskEncryptionSet struct {
	// SubscriptionID defines the Azure subscription the disk encryption
	// set is in.
	SubscriptionID string `json:"subscriptionId,omitempty"`
	// ResourceGroup defines the Azure resource group used by the disk
	// encryption set.
	ResourceGroup string `json:"resourceGroup"`
	// Name is the name of the disk encryption set.
	Name string `json:"name"`
}

DiskEncryptionSet defines the configuration for a disk encryption set.

func (*DiskEncryptionSet) ToID

func (d *DiskEncryptionSet) ToID() string

ToID creates an Azure resource ID for the disk encryption set. It is possible to return a non-valid ID when SubscriptionID is empty. This should never happen since if SubscriptionID is empty, it is set to the current subscription. Also, should it somehow be empty and this returns an invalid ID, the validation code will produce an error when checked against the validation.RxDiskEncryptionSetID regular expression.

type MachinePool

type MachinePool struct {
	// Zones is list of availability zones that can be used.
	// eg. ["1", "2", "3"]
	//
	// +optional
	Zones []string `json:"zones,omitempty"`

	// InstanceType defines the azure instance type.
	// eg. Standard_DS_V2
	//
	// +optional
	InstanceType string `json:"type"`

	// EncryptionAtHost enables encryption at the VM host.
	//
	// +optional
	EncryptionAtHost bool `json:"encryptionAtHost,omitempty"`

	// OSDisk defines the storage for instance.
	//
	// +optional
	OSDisk `json:"osDisk"`

	// ultraSSDCapability defines if the instance should use Ultra SSD disks.
	//
	// +optional
	// +kubebuilder:validation:Enum=Enabled;Disabled
	UltraSSDCapability string `json:"ultraSSDCapability,omitempty"`

	// VMNetworkingType specifies whether to enable accelerated networking.
	// Accelerated networking enables single root I/O virtualization (SR-IOV) to a VM, greatly improving its
	// networking performance.
	// eg. values: "Accelerated", "Basic"
	//
	// +kubebuilder:validation:Enum="Accelerated"; "Basic"
	// +optional
	VMNetworkingType string `json:"vmNetworkingType,omitempty"`

	// OSImage defines the image to use for the OS.
	// +optional
	OSImage OSImage `json:"osImage,omitempty"`
}

MachinePool stores the configuration for a machine pool installed on Azure.

func (*MachinePool) Set

func (a *MachinePool) Set(required *MachinePool)

Set sets the values from `required` to `a`.

type Metadata

type Metadata struct {
	ARMEndpoint                 string           `json:"armEndpoint"`
	CloudName                   CloudEnvironment `json:"cloudName"`
	Region                      string           `json:"region"`
	ResourceGroupName           string           `json:"resourceGroupName"`
	BaseDomainResourceGroupName string           `json:"baseDomainResourceGroupName"`
}

Metadata contains Azure metadata (e.g. for uninstalling the cluster).

type OSDisk

type OSDisk struct {
	// DiskSizeGB defines the size of disk in GB.
	//
	// +kubebuilder:validation:Minimum=0
	DiskSizeGB int32 `json:"diskSizeGB"`
	// DiskType defines the type of disk.
	// For control plane nodes, the valid values are Premium_LRS and StandardSSD_LRS.
	// Default is Premium_LRS.
	// +optional
	// +kubebuilder:validation:Enum=Standard_LRS;Premium_LRS;StandardSSD_LRS
	DiskType string `json:"diskType"`

	// DiskEncryptionSet defines a disk encryption set.
	//
	// +optional
	*DiskEncryptionSet `json:"diskEncryptionSet,omitempty"`
}

OSDisk defines the disk for machines on Azure.

type OSImage

type OSImage struct {
	// Publisher is the publisher of the image.
	Publisher string `json:"publisher"`
	// Offer is the offer of the image.
	Offer string `json:"offer"`
	// SKU is the SKU of the image.
	SKU string `json:"sku"`
	// Version is the version of the image.
	Version string `json:"version"`
}

OSImage is the image to use for the OS of a machine.

type OutboundType

type OutboundType string

OutboundType is a strategy for how egress from cluster is achieved. +kubebuilder:validation:Enum="";Loadbalancer;UserDefinedRouting

const (
	// LoadbalancerOutboundType uses Standard loadbalancer for egress from the cluster.
	// see https://docs.microsoft.com/en-us/azure/load-balancer/load-balancer-outbound-connections#lb
	LoadbalancerOutboundType OutboundType = "Loadbalancer"

	// UserDefinedRoutingOutboundType uses user defined routing for egress from the cluster.
	// see https://docs.microsoft.com/en-us/azure/virtual-network/virtual-networks-udr-overview
	UserDefinedRoutingOutboundType OutboundType = "UserDefinedRouting"
)

type Platform

type Platform struct {
	// Region specifies the Azure region where the cluster will be created.
	Region string `json:"region"`

	// ARMEndpoint is the endpoint for the Azure API when installing on Azure Stack.
	ARMEndpoint string `json:"armEndpoint,omitempty"`

	// ClusterOSImage is the url of a storage blob in the Azure Stack environment containing an RHCOS VHD. This field is required for Azure Stack and not applicable to Azure.
	ClusterOSImage string `json:"clusterOSImage,omitempty"`

	// BaseDomainResourceGroupName specifies the resource group where the Azure DNS zone for the base domain is found. This field is optional when creating a private cluster, otherwise required.
	//
	// +optional
	BaseDomainResourceGroupName string `json:"baseDomainResourceGroupName,omitempty"`

	// DefaultMachinePlatform is the default configuration used when
	// installing on Azure for machine pools which do not define their own
	// platform configuration.
	// +optional
	DefaultMachinePlatform *MachinePool `json:"defaultMachinePlatform,omitempty"`

	// NetworkResourceGroupName specifies the network resource group that contains an existing VNet
	//
	// +optional
	NetworkResourceGroupName string `json:"networkResourceGroupName,omitempty"`

	// VirtualNetwork specifies the name of an existing VNet for the installer to use
	//
	// +optional
	VirtualNetwork string `json:"virtualNetwork,omitempty"`

	// ControlPlaneSubnet specifies an existing subnet for use by the control plane nodes
	//
	// +optional
	ControlPlaneSubnet string `json:"controlPlaneSubnet,omitempty"`

	// ComputeSubnet specifies an existing subnet for use by compute nodes
	//
	// +optional
	ComputeSubnet string `json:"computeSubnet,omitempty"`

	// cloudName is the name of the Azure cloud environment which can be used to configure the Azure SDK
	// with the appropriate Azure API endpoints.
	// If empty, the value is equal to "AzurePublicCloud".
	// +optional
	CloudName CloudEnvironment `json:"cloudName,omitempty"`

	// OutboundType is a strategy for how egress from cluster is achieved. When not specified default is "Loadbalancer".
	//
	// +kubebuilder:default=Loadbalancer
	// +optional
	OutboundType OutboundType `json:"outboundType"`

	// ResourceGroupName is the name of an already existing resource group where the cluster should be installed.
	// This resource group should only be used for this specific cluster and the cluster components will assume
	// ownership of all resources in the resource group. Destroying the cluster using installer will delete this
	// resource group.
	// This resource group must be empty with no other resources when trying to use it for creating a cluster.
	// If empty, a new resource group will created for the cluster.
	//
	// +optional
	ResourceGroupName string `json:"resourceGroupName,omitempty"`

	// UserTags has additional keys and values that the installer will add
	// as tags to all resources that it creates on AzurePublicCloud alone.
	// Resources created by the cluster itself may not include these tags.
	// This is a TechPreview feature and requires setting featureSet to
	// TechPreviewNoUpgrade to configure the tags.
	// +optional
	UserTags map[string]string `json:"userTags,omitempty"`
}

Platform stores all the global configuration that all machinesets use.

func (*Platform) ClusterResourceGroupName

func (p *Platform) ClusterResourceGroupName(infraID string) string

ClusterResourceGroupName returns the name of the resource group for the cluster.

func (*Platform) IsARO

func (p *Platform) IsARO() bool

IsARO returns true if ARO-only modifications are enabled

func (*Platform) SetBaseDomain

func (p *Platform) SetBaseDomain(baseDomainID string) error

SetBaseDomain parses the baseDomainID and sets the related fields on azure.Platform

type VMNetworkingCapability

type VMNetworkingCapability string

VMNetworkingCapability defines the states for accelerated networking feature

const (
	// AcceleratedNetworkingEnabled is string representation of the VMNetworkingType / AcceleratedNetworking Capability
	// provided by the Azure API
	AcceleratedNetworkingEnabled = "AcceleratedNetworkingEnabled"

	// VMNetworkingTypeBasic enum attribute that is the default setting which means AcceleratedNetworking is disabled.
	VMNetworkingTypeBasic VMNetworkingCapability = "Basic"

	// VMnetworkingTypeAccelerated enum attribute that enables AcceleratedNetworking on a VM NIC.
	VMnetworkingTypeAccelerated VMNetworkingCapability = "Accelerated"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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