vlabs

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2018 License: MIT Imports: 10 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package vlabs stores an experimental api model for acs

Index

Constants

View Source
const (
	// MinAgentCount are the minimum number of agents per agent pool
	MinAgentCount = 1
	// MaxAgentCount are the maximum number of agents per agent pool
	MaxAgentCount = 100
	// MinPort specifies the minimum tcp port to open
	MinPort = 1
	// MaxPort specifies the maximum tcp port to open
	MaxPort = 65535
	// MaxDisks specifies the maximum attached disks to add to the cluster
	MaxDisks = 4
	// MinDiskSizeGB specifies the minimum attached disk size
	MinDiskSizeGB = 1
	// MaxDiskSizeGB specifies the maximum attached disk size
	MaxDiskSizeGB = 1023
	// MinIPAddressCount specifies the minimum number of IP addresses per network interface
	MinIPAddressCount = 1
	// MaxIPAddressCount specifies the maximum number of IP addresses per network interface
	MaxIPAddressCount = 256
)

validation values

View Source
const (
	// AvailabilitySet means that the vms are in an availability set
	AvailabilitySet = "AvailabilitySet"
	// VirtualMachineScaleSets means that the vms are in a virtual machine scaleset
	VirtualMachineScaleSets = "VirtualMachineScaleSets"
)

Availability profiles

View Source
const (
	// StorageAccount means that the nodes use raw storage accounts for their os and attached volumes
	StorageAccount = "StorageAccount"
	// ManagedDisks means that the nodes use managed disks for their os and attached volumes
	ManagedDisks = "ManagedDisks"
)

storage profiles

View Source
const (
	// DefaultNetworkPlugin defines the network plugin to use by default
	DefaultNetworkPlugin = "azure"
	// DefaultNetworkPluginWindows defines the network plugin to use by default for clusters with Windows agent pools
	DefaultNetworkPluginWindows = "azure"
	// DefaultNetworkPolicy defines the network policy to use by default
	DefaultNetworkPolicy = ""
)

vlabs default configuration

View Source
const (
	// APIVersion is the version of this API
	APIVersion = "vlabs"
)
View Source
const (
	// DCOS is the string constant for DCOS orchestrator type and defaults to DCOS188
	DCOS string = "DCOS"
)

the orchestrators supported by vlabs

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentPoolProfile

type AgentPoolProfile struct {
	Name                         string               `json:"name" validate:"required"`
	Count                        int                  `json:"count" validate:"required,min=1,max=100"`
	VMSize                       string               `json:"vmSize" validate:"required"`
	OSDiskSizeGB                 int                  `json:"osDiskSizeGB,omitempty" validate:"min=0,max=1023"`
	DNSPrefix                    string               `json:"dnsPrefix,omitempty"`
	OSType                       OSType               `json:"osType,omitempty"`
	Ports                        []int                `json:"ports,omitempty" validate:"dive,min=1,max=65535"`
	AvailabilityProfile          string               `json:"availabilityProfile"`
	ScaleSetPriority             string               `json:"scaleSetPriority,omitempty" validate:"eq=Regular|eq=Low|len=0"`
	ScaleSetEvictionPolicy       string               `json:"scaleSetEvictionPolicy,omitempty" validate:"eq=Delete|eq=Deallocate|len=0"`
	StorageProfile               string               `json:"storageProfile" validate:"eq=StorageAccount|eq=ManagedDisks|len=0"`
	DiskSizesGB                  []int                `json:"diskSizesGB,omitempty" validate:"max=4,dive,min=1,max=1023"`
	VnetSubnetID                 string               `json:"vnetSubnetID,omitempty"`
	IPAddressCount               int                  `json:"ipAddressCount,omitempty" validate:"min=0,max=256"`
	Distro                       Distro               `json:"distro,omitempty"`
	ImageRef                     *ImageReference      `json:"imageReference,omitempty"`
	Role                         AgentPoolProfileRole `json:"role,omitempty"`
	AcceleratedNetworkingEnabled bool                 `json:"acceleratedNetworkingEnabled,omitempty"`

	FQDN                   string            `json:"fqdn"`
	CustomNodeLabels       map[string]string `json:"customNodeLabels,omitempty"`
	PreProvisionExtension  *Extension        `json:"preProvisionExtension"`
	PostProvisionExtension *Extension        `json:"postProvisionExtension"`
	Extensions             []Extension       `json:"extensions"`
	// contains filtered or unexported fields
}

AgentPoolProfile represents an agent pool definition

func (*AgentPoolProfile) GetSubnet

func (a *AgentPoolProfile) GetSubnet() string

