acsengine

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2017 License: MIT Imports: 37 Imported by: 0

Documentation

Overview

Package acsengine takes an ACS cluster model and generates the corresponding template

Index

Constants

View Source
const (
	// AzurePublicProdFQDNFormat specifies the format for a prod dns name
	AzurePublicProdFQDNFormat = "%s.%s.cloudapp.azure.com"
	//AzureChinaProdFQDNFormat specify the endpoint of Azure China Cloud
	AzureChinaProdFQDNFormat = "%s.%s.cloudapp.chinacloudapi.cn"
)
View Source
const (
	// DefaultMasterSubnet specifies the default master subnet for DCOS or Swarm
	DefaultMasterSubnet = "172.16.0.0/24"
	// DefaultFirstConsecutiveStaticIP specifies the static IP address on master 0 for DCOS or Swarm
	DefaultFirstConsecutiveStaticIP = "172.16.0.5"
	// DefaultSwarmWindowsMasterSubnet specifies the default master subnet for a Swarm Windows cluster
	DefaultSwarmWindowsMasterSubnet = "192.168.255.0/24"
	// DefaultSwarmWindowsFirstConsecutiveStaticIP specifies the static IP address on master 0 for a Swarm WIndows cluster
	DefaultSwarmWindowsFirstConsecutiveStaticIP = "192.168.255.5"
	// DefaultKubernetesMasterSubnet specifies the default subnet for masters and agents.
	DefaultKubernetesMasterSubnet = "10.240.0.0/16"
	// DefaultKubernetesClusterSubnet specifies the default subnet for pods.
	DefaultKubernetesClusterSubnet = "10.244.0.0/16"
	// DefaultDockerBridgeSubnet specifies the default subnet for the docker bridge network for masters and agents.
	DefaultDockerBridgeSubnet = "172.17.0.1/16"
	// DefaultFirstConsecutiveKubernetesStaticIP specifies the static IP address on Kubernetes master 0
	DefaultFirstConsecutiveKubernetesStaticIP = "10.240.255.5"
	// DefaultAgentSubnetTemplate specifies a default agent subnet
	DefaultAgentSubnetTemplate = "10.%d.0.0/16"
	// DefaultKubernetesSubnet specifies the default subnet used for all masters, agents and pods
	// when VNET integration is enabled.
	DefaultKubernetesSubnet = "10.240.0.0/12"
	// DefaultKubernetesFirstConsecutiveStaticIPOffset specifies the IP address offset of master 0
	// when VNET integration is enabled.
	DefaultKubernetesFirstConsecutiveStaticIPOffset = 5
	// DefaultAgentIPAddressCount is the default number of IP addresses per network interface on agents
	DefaultAgentIPAddressCount = 1
	// DefaultAgentMultiIPAddressCount is the default number of IP addresses per network interface on agents,
	// when VNET integration is enabled. It can be overridden per pool by setting the pool's IPAdddressCount property.
	DefaultAgentMultiIPAddressCount = 128
	// DefaultKubernetesClusterDomain is the dns suffix used in the cluster (used as a SAN in the PKI generation)
	DefaultKubernetesClusterDomain = "cluster.local"
	// DefaultInternalLbStaticIPOffset specifies the offset of the internal LoadBalancer's IP
	// address relative to the first consecutive Kubernetes static IP
	DefaultInternalLbStaticIPOffset = 10
	// DefaultNetworkPolicy is disabling network policy enforcement
	DefaultNetworkPolicy = "none"
	// DefaultKubernetesNodeStatusUpdateFrequency is 10s, see --node-status-update-frequency at https://kubernetes.io/docs/admin/kubelet/
	DefaultKubernetesNodeStatusUpdateFrequency = "10s"
	// DefaultKubernetesCtrlMgrNodeMonitorGracePeriod is 40s, see --node-monitor-grace-period at https://kubernetes.io/docs/admin/kube-controller-manager/
	DefaultKubernetesCtrlMgrNodeMonitorGracePeriod = "40s"
	// DefaultKubernetesCtrlMgrPodEvictionTimeout is 5m0s, see --pod-eviction-timeout at https://kubernetes.io/docs/admin/kube-controller-manager/
	DefaultKubernetesCtrlMgrPodEvictionTimeout = "5m0s"
	// DefaultKubernetesCtrlMgrRouteReconciliationPeriod is 10s, see --route-reconciliation-period at https://kubernetes.io/docs/admin/kube-controller-manager/
	DefaultKubernetesCtrlMgrRouteReconciliationPeriod = "10s"
	// DefaultKubernetesCloudProviderBackoff is false to disable cloudprovider backoff implementation for API calls
	DefaultKubernetesCloudProviderBackoff = false
	// DefaultKubernetesCloudProviderBackoffRetries is 6, takes effect if DefaultKubernetesCloudProviderBackoff is true
	DefaultKubernetesCloudProviderBackoffRetries = 6
	// DefaultKubernetesCloudProviderBackoffJitter is 1, takes effect if DefaultKubernetesCloudProviderBackoff is true
	DefaultKubernetesCloudProviderBackoffJitter = 1.0
	// DefaultKubernetesCloudProviderBackoffDuration is 5, takes effect if DefaultKubernetesCloudProviderBackoff is true
	DefaultKubernetesCloudProviderBackoffDuration = 5
	// DefaultKubernetesCloudProviderBackoffExponent is 1.5, takes effect if DefaultKubernetesCloudProviderBackoff is true
	DefaultKubernetesCloudProviderBackoffExponent = 1.5
	// DefaultKubernetesCloudProviderRateLimit is false to disable cloudprovider rate limiting implementation for API calls
	DefaultKubernetesCloudProviderRateLimit = false
	// DefaultKubernetesCloudProviderRateLimitQPS is 3, takes effect if DefaultKubernetesCloudProviderRateLimit is true
	DefaultKubernetesCloudProviderRateLimitQPS = 3.0
	// DefaultKubernetesCloudProviderRateLimitBucket is 10, takes effect if DefaultKubernetesCloudProviderRateLimit is true
	DefaultKubernetesCloudProviderRateLimitBucket = 10
	// DefaultTillerImage defines the Helm Tiller deployment version on Kubernetes Clusters
	DefaultTillerImage = "tiller:v2.5.1"
)
View Source
const (
	//MsecndDCOSBootstrapDownloadURL Azure CDN to download DCOS1.7.3
	MsecndDCOSBootstrapDownloadURL = "https://az837203.vo.msecnd.net/dcos/%s/bootstrap/%s.bootstrap.tar.xz"
	//AzureEdgeDCOSBootstrapDownloadURL is the azure edge CDN download url
	AzureEdgeDCOSBootstrapDownloadURL = "https://dcosio.azureedge.net/dcos/%s/bootstrap/%s.bootstrap.tar.xz"
	//AzureChinaCloudDCOSBootstrapDownloadURL is the China specific DCOS package download url.
	AzureChinaCloudDCOSBootstrapDownloadURL = "https://acsengine.blob.core.chinacloudapi.cn/dcos/%s.bootstrap.tar.xz"
)
View Source
const (
	// ValidityDuration specifies the duration an TLS certificate is valid
	ValidityDuration = time.Hour * 24 * 365 * 2
	// PkiKeySize is the size in bytes of the PKI key
	PkiKeySize = 4096
)
View Source
const (
	// SSHKeySize is the size (in bytes) of SSH key to create
	SSHKeySize = 4096
)

