api

package
v0.0.0-...-36bfce7 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package api stores an unversion api

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
)

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 (
	// StorageAccountClassic means that we follow the older versions (09-30-2016, 03-30-2016)
	// storage account naming conventions
	StorageAccountClassic = "StorageAccountClassic"
	// 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

Variables

This section is empty.

Functions

func ConvertContainerServiceToV20160330

func ConvertContainerServiceToV20160330(api *ContainerService) *v20160330.ContainerService

ConvertContainerServiceToV20160330 converts a v20160330 ContainerService to an unversioned ContainerService

func ConvertContainerServiceToV20160930

func ConvertContainerServiceToV20160930(api *ContainerService) *v20160930.ContainerService

ConvertContainerServiceToV20160930 converts an unversioned ContainerService to a v20160930 ContainerService to

func ConvertContainerServiceToVLabs

func ConvertContainerServiceToVLabs(api *ContainerService) *vlabs.ContainerService

ConvertContainerServiceToVLabs converts a vlabs ContainerService to an unversioned ContainerService

func SerializeContainerService

func SerializeContainerService(containerService *ContainerService, version string) ([]byte, error)

SerializeContainerService takes an unversioned container service and returns the bytes

Types

type AgentPoolProfile

type AgentPoolProfile struct {
	Name                string `json:"name"`
	Count               int    `json:"count"`
	VMSize              string `json:"vmSize"`
	DNSPrefix           string `json:"dnsPrefix,omitempty"`
	OSType              OSType `json:"osType,omitempty"`
	Ports               []int  `json:"ports,omitempty"`
	AvailabilityProfile string `json:"availabilityProfile"`
	StorageProfile      string `json:"storageProfile,omitempty"`
	DiskSizesGB         []int  `json:"diskSizesGB,omitempty"`
	VnetSubnetID        string `json:"vnetSubnetID,omitempty"`
	Subnet              string `json:"subnet"`

	FQDN string `json:"fqdn,omitempty"`
}

AgentPoolProfile represents an agent pool definition

func (*AgentPoolProfile) HasDisks

func (a *AgentPoolProfile) HasDisks() bool

HasDisks returns true if the customer specified disks

func (*AgentPoolProfile) IsAvailabilitySets

func (a *AgentPoolProfile) IsAvailabilitySets() bool

IsAvailabilitySets returns true if the customer specified disks

func (*AgentPoolProfile) IsClassicStorageAccount

func (a *AgentPoolProfile) IsClassicStorageAccount() bool

IsClassicStorageAccount returns true if the storage account follows the older naming convention

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

type CertificateProfile

type CertificateProfile struct {
	// CaCertificate is the certificate authority certificate.
	CaCertificate string `json:"caCertificate,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"`
	// contains filtered or unexported fields
}

CertificateProfile represents the definition of the master cluster

func (*CertificateProfile) GetCAPrivateKey

func (c *CertificateProfile) GetCAPrivateKey() string

GetCAPrivateKey returns the ca private key

func (*CertificateProfile) SetCAPrivateKey

func (c *CertificateProfile) SetCAPrivateKey(caPrivateKey string)

SetCAPrivateKey sets the ca private key

type ContainerService

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

	Properties Properties `json:"properties"`
}

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

func ConvertV20160330ContainerService

func ConvertV20160330ContainerService(v20160330 *v20160330.ContainerService) *ContainerService

ConvertV20160330ContainerService converts a v20160330 ContainerService to an unversioned ContainerService

func ConvertV20160930ContainerService

func ConvertV20160930ContainerService(v20160930 *v20160930.ContainerService) *ContainerService

ConvertV20160930ContainerService converts a v20160930 ContainerService to an unversioned ContainerService

func ConvertVLabsContainerService

func ConvertVLabsContainerService(vlabs *vlabs.ContainerService) *ContainerService

ConvertVLabsContainerService converts a vlabs ContainerService to an unversioned ContainerService

func DeserializeContainerService

func DeserializeContainerService(contents []byte) (*ContainerService, string, error)

DeserializeContainerService loads an ACS Cluster API Model, validates it, and returns the unversioned representation

func LoadContainerService

func LoadContainerService(contents []byte, version string) (*ContainerService, error)

LoadContainerService loads an ACS Cluster API Model, validates it, and returns the unversioned representation

