vlabs

package
v0.19.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package vlabs stores api model for version "2017-08-31"

Index

Constants

View Source
const (
	// MinAgentCount are the minimum number of agents
	MinAgentCount = 1
	// MaxAgentCount are the maximum number of agents
	MaxAgentCount = 100
	// MinDiskSizeGB specifies the minimum attached disk size
	MinDiskSizeGB = 1
	// MaxDiskSizeGB specifies the maximum attached disk size
	MaxDiskSizeGB = 1023
)

validation values

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 (
	// APIVersion is the version of this API
	APIVersion = "vlabs"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessProfile

type AccessProfile struct {
	RoleName   string `json:"roleName"`
	KubeConfig string `json:"kubeConfig"`
}

AccessProfile represents role name and kubeconfig

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"`
	AvailabilityProfile string `json:"availabilityProfile"`
	StorageProfile      string `json:"storageProfile" validate:"eq=StorageAccount|eq=ManagedDisks|len=0"`
	VnetSubnetID        string `json:"vnetSubnetID,omitempty"`

	// OSType is the operating system type for agents
	// Set as nullable to support backward compat because
	// this property was added later.
	// If the value is null or not set, it defaulted to Linux.
	OSType OSType `json:"osType,omitempty"`
	// contains filtered or unexported fields
}

AgentPoolProfile represents configuration of VMs running agent daemons that register with the master and offer resources to host applications in containers.

func (*AgentPoolProfile) GetSubnet

func (a *AgentPoolProfile) GetSubnet() string

GetSubnet returns the read-only subnet for the agent pool

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) IsStorageAccount

func (a *AgentPoolProfile) IsStorageAccount() bool

IsStorageAccount returns true if the customer specified storage account

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

func (*AgentPoolProfile) UnmarshalJSON

func (a *AgentPoolProfile) UnmarshalJSON(b []byte) error

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

func (*AgentPoolProfile) Validate

func (a *AgentPoolProfile) Validate() error

Validate implements APIObject

type CertificateProfile

type CertificateProfile struct {
	// CaCertificate is the certificate authority certificate.
	CaCertificate string `json:"caCertificate,omitempty"`
	// CaPrivateKey is the certificate authority key.
	CaPrivateKey string `json:"caPrivateKey,omitempty"`
	// ApiServerCertificate is the rest api server certificate, and signed by the CA
	APIServerCertificate string `json:"apiServerCertificate,omitempty"`
	// ApiServerPrivateKey is the rest api server private key, and signed by the CA
	APIServerPrivateKey string `json:"apiServerPrivateKey,omitempty"`
	// ClientCertificate is the certificate used by the client kubelet services and signed by the CA
	ClientCertificate string `json:"clientCertificate,omitempty"`
	// ClientPrivateKey is the private key used by the client kubelet services and signed by the CA
	ClientPrivateKey string `json:"clientPrivateKey,omitempty"`
	// KubeConfigCertificate is the client certificate used for kubectl cli and signed by the CA
	KubeConfigCertificate string `json:"kubeConfigCertificate,omitempty"`
	// KubeConfigPrivateKey is the client private key used for kubectl cli and signed by the CA
	KubeConfigPrivateKey string `json:"kubeConfigPrivateKey,omitempty"`
}

CertificateProfile contains cert material for the Kubernetes cluster

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"`
}

LinuxProfile represents the Linux configuration passed to the cluster

func (*LinuxProfile) Validate

func (l *LinuxProfile) Validate() error

Validate implements APIObject

type ManagedCluster

type ManagedCluster struct {
	ID       string                `json:"id,omitempty"`
	Location string                `json:"location,omitempty" validate:"required"`
	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"`
}

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

type OSType

type OSType string

OSType represents OS types of agents

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

type Properties

type Properties struct {
	ProvisioningState       ProvisioningState        `json:"provisioningState,omitempty"`
	KubernetesVersion       string                   `json:"kubernetesVersion"`
	DNSPrefix               string                   `json:"dnsPrefix" validate:"required"`
	FQDN                    string                   `json:"fqdn,omitempty"`
	AgentPoolProfiles       []*AgentPoolProfile      `json:"agentPoolProfiles,omitempty" validate:"dive,required"`
	LinuxProfile            *LinuxProfile            `json:"linuxProfile,omitempty" validate:"required"`
	WindowsProfile          *WindowsProfile          `json:"windowsProfile,omitempty"`
	ServicePrincipalProfile *ServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"`
	AccessProfiles          map[string]AccessProfile `json:"accessProfiles,omitempty"`
	CertificateProfile      *CertificateProfile      `json:"certificateProfile,omitempty" validate:"required"`
}

Properties represents the ACS cluster definition

func (*Properties) HasWindows

func (a *Properties) HasWindows() bool

HasWindows returns true if the cluster contains windows

func (*Properties) Validate

func (a *Properties) Validate() 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"
	// Upgrading means an existing resource is being upgraded
	Upgrading ProvisioningState = "Upgrading"
)

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" validate:"required"`
	Secret   string `json:"secret,omitempty"`
}

ServicePrincipalProfile contains the client and secret used by the cluster for Azure Resource CRUD The 'Secret' parameter could be either a plain text, or referenced to a secret in a keyvault. In the latter case, the format of the parameter's value should be "/subscriptions/<SUB_ID>/resourceGroups/<RG_NAME>/providers/Microsoft.KeyVault/vaults/<KV_NAME>/secrets/<NAME>[/<VERSION>]" 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
<NAME> is the name of the secret.
<VERSION> (optional) is the version of the secret (default: the latest version)

type WindowsProfile

type WindowsProfile struct {
	AdminUsername string `json:"adminUsername,omitempty" validate:"required"`
	AdminPassword string `json:"adminPassword,omitempty"`
	ImageVersion  string `json:"imageVersion,omitempty"`
}

WindowsProfile represents the Windows configuration passed to the cluster

Jump to

Keyboard shortcuts

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