Documentation ¶
Index ¶
- Variables
- func GetAzCred() (azcore.TokenCredential, error)
- func LoadAks(id azure.Resource, dnsServiceIp, location, principalId, clientId string, ...) *aks
- func LoadPrivateZone(id azure.Resource) *privateZone
- func LoadRg(id arm.ResourceID) *rg
- func LoadZone(id azure.Resource, nameservers []string) *zone
- func NewAks(ctx context.Context, subscriptionId, resourceGroup, name, location string, ...) (*aks, error)
- func NewNginxDeployment() *appsv1.Deployment
- func NewNginxServices(zoneName string) (*corev1.Service, *corev1.Service)
- func NewPrivateZone(ctx context.Context, subscriptionId, resourceGroup, name string, ...) (*privateZone, error)
- func NewResourceGroup(ctx context.Context, subscriptionId, name, location string, rgOpts ...RgOpt) (*rg, error)
- func NewRoleAssignment(ctx context.Context, subscriptionId, scope, principalId string, role Role) (*roleAssignment, error)
- func NewVnet(ctx context.Context, subId, rg, region, privateZoneName string) (string, string, error)
- func NewZone(ctx context.Context, subscriptionId, resourceGroup, name string, ...) (*zone, error)
- func WithPreferSystemNodes(spec *corev1.PodSpec) *corev1.PodSpec
- type McOpt
- type PrivateZoneOpt
- type RgOpt
- type Role
- type ZoneOpt
Constants ¶
This section is empty.
Variables ¶
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", } )
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 ¶
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 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 ¶
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
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 ¶
Used for testing purposes: deletes resource group after specified duration