GetSubnet returns the read-only subnet for the agent pool

func (*AgentPoolProfile) HasDisks

func (a *AgentPoolProfile) HasDisks() bool

HasDisks returns true if the customer specified disks

func (*AgentPoolProfile) IsAcceleratedNetworkingEnabled

func (a *AgentPoolProfile) IsAcceleratedNetworkingEnabled() bool

IsAcceleratedNetworkingEnabled returns true if the customer enabled Accelerated Networking

func (*AgentPoolProfile) IsAvailabilitySets

func (a *AgentPoolProfile) IsAvailabilitySets() bool

IsAvailabilitySets returns true if the customer specified disks

func (*AgentPoolProfile) IsCoreOS

func (a *AgentPoolProfile) IsCoreOS() bool

IsCoreOS returns true if the agent specified a CoreOS distro

func (*AgentPoolProfile) IsCustomVNET

func (a *AgentPoolProfile) IsCustomVNET() bool

IsCustomVNET returns true if the customer brought their own VNET

func (*AgentPoolProfile) IsLinux

func (a *AgentPoolProfile) IsLinux() bool

IsLinux returns true if the agent pool is linux

func (*AgentPoolProfile) IsManagedDisks

func (a *AgentPoolProfile) IsManagedDisks() bool

IsManagedDisks returns true if the customer specified managed disks

func (*AgentPoolProfile) IsNSeriesSKU

func (a *AgentPoolProfile) IsNSeriesSKU() bool

IsNSeriesSKU returns true if the agent pool contains an N-series (NVIDIA GPU) VM

func (*AgentPoolProfile) IsRHEL

func (a *AgentPoolProfile) IsRHEL() bool

IsRHEL returns true if the agent pool specified a RHEL distro

func (*AgentPoolProfile) IsStorageAccount

func (a *AgentPoolProfile) IsStorageAccount() bool

IsStorageAccount returns true if the customer specified storage account

func (*AgentPoolProfile) IsVirtualMachineScaleSets

func (a *AgentPoolProfile) IsVirtualMachineScaleSets() bool

IsVirtualMachineScaleSets returns true if the agent pool availability profile is VMSS

func (*AgentPoolProfile) IsWindows

func (a *AgentPoolProfile) IsWindows() bool

IsWindows returns true if the agent pool is windows

func (*AgentPoolProfile) SetSubnet

func (a *AgentPoolProfile) SetSubnet(subnet string)

SetSubnet sets the read-only subnet for the agent pool

type AgentPoolProfileRole

type AgentPoolProfileRole string

AgentPoolProfileRole represents an agent role

const (
	// AgentPoolProfileRoleEmpty is the empty role
	AgentPoolProfileRoleEmpty AgentPoolProfileRole = ""
	// AgentPoolProfileRoleInfra is the infra role
	AgentPoolProfileRoleInfra AgentPoolProfileRole = "infra"
)

type BootstrapProfile

type BootstrapProfile struct {
	BootstrapURL  string                 `json:"bootstrapURL,omitempty"`
	DockerVersion string                 `json:"dockerVersion,omitempty"`
	Hosted        bool                   `json:"hosted,omitempty"`
	VMSize        string                 `json:"vmSize,omitempty"`
	OSDiskSizeGB  int                    `json:"osDiskSizeGB,omitempty"`
	StaticIP      string                 `json:"staticIP,omitempty"`
	HasPublicIP   bool                   `json:"hasPublicIP,omitempty"`
	Subnet        string                 `json:"subnet,omitempty"`
	EnableIPv6    bool                   `json:"enableIPv6,omitempty"`
	ExtraConfigs  map[string]interface{} `json:"extraConfigs,omitempty"`
}

BootstrapProfile represents the definition of the DCOS bootstrap node used to deploy the cluster

type ClassicAgentPoolProfileType

type ClassicAgentPoolProfileType string

ClassicAgentPoolProfileType represents types of classic profiles

type ContainerService

type ContainerService struct {
	ID       string                `json:"id,omitempty"`
	Location string                `json:"location,omitempty"`
	Name     string                `json:"name,omitempty"`
	Plan     *ResourcePurchasePlan `json:"plan,omitempty"`
	Tags     map[string]string     `json:"tags,omitempty"`
	Type     string                `json:"type,omitempty"`

	Properties *Properties `json:"properties"`
}

ContainerService complies with the ARM model of resource definition in a JSON template.

func (*ContainerService) Merge

func (cs *ContainerService) Merge(ecs *ContainerService) error

Merge existing containerService attribute into cs

type CustomFile

