Documentation ¶
Overview ¶
Package acsengine takes an ACS cluster model and generates the corresponding template
Index ¶
- Constants
- Variables
- func CreateMockContainerService(containerServiceName, orchestratorVersion string, masterCount, agentCount int, ...) *api.ContainerService
- func FormatAzureProdFQDN(fqdnPrefix string, location string) string
- func GenerateKubeConfig(properties *api.Properties, location string) (string, error)
- func GetClassicAllowedSizes() string
- func GetClassicSizeMap() string
- func GetDCOSMasterAllowedSizes() string
- func GetKubernetesAgentAllowedSizes() string
- func GetMasterAgentAllowedSizes() string
- func GetSizeMap() string
- func GetTenantID(resourceManagerEndpoint string, subscriptionID string) (string, error)
- type ArtifactWriter
- type AzureEndpointConfig
- type AzureOSImageConfig
- type Context
- type CustomFileReader
- type DCOSNodeType
- type DCOSSpecConfig
- type DockerSpecConfig
- type KeyVaultID
- type KeyVaultRef
- type KubernetesSpecConfig
- type TemplateGenerator
- type V20160330ContainerService
- type VlabsContainerService
Constants ¶
const ( // DefaultOpenShiftMasterSubnet is the default value for master subnet for Openshift. DefaultOpenShiftMasterSubnet = "10.0.0.0/24" // DefaultOpenShiftFirstConsecutiveStaticIP is the default static ip address for master 0 for Openshift. DefaultOpenShiftFirstConsecutiveStaticIP = "10.0.0.11" // 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" // DefaultDCOSMasterSubnet specifies the default master subnet for a DCOS cluster DefaultDCOSMasterSubnet = "192.168.255.0/24" // DefaultDCOSFirstConsecutiveStaticIP specifies the static IP address on master 0 for a DCOS cluster DefaultDCOSFirstConsecutiveStaticIP = "192.168.255.5" // DefaultDCOSBootstrapStaticIP specifies the static IP address on bootstrap for a DCOS cluster DefaultDCOSBootstrapStaticIP = "192.168.255.240" // DefaultKubernetesMasterSubnet specifies the default subnet for masters and agents. // Except when master VMSS is used, this specifies the default subnet for masters. 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" // 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" // DefaultVNETCIDR is the default CIDR block for the VNET DefaultVNETCIDR = "10.0.0.0/8" // DefaultKubernetesMaxPods is the maximum number of pods to run on a node. DefaultKubernetesMaxPods = 110 // DefaultKubernetesMaxPodsVNETIntegrated is the maximum number of pods to run on a node when VNET integration is enabled. DefaultKubernetesMaxPodsVNETIntegrated = 30 // 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 // 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" // 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" // DefaultNetworkPlugin defines the network plugin to use by default DefaultNetworkPlugin = NetworkPluginKubenet // DefaultNetworkPolicy defines the network policy implementation to use by default DefaultNetworkPolicy = "" // DefaultNetworkPluginWindows defines the network plugin implementation to use by default for clusters with Windows agent pools DefaultNetworkPluginWindows = NetworkPluginKubenet // DefaultNetworkPolicyWindows defines the network policy implementation to use by default for clusters with Windows agent pools DefaultNetworkPolicyWindows = "" // DefaultContainerRuntime is docker DefaultContainerRuntime = "docker" // DefaultKubernetesNodeStatusUpdateFrequency is 10s, see --node-status-update-frequency at https://kubernetes.io/docs/admin/kubelet/ DefaultKubernetesNodeStatusUpdateFrequency = "10s" // DefaultKubernetesHardEvictionThreshold is memory.available<100Mi,nodefs.available<10%,nodefs.inodesFree<5%, see --eviction-hard at https://kubernetes.io/docs/admin/kubelet/ DefaultKubernetesHardEvictionThreshold = "memory.available<100Mi,nodefs.available<10%,nodefs.inodesFree<5%" // 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" // DefaultKubernetesCtrlMgrTerminatedPodGcThreshold is set to 5000, see --terminated-pod-gc-threshold at https://kubernetes.io/docs/admin/kube-controller-manager/ and https://github.com/kubernetes/kubernetes/issues/22680 DefaultKubernetesCtrlMgrTerminatedPodGcThreshold = "5000" // DefaultKubernetesCtrlMgrUseSvcAccountCreds is "true", see --use-service-account-credentials at https://kubernetes.io/docs/admin/kube-controller-manager/ DefaultKubernetesCtrlMgrUseSvcAccountCreds = "false" // DefaultKubernetesCloudProviderBackoff is false to disable cloudprovider backoff implementation for API calls DefaultKubernetesCloudProviderBackoff = true // DefaultKubernetesCloudProviderRateLimit is false to disable cloudprovider rate limiting implementation for API calls DefaultKubernetesCloudProviderRateLimit = true // 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" // DefaultTillerMaxHistory limits the maximum number of revisions saved per release. Use 0 for no limit. DefaultTillerMaxHistory = 0 // 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" // DefaultKubernetesDNSServiceIP specifies the IP address that kube-dns // listens on by default. must by in the default Service CIDR range. DefaultKubernetesDNSServiceIP = "10.0.0.10" // DefaultKubernetesServiceCIDR specifies the IP subnet that kubernetes will // create Service IPs within. DefaultKubernetesServiceCIDR = "10.0.0.0/16" //DefaultKubernetesGCHighThreshold specifies the value for for the image-gc-high-threshold kubelet flag DefaultKubernetesGCHighThreshold = 85 //DefaultKubernetesGCLowThreshold specifies the value for the image-gc-low-threshold kubelet flag DefaultKubernetesGCLowThreshold = 80 // DefaultGeneratorCode specifies the source generator of the cluster template. DefaultGeneratorCode = "acsengine" // DefaultEtcdVersion specifies the default etcd version to install DefaultEtcdVersion = "3.2.23" // DefaultEtcdDiskSize specifies the default size for Kubernetes master etcd disk volumes in GB DefaultEtcdDiskSize = "256" // DefaultEtcdDiskSizeGT3Nodes = size for Kubernetes master etcd disk volumes in GB if > 3 nodes DefaultEtcdDiskSizeGT3Nodes = "512" // DefaultEtcdDiskSizeGT10Nodes = size for Kubernetes master etcd disk volumes in GB if > 10 nodes DefaultEtcdDiskSizeGT10Nodes = "1024" // DefaultEtcdDiskSizeGT20Nodes = size for Kubernetes master etcd disk volumes in GB if > 20 nodes DefaultEtcdDiskSizeGT20Nodes = "2048" // DefaultReschedulerAddonName is the name of the rescheduler addon deployment DefaultReschedulerAddonName = "rescheduler" // 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 // DefaultKubeletEventQPS is 0, see --event-qps at https://kubernetes.io/docs/reference/generated/kubelet/ DefaultKubeletEventQPS = "0" // DefaultKubeletCadvisorPort is 0, see --cadvisor-port at https://kubernetes.io/docs/reference/generated/kubelet/ DefaultKubeletCadvisorPort = "0" // DefaultJumpboxDiskSize specifies the default size for private cluster jumpbox OS disk in GB DefaultJumpboxDiskSize = 30 // DefaultJumpboxUsername specifies the default admin username for the private cluster jumpbox DefaultJumpboxUsername = "azureuser" // DefaultKubeletPodMaxPIDs specifies the default max pid authorized by pods DefaultKubeletPodMaxPIDs = 100 // DefaultKubernetesAgentSubnetVMSS specifies the default subnet for agents when master is VMSS DefaultKubernetesAgentSubnetVMSS = "10.248.0.0/13" // DefaultUserAssignedID specifies the default name for the user assigned identity DefaultUserAssignedID = "acsenginetestid" )
const ( //DefaultExtensionsRootURL Root URL for extensions DefaultExtensionsRootURL = "https://raw.githubusercontent.com/Azure/acs-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" )
const ( // AzureCniPluginVerLinux specifies version of Azure CNI plugin, which has been mirrored from // https://github.com/Azure/azure-container-networking/releases/download/${AZURE_PLUGIN_VER}/azure-vnet-cni-linux-amd64-${AZURE_PLUGIN_VER}.tgz // to https://acs-mirror.azureedge.net/cni AzureCniPluginVerLinux = "v1.0.11" // AzureCniPluginVerWindows specifies version of Azure CNI plugin, which has been mirrored from // https://github.com/Azure/azure-container-networking/releases/download/${AZURE_PLUGIN_VER}/azure-vnet-cni-windows-amd64-${AZURE_PLUGIN_VER}.tgz // to https://acs-mirror.azureedge.net/cni AzureCniPluginVerWindows = "v1.0.11" )
const (
//DefaultConfigurationScriptRootURL Root URL for configuration script (used for script extension on RHEL)
DefaultConfigurationScriptRootURL = "https://raw.githubusercontent.com/Azure/acs-engine/master/parts/"
)
Variables ¶
var AzureLocations = []string{
"australiacentral",
"australiacentral2",
"australiaeast",
"australiasoutheast",
"brazilsouth",
"canadacentral",
"canadaeast",
"centralindia",
"centralus",
"centraluseuap",
"chinaeast",
"chinaeast2",
"chinanorth",
"chinanorth2",
"eastasia",
"eastus",
"eastus2",
"eastus2euap",
"francecentral",
"francesouth",
"japaneast",
"japanwest",
"koreacentral",
"koreasouth",
"northcentralus",
"northeurope",
"southcentralus",
"southeastasia",
"southindia",
"uksouth",
"ukwest",
"westcentralus",
"westeurope",
"westindia",
"westus",
"westus2",
"chinaeast",
"chinanorth",
"chinanorth2",
"chinaeast2",
"germanycentral",
"germanynortheast",
"usgovvirginia",
"usgoviowa",
"usgovarizona",
"usgovtexas",
"francecentral",
}
AzureLocations provides all azure regions in prod. Related powershell to refresh this list:
Get-AzureRmLocation | Select-Object -Property Location
var KubeConfigs = getKubeConfigs()
KubeConfigs represents Docker images used for Kubernetes components based on Kubernetes versions (major.minor.patch)
Functions ¶
func CreateMockContainerService ¶ added in v0.20.0
func CreateMockContainerService(containerServiceName, orchestratorVersion string, masterCount, agentCount int, certs bool) *api.ContainerService
CreateMockContainerService returns a mock container service for testing purposes
func FormatAzureProdFQDN ¶
FormatAzureProdFQDN constructs an Azure prod fqdn
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 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 GetTenantID ¶
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 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 AzureEndpointConfig ¶ added in v0.6.0
type AzureEndpointConfig struct {
ResourceManagerVMDNSSuffix string
}
AzureEndpointConfig describes an Azure endpoint
type AzureOSImageConfig ¶ added in v0.6.0
type AzureOSImageConfig struct { ImageOffer string ImageSku string ImagePublisher string ImageVersion string }
AzureOSImageConfig describes an Azure OS image
type Context ¶ added in v0.5.0
type Context struct {
Translator *i18n.Translator
}
Context represents the object that is passed to the package
type CustomFileReader ¶ added in v0.19.0
CustomFileReader takes represents the source text of a file as an io.Reader and the desired destination to add it to
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 { 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 ¶
DockerSpecConfig is the configurations of docker
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 WindowsPackageSASURLBase string WindowsTelemetryGUID string CNIPluginsDownloadURL string VnetCNILinuxPluginsDownloadURL string VnetCNIWindowsPluginsDownloadURL string ContainerdDownloadURLBase string }
KubernetesSpecConfig is the kubernetes container images used.
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, isUpgrade, isScale bool, acsengineVersion string) (templateRaw string, parametersRaw string, certsGenerated bool, err error)
GenerateTemplate generates the template from the API Model
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
Source Files ¶
- addons.go
- artifacts.go
- azureconst.go
- const.go
- customfiles.go
- defaults-apiserver.go
- defaults-cloud-controller-manager.go
- defaults-controller-manager.go
- defaults-kubelet.go
- defaults-scheduler.go
- defaults.go
- doc.go
- engine.go
- fileloader.go
- k8s_versions.go
- mocks.go
- output.go
- params.go
- params_k8s.go
- template_generator.go
- tenantid.go
- types.go