engine

package
v0.0.0-...-2c7adf3 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2019 License: MIT Imports: 42 Imported by: 0

Documentation

Overview

Package engine takes an AKS cluster model and generates the corresponding template.

Index

Constants

View Source
const (
	// Mesos is the string constant for MESOS orchestrator type
	Mesos string = "Mesos"
	// DCOS is the string constant for DCOS orchestrator type and defaults to DCOS188
	DCOS string = "DCOS"
	// Swarm is the string constant for the Swarm orchestrator type
	Swarm string = "Swarm"
	// Kubernetes is the string constant for the Kubernetes orchestrator type
	Kubernetes string = "Kubernetes"
	// SwarmMode is the string constant for the Swarm Mode orchestrator type
	SwarmMode string = "SwarmMode"
)
View Source
const (
	// DefaultVNETCIDR is the default CIDR block for the VNET
	DefaultVNETCIDR = "10.0.0.0/8"
	// DefaultInternalLbStaticIPOffset specifies the offset of the internal LoadBalancer's IP
	// address relative to the first consecutive Kubernetes static IP
	DefaultInternalLbStaticIPOffset = 10
	// NetworkPolicyNone is the string expression for the deprecated NetworkPolicy usage pattern "none"
	NetworkPolicyNone = "none"
	// NetworkPolicyCalico is the string expression for calico network policy config option
	NetworkPolicyCalico = "calico"
	// NetworkPolicyCilium is the string expression for cilium network policy config option
	NetworkPolicyCilium = "cilium"
	// NetworkPluginCilium is the string expression for cilium network plugin config option
	NetworkPluginCilium = NetworkPolicyCilium
	// NetworkPolicyAzure is the string expression for Azure CNI network policy manager
	NetworkPolicyAzure = "azure"
	// NetworkPluginAzure is the string expression for Azure CNI plugin
	NetworkPluginAzure = "azure"
	// NetworkPluginKubenet is the string expression for kubenet network plugin
	NetworkPluginKubenet = "kubenet"
	// NetworkPluginFlannel is the string expression for flannel network policy config option
	NetworkPluginFlannel = "flannel"
	// DefaultKubeHeapsterDeploymentAddonName is the name of the kube-heapster-deployment addon
	DefaultKubeHeapsterDeploymentAddonName = "kube-heapster-deployment"
	// DefaultKubeDNSDeploymentAddonName is the name of the kube-dns-deployment addon
	DefaultKubeDNSDeploymentAddonName = "kube-dns-deployment"
	// DefaultCoreDNSAddonName is the name of the coredns addon
	DefaultCoreDNSAddonName = "coredns"
	// DefaultDNSAutoscalerAddonName is the name of the coredns addon
	DefaultDNSAutoscalerAddonName = "dns-autoscaler"
	// DefaultKubeProxyAddonName is the name of the kube-proxy config addon
	DefaultKubeProxyAddonName = "kube-proxy-daemonset"
	// DefaultAzureStorageClassesAddonName is the name of the azure storage classes addon
	DefaultAzureStorageClassesAddonName = "azure-storage-classes"
	// DefaultAzureNpmDaemonSetAddonName is the name of the azure npm daemon set addon
	DefaultAzureNpmDaemonSetAddonName = "azure-npm-daemonset"
	// DefaultCalicoDaemonSetAddonName is the name of calico daemonset addon
	DefaultCalicoDaemonSetAddonName = "calico-daemonset"
	// DefaultCiliumDaemonSetAddonName is the name of cilium daemonset addon
	DefaultCiliumDaemonSetAddonName = "cilium-daemonset"
	// DefaultFlannelDaemonSetAddonName is the name of flannel plugin daemonset addon
	DefaultFlannelDaemonSetAddonName = "flannel-daemonset"
	// DefaultAADAdminGroupRBACAddonName is the name of the default admin group RBAC addon
	DefaultAADAdminGroupRBACAddonName = "aad-default-admin-group-rbac"
	// DefaultAzureCloudProviderDeploymentAddonName is the name of the azure cloud provider deployment addon
	DefaultAzureCloudProviderDeploymentAddonName = "azure-cloud-provider-deployment"
	// DefaultAzureCNINetworkMonitorAddonName is the name of the azure cni network monitor addon
	DefaultAzureCNINetworkMonitorAddonName = "azure-cni-networkmonitor"
	// DefaultAuditPolicyAddonName is the name of the audit policy addon
	DefaultAuditPolicyAddonName = "audit-policy"
	// DefaultTillerAddonName is the name of the tiller addon deployment
	DefaultTillerAddonName = "tiller"
	// DefaultAADPodIdentityAddonName is the name of the aad-pod-identity addon deployment
	DefaultAADPodIdentityAddonName = "aad-pod-identity"
	// DefaultACIConnectorAddonName is the name of the aci-connector addon deployment
	DefaultACIConnectorAddonName = "aci-connector"
	// DefaultDashboardAddonName is the name of the kubernetes-dashboard addon deployment
	DefaultDashboardAddonName = "kubernetes-dashboard"
	// DefaultClusterAutoscalerAddonName is the name of the autoscaler addon deployment
	DefaultClusterAutoscalerAddonName = "cluster-autoscaler"
	// DefaultBlobfuseFlexVolumeAddonName is the name of the blobfuse flexvolume addon
	DefaultBlobfuseFlexVolumeAddonName = "blobfuse-flexvolume"
	// DefaultSMBFlexVolumeAddonName is the name of the smb flexvolume addon
	DefaultSMBFlexVolumeAddonName = "smb-flexvolume"
	// DefaultKeyVaultFlexVolumeAddonName is the name of the keyvault flexvolume addon deployment
	DefaultKeyVaultFlexVolumeAddonName = "keyvault-flexvolume"
	// DefaultELBSVCAddonName is the name of the elb service addon deployment
	DefaultELBSVCAddonName = "elb-svc"
	// DefaultGeneratorCode specifies the source generator of the cluster template.
	DefaultGeneratorCode = "aksengine"
	// DefaultReschedulerAddonName is the name of the rescheduler addon deployment
	DefaultReschedulerAddonName = "rescheduler"
	// DefaultHeapsterAddonName is the name of the heapster addon deployment
	DefaultHeapsterAddonName = "heapster"
	// DefaultMetricsServerAddonName is the name of the kubernetes Metrics server addon deployment
	DefaultMetricsServerAddonName = "metrics-server"
	// NVIDIADevicePluginAddonName is the name of the kubernetes NVIDIA Device Plugin daemon set
	NVIDIADevicePluginAddonName = "nvidia-device-plugin"
	// ContainerMonitoringAddonName is the name of the kubernetes Container Monitoring addon deployment
	ContainerMonitoringAddonName = "container-monitoring"
	// AzureCNINetworkMonitoringAddonName is the name of the Azure CNI networkmonitor addon
	AzureCNINetworkMonitoringAddonName = "azure-cni-networkmonitor"
	// AzureNetworkPolicyAddonName is the name of the Azure CNI networkmonitor addon
	AzureNetworkPolicyAddonName = "azure-npm-daemonset"
	// IPMASQAgentAddonName is the name of the ip masq agent addon
	IPMASQAgentAddonName = "ip-masq-agent"
	// DefaultKubernetesKubeletMaxPods is the max pods per kubelet
	DefaultKubernetesKubeletMaxPods = 110
	// DefaultMasterEtcdServerPort is the default etcd server port for Kubernetes master nodes
	DefaultMasterEtcdServerPort = 2380
	// DefaultMasterEtcdClientPort is the default etcd client port for Kubernetes master nodes
	DefaultMasterEtcdClientPort = 2379
)
View Source
const (
	//DefaultExtensionsRootURL  Root URL for extensions
	DefaultExtensionsRootURL = "https://raw.githubusercontent.com/Azure/aks-engine/master/"
	// DefaultDockerEngineRepo for grabbing docker engine packages
	DefaultDockerEngineRepo = "https://download.docker.com/linux/ubuntu"
	// DefaultDockerComposeURL for grabbing docker images
	DefaultDockerComposeURL = "https://github.com/docker/compose/releases/download"
)
View Source
const (
	//DefaultConfigurationScriptRootURL  Root URL for configuration script (used for script extension on RHEL)
	DefaultConfigurationScriptRootURL = "https://raw.githubusercontent.com/Azure/aks-engine/master/parts/"
)