func LoadContainerServiceFromFile

func LoadContainerServiceFromFile(jsonFile string) (*ContainerService, string, error)

LoadContainerServiceFromFile loads an ACS Cluster API Model from a JSON file

type CustomProfile

type CustomProfile struct {
	Orchestrator string `json:"orchestrator,omitempty"`
}

CustomProfile specifies custom properties that are used for cluster instantiation. Should not be used by most users.

type DiagnosticsProfile

type DiagnosticsProfile struct {
	VMDiagnostics VMDiagnostics `json:"vmDiagnostics"`
}

DiagnosticsProfile setting to enable/disable capturing diagnostics for VMs hosting container cluster.

type JumpboxProfile

type JumpboxProfile struct {
	OSType    OSType `json:"osType"`
	DNSPrefix string `json:"dnsPrefix"`

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

JumpboxProfile dscribes properties of the jumpbox setup in the ACS container cluster.

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 KubernetesConfig

type KubernetesConfig struct {
	KubernetesImageBase string `json:"kubernetesImageBase,omitempty"`
}

KubernetesConfig contains the Kubernetes config structure, containing Kubernetes specific configuration

type LinuxProfile

type LinuxProfile struct {
	AdminUsername string `json:"adminUsername"`
	SSH           struct {
		PublicKeys []struct {
			KeyData string `json:"keyData"`
		} `json:"publicKeys"`
	} `json:"ssh"`
	Secrets []KeyVaultSecrets `json:"secrets,omitempty"`
}

LinuxProfile represents the linux parameters passed to the cluster

func (*LinuxProfile) HasSecrets

func (l *LinuxProfile) HasSecrets() bool

HasSecrets returns true if the customer specified secrets to install

type MasterProfile

type MasterProfile struct {
	Count                    int    `json:"count"`
	DNSPrefix                string `json:"dnsPrefix"`
	VMSize                   string `json:"vmSize"`
	VnetSubnetID             string `json:"vnetSubnetID,omitempty"`
	FirstConsecutiveStaticIP string `json:"firstConsecutiveStaticIP,omitempty"`
	Subnet                   string `json:"subnet"`
	StorageProfile           string `json:"storageProfile,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"`
}

MasterProfile represents the definition of the master cluster

func (*MasterProfile) IsClassicStorageAccount

func (m *MasterProfile) IsClassicStorageAccount() bool

IsClassicStorageAccount returns true if the storage account follows the older naming convention

func (*MasterProfile) IsCustomVNET

func (m *MasterProfile) IsCustomVNET() bool

IsCustomVNET returns true if the customer brought their own VNET

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 OrchestratorType `json:"orchestratorType"`
	KubernetesConfig KubernetesConfig `json:"kubernetesConfig,omitempty"`
}

OrchestratorProfile contains Orchestrator properties

func (*OrchestratorProfile) IsSwarmMode

func (o *OrchestratorProfile) IsSwarmMode() bool

IsSwarmMode returns true if this template is for Swarm Mode orchestrator

type OrchestratorType

type OrchestratorType string

OrchestratorType defines orchestrators supported by ACS

const (
	// Mesos is the string constant for MESOS orchestrator type
	Mesos OrchestratorType = "Mesos"
	// DCOS is the string constant for DCOS orchestrator type and defaults to DCOS188
	DCOS OrchestratorType = "DCOS"
	// DCOS187 is the string constant for DCOS 1.8.8 orchestrator type
	DCOS188 OrchestratorType = "DCOS188"
	// DCOS187 is the string constant for DCOS 1.8.7 orchestrator type
	DCOS187 OrchestratorType = "DCOS187"
	// DCOS184 is the string constant for DCOS 1.8.4 orchestrator type
	DCOS184 OrchestratorType = "DCOS184"
	// DCOS173 is the string constant for DCOS 1.7.3 orchestrator type
	DCOS173 OrchestratorType = "DCOS173"
	// Swarm is the string constant for the Swarm orchestrator type
	Swarm OrchestratorType = "Swarm"
	// Kubernetes is the string constant for the Kubernetes orchestrator type
	Kubernetes OrchestratorType = "Kubernetes"
	// SwarmMode is the string constant for the Swarm Mode orchestrator type
	SwarmMode OrchestratorType = "SwarmMode"
)

