azure

package
v3.0.0-...-d6c4d9c Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// FinalizerSecurityGroup will instruct the deletion of the security group.
	FinalizerSecurityGroup = "kubermatic.k8c.io/cleanup-azure-security-group"
	// FinalizerRouteTable will instruct the deletion of the route table.
	FinalizerRouteTable = "kubermatic.k8c.io/cleanup-azure-route-table"
	// FinalizerSubnet will instruct the deletion of the subnet.
	FinalizerSubnet = "kubermatic.k8c.io/cleanup-azure-subnet"
	// FinalizerVNet will instruct the deletion of the virtual network.
	FinalizerVNet = "kubermatic.k8c.io/cleanup-azure-vnet"
	// FinalizerResourceGroup will instruct the deletion of the resource group.
	FinalizerResourceGroup = "kubermatic.k8c.io/cleanup-azure-resource-group"
	// FinalizerAvailabilitySet will instruct the deletion of the availability set.
	FinalizerAvailabilitySet = "kubermatic.k8c.io/cleanup-azure-availability-set"
)

Variables

This section is empty.

Functions

func GetVMSize

func GetVMSize(ctx context.Context, credentials Credentials, location, vmName string) (*provider.NodeCapacity, error)

func ValidateCredentials

func ValidateCredentials(ctx context.Context, credentials *azidentity.ClientSecretCredential, subscriptionID string) error

Types

type AvailabilitySetClient

type AvailabilitySetClient interface {
	CreateOrUpdate(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters armcompute.AvailabilitySet, options *armcompute.AvailabilitySetsClientCreateOrUpdateOptions) (armcompute.AvailabilitySetsClientCreateOrUpdateResponse, error)
	Get(ctx context.Context, resourceGroupName string, availabilitySetName string, options *armcompute.AvailabilitySetsClientGetOptions) (armcompute.AvailabilitySetsClientGetResponse, error)
	Delete(ctx context.Context, resourceGroupName string, availabilitySetName string, options *armcompute.AvailabilitySetsClientDeleteOptions) (armcompute.AvailabilitySetsClientDeleteResponse, error)
}

AvailabilitySetClient is the subset of functions we need from armcompute.AvailabilitySetsClient; this interface is purely here for allowing unit tests.

type Azure

type Azure struct {
	// contains filtered or unexported fields
}

func New

New returns a new Azure provider.

func (*Azure) CleanUpCloudProvider

func (a *Azure) CleanUpCloudProvider(ctx context.Context, cluster *kubermaticv1.Cluster, update provider.ClusterUpdater) (*kubermaticv1.Cluster, error)

func (*Azure) DefaultCloudSpec

func (a *Azure) DefaultCloudSpec(ctx context.Context, clusterSpec *kubermaticv1.ClusterSpec) error

func (*Azure) InitializeCloudProvider

func (a *Azure) InitializeCloudProvider(ctx context.Context, cluster *kubermaticv1.Cluster, update provider.ClusterUpdater) (*kubermaticv1.Cluster, error)

func (*Azure) ReconcileCluster

func (a *Azure) ReconcileCluster(ctx context.Context, cluster *kubermaticv1.Cluster, update provider.ClusterUpdater) (*kubermaticv1.Cluster, error)

func (*Azure) ValidateCloudSpec

func (a *Azure) ValidateCloudSpec(ctx context.Context, cloud kubermaticv1.CloudSpec) error

func (*Azure) ValidateCloudSpecUpdate

func (a *Azure) ValidateCloudSpecUpdate(_ context.Context, oldSpec kubermaticv1.CloudSpec, newSpec kubermaticv1.CloudSpec) error

ValidateCloudSpecUpdate verifies whether an update of cloud spec is valid and permitted.

type ClientSet

type ClientSet struct {
	Groups           ResourceGroupClient
	Networks         NetworkClient
	Subnets          SubnetClient
	RouteTables      RouteTableClient
	SecurityGroups   SecurityGroupClient
	AvailabilitySets AvailabilitySetClient
}