Variables

This section is empty.

Functions

func CreateKeyVaultVMAS

func CreateKeyVaultVMAS(cs *api.ContainerService) map[string]interface{}

func CreateKeyVaultVMSS

func CreateKeyVaultVMSS(cs *api.ContainerService) map[string]interface{}

func GenerateARMResources

func GenerateARMResources(cs *api.ContainerService) []interface{}

func GenerateKubeConfig

func GenerateKubeConfig(properties *api.Properties, location string) (string, error)

GenerateKubeConfig returns a JSON string representing the KubeConfig

func GetB64sshdConfig

func GetB64sshdConfig() string

func GetB64systemConf

func GetB64systemConf() string

func GetKubernetesB64Configs

func GetKubernetesB64Configs() string

func GetKubernetesB64ConfigsCustomCloud

func GetKubernetesB64ConfigsCustomCloud() string

func GetKubernetesB64CustomSearchDomainsScript

func GetKubernetesB64CustomSearchDomainsScript() string

func GetKubernetesB64GenerateProxyCerts

func GetKubernetesB64GenerateProxyCerts() string

func GetKubernetesB64HealthMonitorScript

func GetKubernetesB64HealthMonitorScript() string

func GetKubernetesB64Installs

func GetKubernetesB64Installs() string

func GetKubernetesB64Mountetcd