Variables

View Source
var (
	//AzureCloudSpec is the default configurations for global azure.
	AzureCloudSpec = AzureEnvironmentSpecConfig{

		DockerSpecConfig: DockerSpecConfig{
			DockerEngineRepo: "https://aptdocker.azureedge.net/repo",
		},

		KubernetesSpecConfig: KubernetesSpecConfig{
			KubernetesImageBase:    "gcrio.azureedge.net/google_containers/",
			TillerImageBase:        "gcrio.azureedge.net/kubernetes-helm/",
			KubeBinariesSASURLBase: "https://acs-mirror.azureedge.net/wink8s/",
		},

		DCOSSpecConfig: DCOSSpecConfig{
			DCOS173BootstrapDownloadURL: fmt.Sprintf(MsecndDCOSBootstrapDownloadURL, "testing", "df308b6fc3bd91e1277baa5a3db928ae70964722"),
			DCOS184BootstrapDownloadURL: fmt.Sprintf(AzureEdgeDCOSBootstrapDownloadURL, "testing", "5b4aa43610c57ee1d60b4aa0751a1fb75824c083"),
			DCOS187BootstrapDownloadURL: fmt.Sprintf(AzureEdgeDCOSBootstrapDownloadURL, "stable", "e73ba2b1cd17795e4dcb3d6647d11a29b9c35084"),
			DCOS188BootstrapDownloadURL: fmt.Sprintf(AzureEdgeDCOSBootstrapDownloadURL, "stable", "5df43052907c021eeb5de145419a3da1898c58a5"),
			DCOS190BootstrapDownloadURL: fmt.Sprintf(AzureEdgeDCOSBootstrapDownloadURL, "stable", "58fd0833ce81b6244fc73bf65b5deb43217b0bd7"),
		},
	}

	//AzureChinaCloudSpec is the configurations for Azure China (Mooncake)
	AzureChinaCloudSpec = AzureEnvironmentSpecConfig{

		DockerSpecConfig: DockerSpecConfig{
			DockerEngineRepo: "https://mirror.azure.cn/docker-engine/apt/repo/",
		},

		KubernetesSpecConfig: KubernetesSpecConfig{
			KubernetesImageBase:    "mirror.azure.cn:5000/google_containers/",
			KubeBinariesSASURLBase: "https://acs-mirror.azureedge.net/wink8s/",
		},
		DCOSSpecConfig: DCOSSpecConfig{
			DCOS173BootstrapDownloadURL: fmt.Sprintf(AzureChinaCloudDCOSBootstrapDownloadURL, "df308b6fc3bd91e1277baa5a3db928ae70964722"),
			DCOS184BootstrapDownloadURL: fmt.Sprintf(AzureChinaCloudDCOSBootstrapDownloadURL, "5b4aa43610c57ee1d60b4aa0751a1fb75824c083"),
			DCOS187BootstrapDownloadURL: fmt.Sprintf(AzureChinaCloudDCOSBootstrapDownloadURL, "e73ba2b1cd17795e4dcb3d6647d11a29b9c35084"),
			DCOS188BootstrapDownloadURL: fmt.Sprintf(AzureChinaCloudDCOSBootstrapDownloadURL, "5df43052907c021eeb5de145419a3da1898c58a5"),
		},
	}
)
View Source
var AzureLocations = []string{
	"australiaeast",
	"australiasoutheast",
	"brazilsouth",
	"canadacentral",
	"canadaeast",
	"centralindia",
	"centralus",
	"centraluseuap",
	"chinaeast",
	"chinanorth",
	"eastasia",
	"eastus",
	"eastus2",
	"eastus2euap",
	"japaneast",
	"japanwest",
	"koreacentral",
	"koreasouth",
	"northcentralus",
	"northeurope",
	"southcentralus",
	"southeastasia",
	"southindia",
	"uksouth",
	"ukwest",
	"westcentralus",
	"westeurope",
	"westindia",
	"westus",
	"westus2",
}

