clients

package
v0.0.0-...-96a9b75 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DnsContributorRole = Role{
		Name: "DNS Zone Contributor",
		Id:   "/subscriptions/%s/providers/Microsoft.Authorization/roleDefinitions/befefa01-2a29-4197-83a8-272ff33ce314",
	}
	PrivateDnsContributorRole = Role{
		Name: "Private DNS Zone Contributor",
		Id:   "/subscriptions/%s/providers/Microsoft.Authorization/roleDefinitions/b12aa53e-6015-4669-85d0-8515ebb3ae7f",
	}
	NetworkContributorRole = Role{
		Name: "Network Contributor",
		Id:   "/subscriptions/%s/providers/Microsoft.Authorization/roleDefinitions/b34d265f-36f7-4a0d-a4d4-e158ca92e90f",
	}
)
View Source
var PrivateClusterOpt = McOpt{
	Name: "private cluster",
	// contains filtered or unexported fields
}

PrivateClusterOpt specifies that the cluster should be private

Functions

func GetAzCred

func GetAzCred() (azcore.TokenCredential, error)

Uses NewAzureCLICredential, returns creds used to provision all infrastructure and create clients used in tests

func LoadAks

func LoadAks(id azure.Resource, dnsServiceIp, location, principalId, clientId string, options map[string]struct{}) *aks

Retrieves objects from infastructure file to create aks instance

func LoadPrivateZone

func LoadPrivateZone(id azure.Resource) *privateZone

Loads provisioned private zone, used to convert .json saved to infrastructure file to a Provisioned object

func LoadRg

func LoadRg(id arm.ResourceID) *rg

Called when loading provisioned infrastructure from .json file, returns an rg struct

func LoadZone

func LoadZone(id azure.Resource, nameservers []string) *zone

Called to create Provisioned object from .json file

func NewAks

func NewAks(ctx context.Context, subscriptionId, resourceGroup, name, location string, subnetId string, mcOpts ...McOpt) (*aks, error)

Creates a new public or private cluster based on mcOpt provided, saves properties in aks struct

func NewNginxDeployment

func NewNginxDeployment() *appsv1.Deployment

Returns manifest for a basic nginx deployment

func NewNginxServices

func NewNginxServices(zoneName string) (*corev1.Service, *corev1.Service)

Returns nginx services with necessary config to create ipv4 and ipv6 records

func NewPrivateZone

func NewPrivateZone(ctx context.Context, subscriptionId, resourceGroup, name string, opts ...PrivateZoneOpt) (*privateZone, error)

Creates a private zone used in testing

func NewResourceGroup

func NewResourceGroup(ctx context.Context, subscriptionId, name, location string, rgOpts ...RgOpt) (*rg, error)

Creates a new resource group with specified options vis rgOpts. Location used by all resources is specified in infra > infras.go

func NewRoleAssignment

func NewRoleAssignment(ctx context.Context, subscriptionId, scope, principalId string, role Role) (*roleAssignment, error)

Returns a new role assignment to assign to a provisoined infra using the provisioned cluster's principal id

func NewVnet

func NewVnet(ctx context.Context, subId, rg, region, privateZoneName string) (string, string, error)

func NewZone

func NewZone(ctx context.Context, subscriptionId, resourceGroup, name string, zoneOpts ...ZoneOpt) (*zone, error)

Returns a private or public zone (based on zoneOpts) with the given name, creates and returns zone struct or an error if one occurred

func WithPreferSystemNodes

func WithPreferSystemNodes(spec *corev1.PodSpec) *corev1.PodSpec

Types

type McOpt

type McOpt struct {
	Name string
	// contains filtered or unexported fields
}

McOpt specifies what kind of managed cluster to create

type PrivateZoneOpt

type PrivateZoneOpt func(z *armprivatedns.PrivateZone) error

PrivateZoneOpt specifies what kind of private zone to create

type RgOpt

type RgOpt func(rg *armresources.ResourceGroup) error

func DeleteAfterOpt

func DeleteAfterOpt(d time.Duration) RgOpt

Used for testing purposes: deletes resource group after specified duration

type Role

type Role struct {
	Name string
	// format string with a single %s for the subscription id
	Id string
}

type ZoneOpt

type ZoneOpt func(z *armdns.Zone) error

ZoneOpt specifies what kind of zone to create

Jump to

Keyboard shortcuts

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