type CustomFile struct {
	Source string `json:"source,omitempty"`
	Dest   string `json:"dest,omitempty"`
}

CustomFile has source as the full absolute source path to a file and dest is the full absolute desired destination path to put the file on a master node

type CustomNodesDNS

type CustomNodesDNS struct {
	DNSServer string `json:"dnsServer,omitempty"`
}

CustomNodesDNS represents the Search Domain

type CustomSearchDomain

type CustomSearchDomain struct {
	Name          string `json:"name,omitempty"`
	RealmUser     string `json:"realmUser,omitempty"`
	RealmPassword string `json:"realmPassword,omitempty"`
}

CustomSearchDomain represents the Search Domain when the custom vnet has a windows server DNS as a nameserver.

type Distro

type Distro string

Distro represents Linux distro to use for Linux VMs

const (
	Ubuntu Distro = "ubuntu"
	RHEL   Distro = "rhel"
	CoreOS Distro = "coreos"
)

the LinuxDistros supported by vlabs

type Extension

type Extension struct {
	Name        string `json:"name"`
	SingleOrAll string `json:"singleOrAll"`
	Template    string `json:"template"`
}

Extension represents an extension definition in the master or agentPoolProfile

type ExtensionProfile

type ExtensionProfile struct {
	Name                           string             `json:"name"`
	Version                        string             `json:"version"`
	ExtensionParameters            string             `json:"extensionParameters,omitempty"`
	ExtensionParametersKeyVaultRef *KeyvaultSecretRef `json:"parametersKeyvaultSecretRef,omitempty"`
	RootURL                        string             `json:"rootURL,omitempty"`
	// This is only needed for preprovision extensions and it needs to be a bash script
	Script   string `json:"script,omitempty"`
	URLQuery string `json:"urlQuery,omitempty"`
}

ExtensionProfile represents an extension definition

type ImageReference

type ImageReference struct {
	Name          string `json:"name,omitempty"`
	ResourceGroup string `json:"resourceGroup,omitempty"`
}

ImageReference represents a reference to an Image resource in Azure.

type KeyVaultCertificate

type KeyVaultCertificate struct {
	CertificateURL   string `json:"certificateUrl,omitempty"`
	CertificateStore string `json:"certificateStore,omitempty"`
}

KeyVaultCertificate specifies a certificate to install On Linux, the certificate file is placed under the /var/lib/waagent directory with the file name <UppercaseThumbprint>.crt for the X509 certificate file and <UppercaseThumbprint>.prv for the private key. Both of these files are .pem formatted. On windows the certificate will be saved in the specified store.

type KeyVaultID

type KeyVaultID struct {
	ID string `json:"id,omitempty"`
}

KeyVaultID specifies a key vault

type KeyVaultSecrets

type KeyVaultSecrets struct {
	SourceVault       *KeyVaultID           `json:"sourceVault,omitempty"`
	VaultCertificates []KeyVaultCertificate `json:"vaultCertificates,omitempty"`
}

KeyVaultSecrets specifies certificates to install on the pool of machines from a given key vault the key vault specified must have been granted read permissions to CRP

type KeyvaultSecretRef

type KeyvaultSecretRef struct {
	VaultID       string `json:"vaultID" validate:"required"`
	SecretName    string `json:"secretName" validate:"required"`
	SecretVersion string `json:"version,omitempty"`
}

KeyvaultSecretRef is a reference to a secret in a keyvault. The format of 'VaultID' value should be "/subscriptions/<SUB_ID>/resourceGroups/<RG_NAME>/providers/Microsoft.KeyVault/vaults/<KV_NAME>" where:

<SUB_ID> is the subscription ID of the keyvault
<RG_NAME> is the resource group of the keyvault
<KV_NAME> is the name of the keyvault

The 'SecretName' is the name of the secret in the keyvault The 'SecretVersion' (optional) is the version of the secret (default: the latest version)

type LinuxProfile

type LinuxProfile struct {
	AdminUsername string `json:"adminUsername" validate:"required"`
	SSH           struct {
		PublicKeys []PublicKey `json:"publicKeys" validate:"required,len=1"`
	} `json:"ssh" validate:"required"`
	Secrets            []KeyVaultSecrets   `json:"secrets,omitempty"`
	ScriptRootURL      string              `json:"scriptroot,omitempty"`
	CustomSearchDomain *CustomSearchDomain `json:"customSearchDomain,omitempty"`
	CustomNodesDNS     *CustomNodesDNS     `json:"customNodesDNS,omitempty"`
}

LinuxProfile represents the linux parameters passed to the cluster