AzureLocations provides all azure regions in prod. Related powershell to refresh this list:

Get-AzureRmLocation | Select-Object -Property Location
View Source
var KubeImages = map[string]map[string]string{
	api.Kubernetes172: {
		"hyperkube":       "hyperkube-amd64:v1.7.2",
		"dashboard":       "kubernetes-dashboard-amd64:v1.6.1",
		"exechealthz":     "exechealthz-amd64:1.2",
		"addonresizer":    "addon-resizer:1.7",
		"heapster":        "heapster:v1.4.0",
		"dns":             "k8s-dns-kube-dns-amd64:1.14.4",
		"addonmanager":    "kube-addon-manager-amd64:v6.4-beta.2",
		"dnsmasq":         "k8s-dns-dnsmasq-amd64:1.14.4",
		"pause":           "pause-amd64:3.0",
		"tiller":          DefaultTillerImage,
		"windowszip":      "v1.7.2intwinnat.zip",
		"nodestatusfreq":  DefaultKubernetesNodeStatusUpdateFrequency,
		"nodegraceperiod": DefaultKubernetesCtrlMgrNodeMonitorGracePeriod,
		"podeviction":     DefaultKubernetesCtrlMgrPodEvictionTimeout,
		"routeperiod":     DefaultKubernetesCtrlMgrRouteReconciliationPeriod,
		"backoffretries":  strconv.Itoa(DefaultKubernetesCloudProviderBackoffRetries),
		"backoffjitter":   strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffJitter, 'f', -1, 64),
		"backoffduration": strconv.Itoa(DefaultKubernetesCloudProviderBackoffDuration),
		"backoffexponent": strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffExponent, 'f', -1, 64),
		"ratelimitqps":    strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPS, 'f', -1, 64),
		"ratelimitbucket": strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucket),
	},
	api.Kubernetes171: {
		"hyperkube":       "hyperkube-amd64:v1.7.1",
		"dashboard":       "kubernetes-dashboard-amd64:v1.6.1",
		"exechealthz":     "exechealthz-amd64:1.2",
		"addonresizer":    "addon-resizer:1.7",
		"heapster":        "heapster:v1.4.0",
		"dns":             "k8s-dns-kube-dns-amd64:1.14.4",
		"addonmanager":    "kube-addon-manager-amd64:v6.4-beta.2",
		"dnsmasq":         "k8s-dns-dnsmasq-amd64:1.14.4",
		"pause":           "pause-amd64:3.0",
		"tiller":          DefaultTillerImage,
		"windowszip":      "v1.7.1intwinnat.zip",
		"nodestatusfreq":  DefaultKubernetesNodeStatusUpdateFrequency,
		"nodegraceperiod": DefaultKubernetesCtrlMgrNodeMonitorGracePeriod,
		"podeviction":     DefaultKubernetesCtrlMgrPodEvictionTimeout,
		"routeperiod":     DefaultKubernetesCtrlMgrRouteReconciliationPeriod,
		"backoffretries":  strconv.Itoa(DefaultKubernetesCloudProviderBackoffRetries),
		"backoffjitter":   strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffJitter, 'f', -1, 64),
		"backoffduration": strconv.Itoa(DefaultKubernetesCloudProviderBackoffDuration),
		"backoffexponent": strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffExponent, 'f', -1, 64),
		"ratelimitqps":    strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPS, 'f', -1, 64),
		"ratelimitbucket": strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucket),
	},
	api.Kubernetes170: {
		"hyperkube":       "hyperkube-amd64:v1.7.0",
		"dashboard":       "kubernetes-dashboard-amd64:v1.6.1",
		"exechealthz":     "exechealthz-amd64:1.2",
		"addonresizer":    "addon-resizer:1.7",
		"heapster":        "heapster:v1.4.0",
		"dns":             "k8s-dns-kube-dns-amd64:1.14.4",
		"addonmanager":    "kube-addon-manager-amd64:v6.4-beta.2",
		"dnsmasq":         "k8s-dns-dnsmasq-amd64:1.14.4",
		"pause":           "pause-amd64:3.0",
		"tiller":          DefaultTillerImage,
		"windowszip":      "v1.7.0intwinnat.zip",
		"nodestatusfreq":  DefaultKubernetesNodeStatusUpdateFrequency,
		"nodegraceperiod": DefaultKubernetesCtrlMgrNodeMonitorGracePeriod,
		"podeviction":     DefaultKubernetesCtrlMgrPodEvictionTimeout,
		"routeperiod":     DefaultKubernetesCtrlMgrRouteReconciliationPeriod,
		"backoffretries":  strconv.Itoa(DefaultKubernetesCloudProviderBackoffRetries),
		"backoffjitter":   strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffJitter, 'f', -1, 64),
		"backoffduration": strconv.Itoa(DefaultKubernetesCloudProviderBackoffDuration),
		"backoffexponent": strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffExponent, 'f', -1, 64),
		"ratelimitqps":    strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPS, 'f', -1, 64),
		"ratelimitbucket": strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucket),
	},
	api.Kubernetes166: {
		"hyperkube":       "hyperkube-amd64:v1.6.6",
		"dashboard":       "kubernetes-dashboard-amd64:v1.6.1",
		"exechealthz":     "exechealthz-amd64:1.2",
		"addonresizer":    "addon-resizer:1.7",
		"heapster":        "heapster:v1.3.0",
		"dns":             "k8s-dns-kube-dns-amd64:1.14.4",
		"addonmanager":    "kube-addon-manager-amd64:v6.4-beta.2",
		"dnsmasq":         "k8s-dns-dnsmasq-amd64:1.13.0",
		"pause":           "pause-amd64:3.0",
		"tiller":          DefaultTillerImage,
		"windowszip":      "v1.6.6intwinnat.zip",
		"nodestatusfreq":  DefaultKubernetesNodeStatusUpdateFrequency,
		"nodegraceperiod": DefaultKubernetesCtrlMgrNodeMonitorGracePeriod,
		"podeviction":     DefaultKubernetesCtrlMgrPodEvictionTimeout,
		"routeperiod":     DefaultKubernetesCtrlMgrRouteReconciliationPeriod,
		"backoffretries":  strconv.Itoa(DefaultKubernetesCloudProviderBackoffRetries),
		"backoffjitter":   strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffJitter, 'f', -1, 64),
		"backoffduration": strconv.Itoa(DefaultKubernetesCloudProviderBackoffDuration),
		"backoffexponent": strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffExponent, 'f', -1, 64),
		"ratelimitqps":    strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPS, 'f', -1, 64),
		"ratelimitbucket": strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucket),
	},
	api.Kubernetes162: {
		"hyperkube":       "hyperkube-amd64:v1.6.2",
		"dashboard":       "kubernetes-dashboard-amd64:v1.6.0",
		"exechealthz":     "exechealthz-amd64:1.2",
		"addonresizer":    "addon-resizer:1.6",
		"heapster":        "heapster:v1.2.0",
		"dns":             "k8s-dns-kube-dns-amd64:1.13.0",
		"addonmanager":    "kube-addon-manager-amd64:v6.4-beta.2",
		"dnsmasq":         "k8s-dns-dnsmasq-amd64:1.13.0",
		"pause":           "pause-amd64:3.0",
		"tiller":          DefaultTillerImage,
		"windowszip":      "v1.6.2intwinnat.zip",
		"nodestatusfreq":  DefaultKubernetesNodeStatusUpdateFrequency,
		"nodegraceperiod": DefaultKubernetesCtrlMgrNodeMonitorGracePeriod,
		"podeviction":     DefaultKubernetesCtrlMgrPodEvictionTimeout,
		"routeperiod":     DefaultKubernetesCtrlMgrRouteReconciliationPeriod,
	},

	api.Kubernetes160: {
		"hyperkube":       "hyperkube-amd64:v1.6.0",
		"dashboard":       "kubernetes-dashboard-amd64:v1.6.0",
		"exechealthz":     "exechealthz-amd64:1.2",
		"addonresizer":    "addon-resizer:1.6",
		"heapster":        "heapster:v1.2.0",
		"dns":             "k8s-dns-kube-dns-amd64:1.13.0",
		"addonmanager":    "kube-addon-manager-amd64:v6.4-beta.2",
		"dnsmasq":         "k8s-dns-dnsmasq-amd64:1.13.0",
		"pause":           "pause-amd64:3.0",
		"tiller":          DefaultTillerImage,
		"windowszip":      "v1.6.0intwinnat.zip",
		"nodestatusfreq":  DefaultKubernetesNodeStatusUpdateFrequency,
		"nodegraceperiod": DefaultKubernetesCtrlMgrNodeMonitorGracePeriod,
		"podeviction":     DefaultKubernetesCtrlMgrPodEvictionTimeout,
		"routeperiod":     DefaultKubernetesCtrlMgrRouteReconciliationPeriod,
	},

	api.Kubernetes157: {
		"hyperkube":       "hyperkube-amd64:v1.5.7",
		"dashboard":       "kubernetes-dashboard-amd64:v1.5.1",
		"exechealthz":     "exechealthz-amd64:1.2",
		"addonresizer":    "addon-resizer:1.6",
		"heapster":        "heapster:v1.2.0",
		"dns":             "kubedns-amd64:1.7",
		"addonmanager":    "kube-addon-manager-amd64:v6.4-beta.2",
		"dnsmasq":         "kube-dnsmasq-amd64:1.3",
		"pause":           "pause-amd64:3.0",
		"tiller":          DefaultTillerImage,
		"windowszip":      "v1.5.7intwinnat.zip",
		"nodestatusfreq":  DefaultKubernetesNodeStatusUpdateFrequency,
		"nodegraceperiod": DefaultKubernetesCtrlMgrNodeMonitorGracePeriod,
		"podeviction":     DefaultKubernetesCtrlMgrPodEvictionTimeout,
		"routeperiod":     DefaultKubernetesCtrlMgrRouteReconciliationPeriod,
	},

	api.Kubernetes153: {
		"hyperkube":       "hyperkube-amd64:v1.5.3",
		"dashboard":       "kubernetes-dashboard-amd64:v1.5.1",
		"exechealthz":     "exechealthz-amd64:1.2",
		"addonresizer":    "addon-resizer:1.6",
		"heapster":        "heapster:v1.2.0",
		"dns":             "kubedns-amd64:1.7",
		"addonmanager":    "kube-addon-manager-amd64:v6.4-beta.2",
		"dnsmasq":         "kube-dnsmasq-amd64:1.3",
		"pause":           "pause-amd64:3.0",
		"windowszip":      "v1.5.3intwinnat.zip",
		"tiller":          DefaultTillerImage,
		"nodestatusfreq":  DefaultKubernetesNodeStatusUpdateFrequency,
		"nodegraceperiod": DefaultKubernetesCtrlMgrNodeMonitorGracePeriod,
		"podeviction":     DefaultKubernetesCtrlMgrPodEvictionTimeout,
		"routeperiod":     DefaultKubernetesCtrlMgrRouteReconciliationPeriod,
	},
}

