azure

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultUserName is the default username for created vm
	DefaultUserName = "capi"
	// DefaultVnetCIDR is the default Vnet CIDR
	DefaultVnetCIDR = "10.0.0.0/8"
	// DefaultControlPlaneSubnetCIDR is the default Control Plane Subnet CIDR
	DefaultControlPlaneSubnetCIDR = "10.0.0.0/16"
	// DefaultNodeSubnetCIDR is the default Node Subnet CIDR
	DefaultNodeSubnetCIDR = "10.1.0.0/16"
	// DefaultInternalLBIPAddress is the default internal load balancer ip address
	DefaultInternalLBIPAddress = "10.0.0.100"
	// DefaultAzureDNSZone is the default provided azure dns zone
	DefaultAzureDNSZone = "cloudapp.azure.com"
	// UserAgent used for communicating with azure
	UserAgent = "cluster-api-azure-services"
)
View Source
const (
	// DefaultImageOfferID is the default Azure Marketplace offer ID
	DefaultImageOfferID = "capi"
	// DefaultImagePublisherID is the default Azure Marketplace publisher ID
	DefaultImagePublisherID = "cncf-upstream"
	// LatestVersion is the image version latest
	LatestVersion = "latest"
)

Variables

View Source
var SupportedAvailabilityZoneLocations = []string{

	"centralus",
	"eastus",
	"eastus2",
	"westus2",

	"francecentral",
	"northeurope",
	"uksouth",
	"westeurope",

	"japaneast",
	"southeastasia",
}

SupportedAvailabilityZoneLocations is a slice of the locations where Availability Zones are supported. This is used to validate whether a virtual machine should leverage an Availability Zone. Based on the Availability Zones listed in https://docs.microsoft.com/en-us/azure/availability-zones/az-overview

Functions

func GenerateControlPlaneSecurityGroupName

func GenerateControlPlaneSecurityGroupName(clusterName string) string

GenerateControlPlaneSecurityGroupName generates a control plane security group name, based on the cluster name.

func GenerateControlPlaneSubnetName

func GenerateControlPlaneSubnetName(clusterName string) string

GenerateControlPlaneSubnetName generates a node subnet name, based on the cluster name.

func GenerateFQDN

func GenerateFQDN(publicIPName, location string) string

GenerateFQDN generates a fully qualified domain name, based on the public IP name and cluster location.

func GenerateInternalLBName

func GenerateInternalLBName(clusterName string) string

GenerateInternalLBName generates a internal load balancer name, based on the cluster name.

func GenerateNICName

func GenerateNICName(machineName string) string

GenerateNICName generates the name of a network interface based on the name of a VM.

func GenerateNodeRouteTableName

func GenerateNodeRouteTableName(clusterName string) string

GenerateNodeRouteTableName generates a node route table name, based on the cluster name.

func GenerateNodeSecurityGroupName

func GenerateNodeSecurityGroupName(clusterName string) string

GenerateNodeSecurityGroupName generates a node security group name, based on the cluster name.

func GenerateNodeSubnetName

func GenerateNodeSubnetName(clusterName string) string

GenerateNodeSubnetName generates a node subnet name, based on the cluster name.

func GenerateOSDiskName

func GenerateOSDiskName(machineName string) string

GenerateOSDiskName generates the name of an OS disk based on the name of a VM.

func GeneratePublicIPName

func GeneratePublicIPName(clusterName, hash string) string

GeneratePublicIPName generates a public IP name, based on the cluster name and a hash.

func GeneratePublicLBName

func GeneratePublicLBName(clusterName string) string

GeneratePublicLBName generates a public load balancer name, based on the cluster name.

func GenerateVnetName

func GenerateVnetName(clusterName string) string

GenerateVnetName generates a virtual network name, based on the cluster name.

func GetDefaultUbuntuImage

func GetDefaultUbuntuImage(k8sVersion string) (infrav1.Image, error)

GetDefaultUbuntuImage returns the default image spec for Ubuntu.

func ResourceNotFound

func ResourceNotFound(err error) bool

ResourceNotFound parses the error to check if it's a resource not found

Types

type FakeCachedService

type FakeCachedService struct {
	Cache *map[string]int
}

FakeCachedService updates the cache with name whenever reconcile is called

func (*FakeCachedService) Delete

func (s *FakeCachedService) Delete(ctx context.Context, spec interface{}) error

Delete returns fake success.