func (*LinuxProfile) HasCustomNodesDNS

func (l *LinuxProfile) HasCustomNodesDNS() bool

HasCustomNodesDNS returns true if the customer specified secrets to install

func (*LinuxProfile) HasSearchDomain

func (l *LinuxProfile) HasSearchDomain() bool

HasSearchDomain returns true if the customer specified secrets to install

type MasterProfile

type MasterProfile struct {
	Count                    int             `json:"count" validate:"required,eq=1|eq=3|eq=5"`
	DNSPrefix                string          `json:"dnsPrefix" validate:"required"`
	SubjectAltNames          []string        `json:"subjectAltNames"`
	VMSize                   string          `json:"vmSize" validate:"required"`
	OSDiskSizeGB             int             `json:"osDiskSizeGB,omitempty" validate:"min=0,max=1023"`
	VnetSubnetID             string          `json:"vnetSubnetID,omitempty"`
	VnetCidr                 string          `json:"vnetCidr,omitempty"`
	FirstConsecutiveStaticIP string          `json:"firstConsecutiveStaticIP,omitempty"`
	IPAddressCount           int             `json:"ipAddressCount,omitempty" validate:"min=0,max=256"`
	StorageProfile           string          `json:"storageProfile,omitempty" validate:"eq=StorageAccount|eq=ManagedDisks|len=0"`
	HTTPSourceAddressPrefix  string          `json:"HTTPSourceAddressPrefix,omitempty"`
	PreProvisionExtension    *Extension      `json:"preProvisionExtension"`
	PostProvisionExtension   *Extension      `json:"postProvisionExtension"`
	Extensions               []Extension     `json:"extensions"`
	Distro                   Distro          `json:"distro,omitempty"`
	ImageRef                 *ImageReference `json:"imageReference,omitempty"`
	CustomFiles              *[]CustomFile   `json:"customFiles,omitempty"`

	// Master LB public endpoint/FQDN with port
	// The format will be FQDN:2376
	// Not used during PUT, returned as part of GET
	FQDN string `json:"fqdn,omitempty"`
	// contains filtered or unexported fields
}

MasterProfile represents the definition of the master cluster

func (*MasterProfile) GetSubnet

func (m *MasterProfile) GetSubnet() string

GetSubnet returns the read-only subnet for the master

func (*MasterProfile) IsCoreOS

func (m *MasterProfile) IsCoreOS() bool

IsCoreOS returns true if the master specified a CoreOS distro

func (*MasterProfile) IsCustomVNET

func (m *MasterProfile) IsCustomVNET() bool

IsCustomVNET returns true if the customer brought their own VNET

func (*MasterProfile) IsManagedDisks

func (m *MasterProfile) IsManagedDisks() bool

IsManagedDisks returns true if the master specified managed disks

func (*MasterProfile) IsRHEL

func (m *MasterProfile) IsRHEL() bool

IsRHEL returns true if the master specified a RHEL distro

func (*MasterProfile) IsStorageAccount

func (m *MasterProfile) IsStorageAccount() bool

IsStorageAccount returns true if the master specified storage account

func (*MasterProfile) SetSubnet

func (m *MasterProfile) SetSubnet(subnet string)

SetSubnet sets the read-only subnet for the master

type OSType

type OSType string

OSType represents OS types of agents

const (
	Windows OSType = "Windows"
	Linux   OSType = "Linux"
)

the OSTypes supported by vlabs

type OrchestratorProfile

type OrchestratorProfile struct {
	OrchestratorType        string            `json:"orchestratorType" validate:"required"`
	OrchestratorRelease     string            `json:"orchestratorRelease,omitempty"`
	OrchestratorVersion     string            `json:"orchestratorVersion,omitempty"`
	OAuthEnabled            bool              `json:"oauthEnabled,omitempty"`
	OpenAccess              bool              `json:"openAccess,omitempty"`
	LinuxBootstrapProfile   *BootstrapProfile `json:"linuxBootstrapProfile,omitempty"`
	WindowsBootstrapProfile *BootstrapProfile `json:"windowsBootstrapProfile,omitempty"`
	Registry                string            `json:"registry,omitempty"`
	RegistryUser            string            `json:"registryUser,omitempty"`
	RegistryPass            string            `json:"registryPassword,omitempty"`
}

OrchestratorProfile contains Orchestrator properties

func (*OrchestratorProfile) UnmarshalJSON

func (o *OrchestratorProfile) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshal json using the default behavior And do fields manipulation, such as populating default value

type OrchestratorVersionProfile