KubeImages represents Docker images used for Kubernetes components based on Kubernetes version

Functions

func BuildAzureParametersFile added in v0.3.0

func BuildAzureParametersFile(content string) (string, error)

BuildAzureParametersFile will add the correct schema and contentversion information

func CreatePki

func CreatePki(extraFQDNs []string, extraIPs []net.IP, clusterDomain string, caPair *PkiKeyCertPair) (*PkiKeyCertPair, *PkiKeyCertPair, *PkiKeyCertPair, error)

CreatePki creates PKI certificates

func FormatAzureProdFQDN

func FormatAzureProdFQDN(fqdnPrefix string, location string) string

FormatAzureProdFQDN constructs an Azure prod fqdn

func FormatAzureProdFQDNs

func FormatAzureProdFQDNs(fqdnPrefix string) []string

FormatAzureProdFQDNs constructs all possible Azure prod fqdn

func GenerateClusterID

func GenerateClusterID(properties *api.Properties) string

GenerateClusterID creates a unique 8 string cluster ID

func GenerateKubeConfig

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

GenerateKubeConfig returns a JSON string representing the KubeConfig

func GetClassicAllowedSizes

func GetClassicAllowedSizes() string

GetClassicAllowedSizes returns the classic allowed sizes

func GetClassicSizeMap