func GetKubernetesB64Mountetcd() string

func GetKubernetesB64Provision

func GetKubernetesB64Provision() string

func GetKubernetesB64ProvisionSource

func GetKubernetesB64ProvisionSource() string

func GetKubernetesOutputs

func GetKubernetesOutputs(cs *api.ContainerService) map[string]interface{}

func GetKubernetesVariables

func GetKubernetesVariables(cs *api.ContainerService) map[string]interface{}

func GetTenantID

func GetTenantID(resourceManagerEndpoint string, subscriptionID string) (string, error)

GetTenantID figures out the AAD tenant ID of the subscription by making an unauthenticated request to the Get Subscription Details endpoint and parses the value from WWW-Authenticate header. TODO this should probably to to the armhelpers library

Types

type ARMResource

type ARMResource struct {
	APIVersion string            `json:"apiVersion,omitempty"`
	Copy       map[string]string `json:"copy,omitempty"`
	DependsOn  []string          `json:"dependsOn,omitempty"`
}

ARMResource contains the fields that are common to all Azure Resource Manager objects.

func (ARMResource) MarshalJSON

func (arm ARMResource) MarshalJSON() ([]byte, error)

type ARMTemplate

type ARMTemplate struct {
	Schema         string      `json:"$schema,omitempty"`
	ContentVersion string      `json:"contentVersion,omitempty"`
	Parameters     interface{} `json:"parameters,omitempty"`
	Variables      interface{} `json:"variables,omitempty"`
	Resources      interface{} `json:"resources,omitempty"`
	Outputs        interface{} `json:"outputs,omitempty"`
}

type ArtifactWriter

type ArtifactWriter struct {
	Translator *i18n.Translator
}

ArtifactWriter represents the object that writes artifacts

func (*ArtifactWriter) WriteTLSArtifacts

func (w *ArtifactWriter) WriteTLSArtifacts(containerService *api.ContainerService, apiVersion, template, parameters, artifactsDir string, certsGenerated bool, parametersOnly bool) error

WriteTLSArtifacts saves TLS certificates and keys to the server filesystem

type AvailabilitySetARM

type AvailabilitySetARM struct {
	ARMResource
	compute.AvailabilitySet
}

AvailabilitySetARM embeds the ARMResource type in compute.AvailabilitySet.

func CreateAvailabilitySet

func CreateAvailabilitySet(cs *api.ContainerService, isManagedDisks bool) AvailabilitySetARM

type AzureEndpointConfig

type AzureEndpointConfig struct {
	ResourceManagerVMDNSSuffix string
}

AzureEndpointConfig describes an Azure endpoint

type AzureOSImageConfig

type AzureOSImageConfig struct {
	ImageOffer     string
	ImageSku       string
	ImagePublisher string
	ImageVersion   string
}

AzureOSImageConfig describes an Azure OS image

type Context

type Context struct {
	Translator *i18n.Translator
}

Context represents the object that is passed to the package

type CustomFileReader