type OrchestratorVersionProfile struct {
	OrchestratorProfile
	Default  bool     `json:"default,omitempty"`
	Upgrades []string `json:"upgrades,omitempty"`
}

OrchestratorVersionProfile contains information of a supported orchestrator version:

  • orchestrator type and version
  • whether this orchestrator version is deployed by default if orchestrator release is not specified
  • list of available upgrades for this orchestrator version

type OrchestratorVersionProfileList

type OrchestratorVersionProfileList struct {
	Orchestrators []*OrchestratorVersionProfile `json:"orchestrators"`
}

OrchestratorVersionProfileList contains list of version profiles for supported orchestrators

type PrivateCluster

type PrivateCluster struct {
	Enabled *bool `json:"enabled,omitempty"`
}

PrivateCluster defines the configuration for a private cluster

type Properties

type Properties struct {
	ProvisioningState       ProvisioningState        `json:"provisioningState,omitempty"`
	OrchestratorProfile     *OrchestratorProfile     `json:"orchestratorProfile,omitempty" validate:"required"`
	MasterProfile           *MasterProfile           `json:"masterProfile,omitempty" validate:"required"`
	AgentPoolProfiles       []*AgentPoolProfile      `json:"agentPoolProfiles,omitempty" validate:"dive,required"`
	LinuxProfile            *LinuxProfile            `json:"linuxProfile,omitempty" validate:"required"`
	ExtensionProfiles       []*ExtensionProfile      `json:"extensionProfiles,omitempty"`
	WindowsProfile          *WindowsProfile          `json:"windowsProfile,omitempty"`
	ServicePrincipalProfile *ServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"`
}

Properties represents the ACS cluster definition

func (*Properties) HasWindows

func (p *Properties) HasWindows() bool

HasWindows returns true if the cluster contains windows

func (*Properties) Validate

func (a *Properties) Validate(isUpdate bool) error

Validate implements APIObject

type ProvisioningState

type ProvisioningState string

ProvisioningState represents the current state of container service resource.

const (
	// Creating means ContainerService resource is being created.
	Creating ProvisioningState = "Creating"
	// Updating means an existing ContainerService resource is being updated
	Updating ProvisioningState = "Updating"
	// Failed means resource is in failed state
	Failed ProvisioningState = "Failed"
	// Succeeded means resource created succeeded during last create/update
	Succeeded ProvisioningState = "Succeeded"
	// Deleting means resource is in the process of being deleted
	Deleting ProvisioningState = "Deleting"
	// Migrating means resource is being migrated from one subscription or
	// resource group to another
	Migrating ProvisioningState = "Migrating"
)

type PublicKey

type PublicKey struct {
	KeyData string `json:"keyData"`
}

PublicKey represents an SSH key for LinuxProfile

type ResourcePurchasePlan

type ResourcePurchasePlan struct {
	Name          string `json:"name,omitempty"`
	Product       string `json:"product,omitempty"`
	PromotionCode string `json:"promotionCode,omitempty"`
	Publisher     string `json:"publisher,omitempty"`
}

ResourcePurchasePlan defines resource plan as required by ARM for billing purposes.

type ServicePrincipalProfile

type ServicePrincipalProfile struct {
	ClientID          string             `json:"clientId,omitempty"`
	Secret            string             `json:"secret,omitempty"`
	ObjectID          string             `json:"objectId,omitempty"`
	KeyvaultSecretRef *KeyvaultSecretRef `json:"keyvaultSecretRef,omitempty"`
}

ServicePrincipalProfile contains the client and secret used by the cluster for Azure Resource CRUD The 'Secret' and 'KeyvaultSecretRef' parameters are mutually exclusive The 'Secret' parameter should be a secret in plain text. The 'KeyvaultSecretRef' parameter is a reference to a secret in a keyvault.

type WindowsProfile

type WindowsProfile struct {
	AdminUsername         string            `json:"adminUsername,omitempty"`
	AdminPassword         string            `json:"adminPassword,omitempty"`
	ImageVersion          string            `json:"imageVersion,omitempty"`
	WindowsImageSourceURL string            `json:"WindowsImageSourceUrl"`
	WindowsPublisher      string            `json:"WindowsPublisher"`
	WindowsOffer          string            `json:"WindowsOffer"`
	WindowsSku            string            `json:"WindowsSku"`
	Secrets               []KeyVaultSecrets `json:"secrets,omitempty"`
}

WindowsProfile represents the windows parameters passed to the cluster

func (*WindowsProfile) Validate

func (w *WindowsProfile) Validate(orchestratorType string) error

Validate ensures that the WindowsProfile is valid

Jump to

Keyboard shortcuts

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