the orchestrators supported by vlabs

type Properties

type Properties struct {
	ProvisioningState       ProvisioningState       `json:"provisioningState"`
	OrchestratorProfile     OrchestratorProfile     `json:"orchestratorProfile"`
	MasterProfile           MasterProfile           `json:"masterProfile"`
	AgentPoolProfiles       []AgentPoolProfile      `json:"agentPoolProfiles"`
	LinuxProfile            LinuxProfile            `json:"linuxProfile"`
	WindowsProfile          WindowsProfile          `json:"windowsProfile"`
	DiagnosticsProfile      DiagnosticsProfile      `json:"diagnosticsProfile"`
	JumpboxProfile          JumpboxProfile          `json:"jumpboxProfile"`
	ServicePrincipalProfile ServicePrincipalProfile `json:"servicePrincipalProfile"`
	CertificateProfile      CertificateProfile      `json:"certificateProfile"`
	CustomProfile           CustomProfile           `json:"customProfile"`
}

Properties represents the ACS cluster definition

func (*Properties) HasManagedDisks

func (p *Properties) HasManagedDisks() bool

HasManagedDisks returns true if the cluster contains Managed Disks

func (*Properties) HasWindows

func (p *Properties) HasWindows() bool

HasWindows returns true if the cluster contains windows

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 ResourcePurchasePlan

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

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

type ServicePrincipalProfile

type ServicePrincipalProfile struct {
	ClientID string `json:"servicePrincipalClientID,omitempty"`
	Secret   string `json:"servicePrincipalClientSecret,omitempty"`
}

ServicePrincipalProfile contains the client and secret used by the cluster for Azure Resource CRUD

type TypeMeta

type TypeMeta struct {
	// APIVersion is on every object
	APIVersion string `json:"apiVersion"`
}

TypeMeta describes an individual API model object

type V20160330ARMContainerService

type V20160330ARMContainerService struct {
	TypeMeta
	*v20160330.ContainerService
}

V20160330ARMContainerService is the type we read and write from file needed because the json that is sent to ARM and acs-engine is different from the json that the ACS RP Api gets from ARM

type V20160930ARMContainerService

type V20160930ARMContainerService struct {
	TypeMeta
	*v20160930.ContainerService
}

V20160930ARMContainerService is the type we read and write from file needed because the json that is sent to ARM and acs-engine is different from the json that the ACS RP Api gets from ARM

type VMDiagnostics

type VMDiagnostics struct {
	Enabled bool `json:"enabled"`

	// Specifies storage account Uri where Boot Diagnostics (CRP &
	// VMSS BootDiagostics) and VM Diagnostics logs (using Linux
	// Diagnostics Extension) will be stored. Uri will be of standard
	// blob domain. i.e. https://storageaccount.blob.core.windows.net/
	// This field is readonly as ACS RP will create a storage account
	// for the customer.
	StorageURL neturl.URL `json:"storageUrl"`
}

VMDiagnostics contains settings to on/off boot diagnostics collection in RD Host

type VlabsARMContainerService

type VlabsARMContainerService struct {
	TypeMeta
	*vlabs.ContainerService
}

VlabsARMContainerService is the type we read and write from file needed because the json that is sent to ARM and acs-engine is different from the json that the ACS RP Api gets from ARM

type WindowsProfile

type WindowsProfile struct {
	AdminUsername string            `json:"adminUsername"`
	AdminPassword string            `json:"adminPassword"`
	Secrets       []KeyVaultSecrets `json:"secrets,omitempty"`
}

WindowsProfile represents the windows parameters passed to the cluster

func (*WindowsProfile) HasSecrets

func (w *WindowsProfile) HasSecrets() bool

HasSecrets returns true if the customer specified secrets to install

Directories

Path Synopsis
Package v20160330 stores the api model for version "2016-03-30"
Package v20160330 stores the api model for version "2016-03-30"
Package v20160930 stores api model for version "2016-09-30"
Package v20160930 stores api model for version "2016-09-30"
Package v20170131 stores api model for version "2017-01-31"
Package v20170131 stores api model for version "2017-01-31"
Package vlabs stores an experimental api model for acs
Package vlabs stores an experimental api model for acs

Jump to

Keyboard shortcuts

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