type CustomFileReader struct {
	Source io.Reader
	Dest   string
}

CustomFileReader takes represents the source text of a file as an io.Reader and the desired destination to add it to

type DCOSSpecConfig

type DCOSSpecConfig struct {
	DCOS188BootstrapDownloadURL     string
	DCOS190BootstrapDownloadURL     string
	DCOS198BootstrapDownloadURL     string
	DCOS110BootstrapDownloadURL     string
	DCOS111BootstrapDownloadURL     string
	DCOSWindowsBootstrapDownloadURL string
	DcosRepositoryURL               string // For custom install, for example CI, need these three addributes
	DcosClusterPackageListID        string // the id of the package list file
	DcosProviderPackageID           string // the id of the dcos-provider-xxx package
}

DCOSSpecConfig is the configurations of DCOS

type DockerSpecConfig

type DockerSpecConfig struct {
	DockerEngineRepo         string
	DockerComposeDownloadURL string
}

DockerSpecConfig is the configurations of docker

type DocumentDBAccountARM

type DocumentDBAccountARM struct {
	ARMResource
	documentdb.DatabaseAccountCreateUpdateParameters
}

DocumentDBAccountARM embeds the ARMResource type in documentdb.DatabaseAccountCreateUpdateParameters.

type ImageARM

type ImageARM struct {
	ARMResource
	compute.Image
}

ImageARM embeds the ARMResource type in compute.Image.

type KeyVaultARM

type KeyVaultARM struct {
	ARMResource
	keyvault.Vault
}

KeyVaultARM embeds the ARMResource type in keyvault.Vault.

type KeyVaultID

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

KeyVaultID represents a KeyVault instance on Azure

type KeyVaultRef

type KeyVaultRef struct {
	KeyVault      KeyVaultID `json:"keyVault"`
	SecretName    string     `json:"secretName"`
	SecretVersion string     `json:"secretVersion,omitempty"`
}

KeyVaultRef represents a reference to KeyVault instance on Azure

type KubernetesSpecConfig

type KubernetesSpecConfig struct {
	KubernetesImageBase              string
	TillerImageBase                  string
	ACIConnectorImageBase            string
	NVIDIAImageBase                  string
	AzureCNIImageBase                string
	EtcdDownloadURLBase              string
	KubeBinariesSASURLBase           string
	WindowsTelemetryGUID             string
	CNIPluginsDownloadURL            string
	VnetCNILinuxPluginsDownloadURL   string
	VnetCNIWindowsPluginsDownloadURL string
	ContainerdDownloadURLBase        string
}

KubernetesSpecConfig is the kubernetes container images used.

type LoadBalancerARM

type LoadBalancerARM struct {
	ARMResource
	network.LoadBalancer
}

LoadBalancerARM embeds the ARMResource type in network.LoadBalancer.

func CreateLoadBalancer

func CreateLoadBalancer(masterCount int, isVMSS bool) LoadBalancerARM

func CreateMasterInternalLoadBalancer

func CreateMasterInternalLoadBalancer(cs *api.ContainerService) LoadBalancerARM

type NetworkInterfaceARM

type NetworkInterfaceARM struct {
	ARMResource
	network.Interface
}

NetworkInterfaceARM embeds the ARMResource type in network.Interface.

func CreateNetworkInterfaces

func CreateNetworkInterfaces(cs *api.ContainerService) NetworkInterfaceARM

type NetworkSecurityGroupARM

type NetworkSecurityGroupARM struct {
	ARMResource
	network.SecurityGroup
}

NetworkSecurityGroupARM embeds the ARMResource type in network.SecurityGroup.

func CreateNetworkSecurityGroup

func CreateNetworkSecurityGroup(cs *api.ContainerService) NetworkSecurityGroupARM

type PublicIPAddressARM

type PublicIPAddressARM struct {
	ARMResource
	network.PublicIPAddress
}

PublicIPAddressARM embeds the ARMResource type in network.PublicIPAddress.

func CreatePublicIPAddress

func CreatePublicIPAddress() PublicIPAddressARM

type RoleAssignmentARM

type RoleAssignmentARM struct {
	ARMResource
	authorization.RoleAssignment
}

RoleAssignmentARM embeds the ARMResource type in authorization.RoleAssignment.

type RouteTableARM