func GetClassicSizeMap() string

GetClassicSizeMap returns the size / storage map

func GetCloudTargetEnv

func GetCloudTargetEnv(location string) string

GetCloudTargetEnv determines and returns whether the region is a sovereign cloud which have their own data compliance regulations (China/Germany/USGov) or standard

Azure public cloud

func GetDCOSMasterAllowedSizes

func GetDCOSMasterAllowedSizes() string

GetDCOSMasterAllowedSizes returns the master allowed sizes

func GetKubernetesAgentAllowedSizes

func GetKubernetesAgentAllowedSizes() string

GetKubernetesAgentAllowedSizes returns the allowed sizes for Kubernetes agent

func GetMasterAgentAllowedSizes

func GetMasterAgentAllowedSizes() string

GetMasterAgentAllowedSizes returns the agent allowed sizes

func GetSizeMap

func GetSizeMap() string

GetSizeMap returns the size / storage map

func GetTenantID

func GetTenantID(env azure.Environment, 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.

func PrettyPrintArmTemplate

func PrettyPrintArmTemplate(template string) (string, error)

PrettyPrintArmTemplate will pretty print the arm template ensuring ordered by params, vars, resources, and outputs

func PrettyPrintJSON

func PrettyPrintJSON(content string) (string, error)

PrettyPrintJSON will pretty print the json into

func SetPropertiesDefaults

func SetPropertiesDefaults(cs *api.ContainerService) (bool, error)

SetPropertiesDefaults for the container Properties, returns true if certs are generated

func VersionOrdinal added in v0.1.2

func VersionOrdinal(version string) string

VersionOrdinal checks equality between two orchestrator version numbers

Types

type ArtifactWriter added in v0.5.0

type ArtifactWriter struct {
	Translator *i18n.Translator
}

ArtifactWriter represents the object that writes artifacts

func (*ArtifactWriter) WriteTLSArtifacts added in v0.5.0

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 AzureEnvironmentSpecConfig

type AzureEnvironmentSpecConfig struct {
	DockerSpecConfig     DockerSpecConfig
	KubernetesSpecConfig KubernetesSpecConfig
	DCOSSpecConfig       DCOSSpecConfig
}

AzureEnvironmentSpecConfig is the overall configuration differences in different cloud environments.

func GetCloudSpecConfig

func GetCloudSpecConfig(location string) AzureEnvironmentSpecConfig

GetCloudSpecConfig returns the kubenernetes container images url configurations based on the deploy target environment for example: if the target is the public azure, then the default container image url should be gcrio.azureedge.net/google_container/... if the target is azure china, then the default container image should be mirror.azure.cn:5000/google_container/...

type Context added in v0.5.0

type Context struct {
	Translator *i18n.Translator
}

Context represents the object that is passed to the package

type DCOSNodeType

type DCOSNodeType string

DCOSNodeType represents the type of DCOS Node

const (
	// DCOSMaster represents the master node type
	DCOSMaster DCOSNodeType = "DCOSMaster"
	// DCOSPrivateAgent represents the private agent node type
	DCOSPrivateAgent DCOSNodeType = "DCOSPrivateAgent"
	// DCOSPublicAgent represents the public agent node type
	DCOSPublicAgent DCOSNodeType = "DCOSPublicAgent"
)

type DCOSSpecConfig

type DCOSSpecConfig struct {
	DCOS173BootstrapDownloadURL string
	DCOS184BootstrapDownloadURL string
	DCOS187BootstrapDownloadURL string
	DCOS188BootstrapDownloadURL string
	DCOS190BootstrapDownloadURL string
}

DCOSSpecConfig is the configurations of DCOS

type DockerSpecConfig

type DockerSpecConfig struct {
	DockerEngineRepo string
}

DockerSpecConfig is the configurations of docker

type FileSaver added in v0.5.0

type FileSaver struct {
	Translator *i18n.Translator
}

FileSaver represents the object that save string or byte data to file

func (*FileSaver) SaveFile added in v0.5.0

func (f *FileSaver) SaveFile(dir string, file string, data []byte) error

SaveFile saves binary data to file

func (*FileSaver) SaveFileString added in v0.5.0

func (f *FileSaver) SaveFileString(dir string, file string, data string) error

SaveFileString saves string to file

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
	KubeBinariesSASURLBase string
}