func (*FakeCachedService) Get

func (s *FakeCachedService) Get(ctx context.Context, spec interface{}) (interface{}, error)

Get returns fake success.

func (*FakeCachedService) Reconcile

func (s *FakeCachedService) Reconcile(ctx context.Context, spec interface{}) error

Reconcile returns fake success.

type FakeFailureService

type FakeFailureService struct {
}

FakeFailureService generic service which always returns failure.

func (*FakeFailureService) Delete

func (s *FakeFailureService) Delete(ctx context.Context, spec interface{}) error

Delete returns fake failure.

func (*FakeFailureService) Get

func (s *FakeFailureService) Get(ctx context.Context, spec interface{}) (interface{}, error)

Get returns fake failure.

func (*FakeFailureService) Reconcile

func (s *FakeFailureService) Reconcile(ctx context.Context, spec interface{}) error

Reconcile returns fake failure.

type FakeNotFoundService

type FakeNotFoundService struct {
}

FakeNotFoundService generic service which always returns not found

func (*FakeNotFoundService) Delete

func (s *FakeNotFoundService) Delete(ctx context.Context, spec interface{}) error

Delete returns fake not found.

func (*FakeNotFoundService) Get

func (s *FakeNotFoundService) Get(ctx context.Context, spec interface{}) (interface{}, error)

Get returns fake not found.

func (*FakeNotFoundService) Reconcile

func (s *FakeNotFoundService) Reconcile(ctx context.Context, spec interface{}) error

Reconcile returns fake not found.

type FakeStruct

type FakeStruct struct {
}

FakeStruct fakes return for Get

type FakeSuccessService

type FakeSuccessService struct {
}

FakeSuccessService generic service which always returns success.

func (*FakeSuccessService) Delete

func (s *FakeSuccessService) Delete(ctx context.Context, spec interface{}) error

Delete returns fake success.

func (*FakeSuccessService) Get

func (s *FakeSuccessService) Get(ctx context.Context, spec interface{}) (interface{}, error)

Get returns fake success.

func (*FakeSuccessService) Reconcile

func (s *FakeSuccessService) Reconcile(ctx context.Context, spec interface{}) error

Reconcile returns fake success.

type GetterService

type GetterService interface {
	Get(ctx context.Context, spec interface{}) (interface{}, error)
	Reconcile(ctx context.Context, spec interface{}) error
	Delete(ctx context.Context, spec interface{}) error
}

GetterService is a temporary interface used by components which still require Get methods. Once all components move to storing provider information within the relevant Cluster/Machine specs, this interface should be removed.

type Service

type Service interface {
	Reconcile(ctx context.Context, spec interface{}) error
	Delete(ctx context.Context, spec interface{}) error
}

Service is a generic interface used by components offering a type of service. Example: virtualnetworks service would offer Reconcile/Delete methods.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
services
availabilityzones/mock_availabilityzones
Package mock_availabilityzones is a generated GoMock package.
Package mock_availabilityzones is a generated GoMock package.
disks/mock_disks
Package mock_disks is a generated GoMock package.
Package mock_disks is a generated GoMock package.
groups/mock_groups
Run go generate to regenerate this mock.
Run go generate to regenerate this mock.
internalloadbalancers/mock_internalloadbalancers
Run go generate to regenerate this mock.
Run go generate to regenerate this mock.
networkinterfaces/mock_networkinterfaces
Run go generate to regenerate this mock.
Run go generate to regenerate this mock.
publicips/mock_publicips
Run go generate to regenerate this mock.
Run go generate to regenerate this mock.
publicloadbalancers/mock_publicloadbalancers
Run go generate to regenerate this mock.
Run go generate to regenerate this mock.
routetables/mock_routetables
Run go generate to regenerate this mock.
Run go generate to regenerate this mock.
securitygroups/mock_securitygroups
Run go generate to regenerate this mock.
Run go generate to regenerate this mock.
subnets/mock_subnets
Run go generate to regenerate this mock.
Run go generate to regenerate this mock.
virtualmachineextensions/mock_virtualmachineextensions
Run go generate to regenerate this mock.
Run go generate to regenerate this mock.
virtualmachines/mock_virtualmachines
Run go generate to regenerate this mock.
Run go generate to regenerate this mock.
virtualnetworks/mock_virtualnetworks
Run go generate to regenerate this mock.
Run go generate to regenerate this mock.

Jump to

Keyboard shortcuts

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