type RouteTableARM struct {
	ARMResource
	network.RouteTable
}

RouteTableARM embeds the ARMResource type in network.RouteTable.

type StorageAccountARM

type StorageAccountARM struct {
	ARMResource
	storage.Account
}

StorageAccountARM embeds the ARMResource type in storage.Account.

type SystemRoleAssignmentARM

type SystemRoleAssignmentARM struct {
	ARMResource
	sysauth.RoleAssignment
}

SystemRoleAssignmentARM embeds the ARMResource type in authorization.SystemRoleAssignment(2018-01-01-preview).

type TemplateGenerator

type TemplateGenerator struct {
	Translator *i18n.Translator
}

TemplateGenerator represents the object that performs the template generation.

func InitializeTemplateGenerator

func InitializeTemplateGenerator(ctx Context) (*TemplateGenerator, error)

InitializeTemplateGenerator creates a new template generator object

func (*TemplateGenerator) GenerateTemplate

func (t *TemplateGenerator) GenerateTemplate(containerService *api.ContainerService, generatorCode string, aksEngineVersion string) (templateRaw string, parametersRaw string, err error)

GenerateTemplate generates the template from the API Model

func (*TemplateGenerator) GenerateTemplateV2

func (t *TemplateGenerator) GenerateTemplateV2(containerService *api.ContainerService, generatorCode string, acsengineVersion string) (templateRaw string, parametersRaw string, err error)

func (*TemplateGenerator) GetJumpboxCustomDataJSON

func (t *TemplateGenerator) GetJumpboxCustomDataJSON(cs *api.ContainerService) string

func (*TemplateGenerator) GetKubernetesAgentCustomDataJSON

func (t *TemplateGenerator) GetKubernetesAgentCustomDataJSON(cs *api.ContainerService, profile *api.AgentPoolProfile) string

func (*TemplateGenerator) GetKubernetesWindowsAgentCustomDataJSON

func (t *TemplateGenerator) GetKubernetesWindowsAgentCustomDataJSON(cs *api.ContainerService, profile *api.AgentPoolProfile) string

func (*TemplateGenerator) GetMasterCustomDataJSON

func (t *TemplateGenerator) GetMasterCustomDataJSON(cs *api.ContainerService) string

type UserAssignedIdentitiesARM

type UserAssignedIdentitiesARM struct {
	ARMResource
	msi.Identity
}

UserAssignedIdentitiesARM embeds the ARMResource type in msi.Identity.

type V20160330ContainerService

type V20160330ContainerService struct {
	api.TypeMeta
	*v20160330.ContainerService
}

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

type VirtualMachineARM

type VirtualMachineARM struct {
	ARMResource
	compute.VirtualMachine
}

VirtualMachineARM embeds the ARMResource type in compute.VirtualMachine.

func CreateVirtualMachine

func CreateVirtualMachine(cs *api.ContainerService) VirtualMachineARM

type VirtualMachineExtensionARM

type VirtualMachineExtensionARM struct {
	ARMResource
	compute.VirtualMachineExtension
}

VirtualMachineExtensionARM embeds the ARMResource type in compute.VirtualMachineExtension.

func CreateAgentVMASAKSBillingExtension

func CreateAgentVMASAKSBillingExtension(cs *api.ContainerService, profile *api.AgentPoolProfile) VirtualMachineExtensionARM

type VirtualMachineScaleSetARM

type VirtualMachineScaleSetARM struct {
	ARMResource
	compute.VirtualMachineScaleSet
}

VirtualMachineScaleSetARM embeds the ARMResource type in compute.VirtualMachineScaleSet.

type VirtualNetworkARM

type VirtualNetworkARM struct {
	ARMResource
	network.VirtualNetwork
}

VirtualNetworkARM embeds the ARMResource type in network.VirtualNetwork.

func CreateVirtualNetwork

func CreateVirtualNetwork(cs *api.ContainerService) VirtualNetworkARM

type VlabsContainerService

type VlabsContainerService struct {
	api.TypeMeta
	*vlabs.ContainerService
}

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

Directories

Path Synopsis
Package transform provides helper methods to introspect and modify existing ARM templates.
Package transform provides helper methods to introspect and modify existing ARM templates.

Jump to

Keyboard shortcuts

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