KubernetesSpecConfig is the kubernetes container images used.

type PkiKeyCertPair

type PkiKeyCertPair struct {
	CertificatePem string
	PrivateKeyPem  string
}

PkiKeyCertPair represents an PKI public and private cert pair

type SSHCreator added in v0.5.0

type SSHCreator struct {
	Translator *i18n.Translator
}

SSHCreator represents the object that creates SSH key pair

func (*SSHCreator) CreateSSH added in v0.5.0

func (s *SSHCreator) CreateSSH(rg io.Reader) (privateKey *rsa.PrivateKey, publicKeyString string, err error)

CreateSSH creates an SSH key pair.

func (*SSHCreator) CreateSaveSSH added in v0.5.0

func (s *SSHCreator) CreateSaveSSH(username, outputDirectory string) (privateKey *rsa.PrivateKey, publicKeyString string, err error)

CreateSaveSSH generates and stashes an SSH key pair.

type TemplateGenerator

type TemplateGenerator struct {
	ClassicMode bool
	Translator  *i18n.Translator
}

TemplateGenerator represents the object that performs the template generation.

func InitializeTemplateGenerator

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

InitializeTemplateGenerator creates a new template generator object

func (*TemplateGenerator) GenerateTemplate

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

GenerateTemplate generates the template from the API Model