ClientSet provides a set of Azure service clients that are necessary to reconcile resources needed by KKP.

func GetClientSet

func GetClientSet(credentials Credentials) (*ClientSet, error)

GetClientSet returns a ClientSet using the passed credentials as authorization.

type Credentials

type Credentials struct {
	TenantID       string
	SubscriptionID string
	ClientID       string
	ClientSecret   string
}

func GetCredentialsForCluster

func GetCredentialsForCluster(cloud kubermaticv1.CloudSpec, secretKeySelector provider.SecretKeySelectorValueFunc) (Credentials, error)

GetCredentialsForCluster returns the credentials for the passed in cloud spec or an error.

func (Credentials) ToAzureCredential

func (c Credentials) ToAzureCredential() (*azidentity.ClientSecretCredential, error)

type NetworkClient

type NetworkClient interface {
	BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters armnetwork.VirtualNetwork, options *armnetwork.VirtualNetworksClientBeginCreateOrUpdateOptions) (*runtime.Poller[armnetwork.VirtualNetworksClientCreateOrUpdateResponse], error)
	Get(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *armnetwork.VirtualNetworksClientGetOptions) (armnetwork.VirtualNetworksClientGetResponse, error)
	BeginDelete(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *armnetwork.VirtualNetworksClientBeginDeleteOptions) (*runtime.Poller[armnetwork.VirtualNetworksClientDeleteResponse], error)
}

NetworkClient is the subset of functions we need from armnetwork.VirtualNetworksClient; this interface is purely here for allowing unit tests.

type ResourceGroupClient

ResourceGroupClient is the subset of functions we need from armresources.VirtualResourceGroupsClient; this interface is purely here for allowing unit tests.

type RouteTableClient

type RouteTableClient interface {
	BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, routeTableName string, parameters armnetwork.RouteTable, options *armnetwork.RouteTablesClientBeginCreateOrUpdateOptions) (*runtime.Poller[armnetwork.RouteTablesClientCreateOrUpdateResponse], error)
	Get(ctx context.Context, resourceGroupName string, routeTableName string, options *armnetwork.RouteTablesClientGetOptions) (armnetwork.RouteTablesClientGetResponse, error)
	BeginDelete(ctx context.Context, resourceGroupName string, routeTableName string, options *armnetwork.RouteTablesClientBeginDeleteOptions) (*runtime.Poller[armnetwork.RouteTablesClientDeleteResponse], error)
}

RouteTableClient is the subset of functions we need from armnetwork.RouteTablesClient; this interface is purely here for allowing unit tests.

type SecurityGroupClient

type SecurityGroupClient interface {
	BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters armnetwork.SecurityGroup, options *armnetwork.SecurityGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[armnetwork.SecurityGroupsClientCreateOrUpdateResponse], error)
	Get(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, options *armnetwork.SecurityGroupsClientGetOptions) (armnetwork.SecurityGroupsClientGetResponse, error)
	BeginDelete(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, options *armnetwork.SecurityGroupsClientBeginDeleteOptions) (*runtime.Poller[armnetwork.SecurityGroupsClientDeleteResponse], error)
}

SecurityGroupClient is the subset of functions we need from armnetwork.SecurityGroupsClient; this interface is purely here for allowing unit tests.

type SubnetClient

type SubnetClient interface {
	BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, subnetParameters armnetwork.Subnet, options *armnetwork.SubnetsClientBeginCreateOrUpdateOptions) (*runtime.Poller[armnetwork.SubnetsClientCreateOrUpdateResponse], error)
	Get(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *armnetwork.SubnetsClientGetOptions) (armnetwork.SubnetsClientGetResponse, error)
	BeginDelete(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *armnetwork.SubnetsClientBeginDeleteOptions) (*runtime.Poller[armnetwork.SubnetsClientDeleteResponse], error)
}

SubnetClient is the subset of functions we need from armnetwork.SubnetsClient; this interface is purely here for allowing unit tests.

Jump to

Keyboard shortcuts

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