type Transformer added in v0.5.0

type Transformer struct {
	Translator *i18n.Translator
}

Transformer represents the object that transforms template

func (*Transformer) NormalizeForK8sVMASScalingUp added in v0.5.0

func (t *Transformer) NormalizeForK8sVMASScalingUp(logger *logrus.Entry, templateMap map[string]interface{}) error

NormalizeForK8sVMASScalingUp takes a template and removes elements that are unwanted in a K8s VMAS scale up/down case

func (*Transformer) NormalizeForVMSSScaling added in v0.5.0

func (t *Transformer) NormalizeForVMSSScaling(logger *logrus.Entry, templateMap map[string]interface{}) error

NormalizeForVMSSScaling takes a template and removes elements that are unwanted in a VMSS scale up/down case

func (*Transformer) NormalizeMasterResourcesForScaling added in v0.5.0

func (t *Transformer) NormalizeMasterResourcesForScaling(logger *logrus.Entry, templateMap map[string]interface{}) error

NormalizeMasterResourcesForScaling takes a template and removes elements that are unwanted in any scale up/down case

func (*Transformer) NormalizeResourcesForK8sAgentUpgrade added in v0.5.0

func (t *Transformer) NormalizeResourcesForK8sAgentUpgrade(logger *logrus.Entry, templateMap map[string]interface{}, isMasterManagedDisk bool, agentPoolsToPreserve map[string]bool) error

NormalizeResourcesForK8sAgentUpgrade takes a template and removes elements that are unwanted in any scale up/down case

func (*Transformer) NormalizeResourcesForK8sMasterUpgrade added in v0.5.0

func (t *Transformer) NormalizeResourcesForK8sMasterUpgrade(logger *logrus.Entry, templateMap map[string]interface{}, isMasterManagedDisk bool, agentPoolsToPreserve map[string]bool) error

NormalizeResourcesForK8sMasterUpgrade takes a template and removes elements that are unwanted in any scale up/down case

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 acs-engine is different from the json that the ACS RP Api gets from ARM

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 acs-engine is different from the json that the ACS RP Api gets from ARM

Jump to

Keyboard shortcuts

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