Deprecate ACS v1 classic mode support (#3647)

This commit is contained in:
Jack Francis 2018-08-10 13:35:03 -07:00 коммит произвёл GitHub
Родитель 367684bcdf
Коммит e38190b932
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
30 изменённых файлов: 20 добавлений и 1019 удалений

Просмотреть файл

@ -59,12 +59,12 @@ Please follow these instructions before submitting a PR:
Usage is best demonstrated with an example:
```shell
$ vim examples/classic/kubernetes.classic.json
$ vim examples/kubernetes.json
# insert your preferred, unique DNS prefix
# insert your SSH public key
$ ./acs-engine generate examples/classic/kubernetes.classic.json
$ ./acs-engine generate examples/kubernetes.json
```
This produces a new directory inside `_output/` that contains an ARM template

Просмотреть файл

@ -37,16 +37,6 @@
## 使用步骤
通过创建一个容器集群来演示ACS引擎的具体用法
```shell
$ vim examples/kubernetes.classic.json
# 修改默认的DNS prefix
# 修改ssh public key
$ ./acs-engine generate examples/kubernetes.classic.json
```
This produces a new directory inside `_output/` that contains an ARM template
for deploying Kubernetes into Azure. (In the case of Kubernetes, some additional
needed assets are generated and placed in the output directory.)

Просмотреть файл

@ -53,7 +53,6 @@ type deployCmd struct {
forceOverwrite bool
caCertificatePath string
caPrivateKeyPath string
classicMode bool
parametersOnly bool
set []string
@ -397,7 +396,7 @@ func (dc *deployCmd) run() error {
},
}
templateGenerator, err := acsengine.InitializeTemplateGenerator(ctx, dc.classicMode)
templateGenerator, err := acsengine.InitializeTemplateGenerator(ctx)
if err != nil {
log.Fatalf("failed to initialize template generator: %s", err.Error())
}

Просмотреть файл

@ -27,7 +27,6 @@ type generateCmd struct {
outputDirectory string // can be auto-determined from clusterDefinition
caCertificatePath string
caPrivateKeyPath string
classicMode bool
noPrettyPrint bool
parametersOnly bool
set []string
@ -68,7 +67,6 @@ func newGenerateCmd() *cobra.Command {
f.StringVar(&gc.caCertificatePath, "ca-certificate-path", "", "path to the CA certificate to use for Kubernetes PKI assets")
f.StringVar(&gc.caPrivateKeyPath, "ca-private-key-path", "", "path to the CA private key to use for Kubernetes PKI assets")
f.StringArrayVar(&gc.set, "set", []string{}, "set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
f.BoolVar(&gc.classicMode, "classic-mode", false, "enable classic parameters and outputs")
f.BoolVar(&gc.noPrettyPrint, "no-pretty-print", false, "skip pretty printing the output")
f.BoolVar(&gc.parametersOnly, "parameters-only", false, "only output parameters files")
@ -177,7 +175,7 @@ func (gc *generateCmd) run() error {
Locale: gc.locale,
},
}
templateGenerator, err := acsengine.InitializeTemplateGenerator(ctx, gc.classicMode)
templateGenerator, err := acsengine.InitializeTemplateGenerator(ctx)
if err != nil {
log.Fatalf("failed to initialize template generator: %s", err.Error())
}

Просмотреть файл

@ -12,7 +12,7 @@ func TestNewGenerateCmd(t *testing.T) {
t.Fatalf("generate command should have use %s equal %s, short %s equal %s and long %s equal to %s", output.Use, generateName, output.Short, generateShortDescription, output.Long, generateLongDescription)
}
expectedFlags := []string{"api-model", "output-directory", "ca-certificate-path", "ca-private-key-path", "set", "classic-mode", "no-pretty-print", "parameters-only"}
expectedFlags := []string{"api-model", "output-directory", "ca-certificate-path", "ca-private-key-path", "set", "no-pretty-print", "parameters-only"}
for _, f := range expectedFlags {
if output.Flags().Lookup(f) == nil {
t.Fatalf("generate command should have flag %s", f)

Просмотреть файл

@ -38,7 +38,6 @@ type scaleCmd struct {
newDesiredAgentCount int
location string
agentPoolToScale string
classicMode bool
masterFQDN string
// derived
@ -77,7 +76,6 @@ func newScaleCmd() *cobra.Command {
f.StringVarP(&sc.resourceGroupName, "resource-group", "g", "", "the resource group where the cluster is deployed")
f.StringVar(&sc.deploymentDirectory, "deployment-dir", "", "the location of the output from `generate`")
f.IntVar(&sc.newDesiredAgentCount, "new-node-count", 0, "desired number of nodes")
f.BoolVar(&sc.classicMode, "classic-mode", false, "enable classic parameters and outputs")
f.StringVar(&sc.agentPoolToScale, "node-pool", "", "node pool to scale")
f.StringVar(&sc.masterFQDN, "master-FQDN", "", "FQDN for the master load balancer, Needed to scale down Kubernetes agent pools")
@ -343,7 +341,7 @@ func (sc *scaleCmd) run(cmd *cobra.Command, args []string) error {
Locale: sc.locale,
},
}
templateGenerator, err := acsengine.InitializeTemplateGenerator(translator, sc.classicMode)
templateGenerator, err := acsengine.InitializeTemplateGenerator(translator)
if err != nil {
return errors.Wrap(err, "failed to initialize template generator")
}

Просмотреть файл

@ -13,7 +13,7 @@ func TestNewScaleCmd(t *testing.T) {
t.Fatalf("scale command should have use %s equal %s, short %s equal %s and long %s equal to %s", output.Use, scaleName, output.Short, scaleShortDescription, output.Long, scaleLongDescription)
}
expectedFlags := []string{"location", "resource-group", "deployment-dir", "new-node-count", "classic-mode", "node-pool", "master-FQDN"}
expectedFlags := []string{"location", "resource-group", "deployment-dir", "new-node-count", "node-pool", "master-FQDN"}
for _, f := range expectedFlags {
if output.Flags().Lookup(f) == nil {
t.Fatalf("scale command should have flag %s", f)

Просмотреть файл

@ -1,9 +0,0 @@
# Microsoft Azure Container Service Engine - Classic
## Overview
This section provides example templates that match the original versions of templates used on Azure Container Service.
Here are the examples:
1. **kubernetes.classic.json** - deploying and using [Kubernetes](../../docs/kubernetes.md)

Просмотреть файл

@ -1,35 +0,0 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "Kubernetes"
},
"masterProfile": {
"count": 1,
"dnsPrefix": "",
"vmSize": "Standard_D2_v2"
},
"agentPoolProfiles": [
{
"name": "agent",
"count": 3,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "AvailabilitySet"
}
],
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": ""
}
]
}
},
"servicePrincipalProfile": {
"clientId": "",
"secret": ""
}
}
}

Просмотреть файл

@ -1,35 +0,0 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "Kubernetes"
},
"masterProfile": {
"count": 1,
"dnsPrefix": "",
"vmSize": "Standard_D2_v2"
},
"agentPoolProfiles": [
{
"name": "agent",
"count": 3,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "AvailabilitySet"
}
],
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": ""
}
]
}
},
"servicePrincipalProfile": {
"clientId": "",
"secret": ""
}
}
}

Просмотреть файл

@ -1,40 +0,0 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "Kubernetes"
},
"masterProfile": {
"count": 1,
"dnsPrefix": "",
"vmSize": "Standard_D2_v2"
},
"agentPoolProfiles": [
{
"name": "agent",
"count": 2,
"vmSize": "Standard_DS3_v2",
"availabilityProfile": "AvailabilitySet",
"osType": "Windows"
}
],
"windowsProfile": {
"adminUsername": "azureuser",
"adminPassword": "replacepassword1234$"
},
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": ""
}
]
}
},
"servicePrincipalProfile": {
"clientId": "",
"secret": ""
}
}
}

Просмотреть файл

@ -1,2 +0,0 @@
export EXPECTED_NODE_COUNT=3

Просмотреть файл

@ -1,166 +0,0 @@
"agentEndpointDNSNamePrefix": {
"defaultValue": "UNUSED",
"metadata": {
"description": "Sets the Domain name label for the agent pool IP Address. The concatenation of the domain name label and the regional DNS zone make up the fully qualified domain name associated with the public IP address."
},
"type": "string"
},
"disablePasswordAuthentication": {
"defaultValue": true,
"metadata": {
"description": "This setting controls whether password auth is disabled for Linux VMs provisioned by this template. Default is true which disables password and makes SSH key required."
},
"type": "bool"
},
"enableNewStorageAccountNaming": {
"defaultValue": true,
"metadata": {
"description": "If true: uses DNS name prefix + Orchestrator name + Region to create storage account name to reduce name collision probability. If false: uses DNS name prefix + Orchestrator name to create storage account name to maintain template idempotency."
},
"type": "bool"
},
"enableVMDiagnostics": {
"defaultValue": true,
"metadata": {
"description": "Allows user to enable/disable boot & vm diagnostics."
},
"type": "bool"
},
"isValidation": {
"allowedValues": [
0,
1
],
"defaultValue": 0,
"metadata": {
"description": "This is testing in the validation region"
},
"type": "int"
},
"jumpboxEndpointDNSNamePrefix": {
"defaultValue": "UNUSED",
"metadata": {
"description": "Sets the Domain name label for the jumpbox. The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address."
},
"type": "string"
},
"linuxAdminPassword": {
"defaultValue": "UNUSED",
"metadata": {
"description": "Password for the Linux Virtual Machine. Not Required. If not set, you must provide a SSH key."
},
"type": "securestring"
},
"linuxOffer": {
"defaultValue": "UNUSED",
"metadata": {
"description": "This is the offer of the image used by the linux cluster"
},
"type": "string"
},
"linuxPublisher": {
"defaultValue": "UNUSED",
"metadata": {
"description": "This is the publisher of the image used by the linux cluster"
},
"type": "string"
},
"linuxSku": {
"defaultValue": "UNUSED",
"metadata": {
"description": "This is the linux sku used by the linux cluster"
},
"type": "string"
},
"linuxVersion": {
"defaultValue": "UNUSED",
"metadata": {
"description": "This is the linux version used by the linux cluster"
},
"type": "string"
},
"masterCount": {
"allowedValues": [
1,
3,
5
],
"defaultValue": 1,
"metadata": {
"description": "The number of Mesos masters for the cluster."
},
"type": "int"
},
"oauthEnabled": {
"allowedValues": [
"true",
"false"
],
"defaultValue": "false",
"metadata": {
"description": "Enable OAuth authentication"
},
"type": "string"
},
"postInstallScriptURI": {
"defaultValue": "disabled",
"metadata": {
"description": "After installation, this specifies a script to download and install. To disabled, set value to 'disabled'."
},
"type": "string"
},
"setLinuxConfigurationForVMCreate": {
"allowedValues": [
0,
1
],
"defaultValue": 1,
"metadata": {
"description": "This setting controls whether Linux configuration with SSH Key is passed in VM PUT Payload. Defaults to 1. If SSH Key is blank, this must be set to 0."
},
"type": "int"
},
"vmsPerStorageAccount": {
"defaultValue": 5,
"metadata": {
"description": "This specifies the number of VMs per storage accounts"
},
"type": "int"
},
{{if not .HasWindows}}
"windowsAdminPassword": {
"defaultValue": "UNUSED",
"metadata": {
"description": "Password for the Windows Virtual Machine."
},
"type": "securestring"
},
"windowsAdminUsername": {
"defaultValue": "UNUSED",
"metadata": {
"description": "User name for the Windows Virtual Machine (Password Only Supported)."
},
"type": "string"
},
{{end}}
"windowsJumpboxOffer": {
"defaultValue": "UNUSED",
"metadata": {
"description": "This is the windows offer used by the windows"
},
"type": "string"
},
"windowsJumpboxPublisher": {
"defaultValue": "UNUSED",
"metadata": {
"description": "This is the windows publisher used by the windows"
},
"type": "string"
},
"windowsJumpboxSku": {
"defaultValue": "UNUSED",
"metadata": {
"description": "This is the windows sku used by the windows"
},
"type": "string"
}

Просмотреть файл

@ -118,9 +118,6 @@
},
"type": "string"
}
{{if GetClassicMode}}
,{{template "classicparams.t" .}}
{{end}}
{{if .LinuxProfile.HasSecrets}}
{{range $vIndex, $vault := .LinuxProfile.Secrets}}
,

Просмотреть файл

@ -5,14 +5,12 @@
{{range .AgentPoolProfiles}}{{template "agentparams.t" .}},{{end}}
{{if .HasWindows}}
"dcosBinariesURL": {
{{PopulateClassicModeDefaultValue "dcosBinariesURL"}}
"metadata": {
"description": "The download url for dcos/mesos windows binaries."
},
"type": "string"
},
"dcosBinariesVersion": {
{{PopulateClassicModeDefaultValue "dcosBinariesVersion"}}
"metadata": {
"description": "DCOS windows binaries version"
},

Просмотреть файл

@ -5,14 +5,12 @@
{{range .AgentPoolProfiles}}{{template "agentparams.t" .}},{{end}}
{{if .HasWindows}}
"dcosBinariesURL": {
{{PopulateClassicModeDefaultValue "dcosBinariesURL"}}
"metadata": {
"description": "The download url for dcos/mesos windows binaries."
},
"type": "string"
},
"dcosBinariesVersion": {
{{PopulateClassicModeDefaultValue "dcosBinariesVersion"}}
"metadata": {
"description": "DCOS windows binaries version"
},

Просмотреть файл

@ -5,28 +5,24 @@
{{range .AgentPoolProfiles}}{{template "agentparams.t" .}},{{end}}
{{if .HasWindows}}
"kubeBinariesSASURL": {
{{PopulateClassicModeDefaultValue "kubeBinariesSASURL"}}
"metadata": {
"description": "The download url for kubernetes windows binaries."
},
"type": "string"
},
"windowsPackageSASURLBase": {
{{PopulateClassicModeDefaultValue "windowsPackageSASURLBase"}}
"metadata": {
"description": "The download url base for windows packages for kubernetes."
},
"type": "string"
},
"kubeBinariesVersion": {
{{PopulateClassicModeDefaultValue "kubeBinariesVersion"}}
"metadata": {
"description": "Kubernetes windows binaries version"
},
"type": "string"
},
"windowsTelemetryGUID": {
{{PopulateClassicModeDefaultValue "windowsTelemetryGUID"}}
"metadata": {
"description": "The GUID to set in windows agent to collect telemetry data."
},

Просмотреть файл

@ -76,11 +76,7 @@
{{ end }}
"masterFqdnPrefix": "[tolower(parameters('masterEndpointDNSNamePrefix'))]",
{{if not IsHostedMaster}}
{{if GetClassicMode}}
"masterCount": "[parameters('masterCount')]",
{{else}}
"masterCount": {{.MasterProfile.Count}},
{{end}}
"masterOffset": "[parameters('masterOffset')]",
{{end}}
"apiVersionDefault": "2016-03-30",

Просмотреть файл

@ -133,7 +133,6 @@
"type": "string"
},
"caPrivateKey": {
{{PopulateClassicModeDefaultValue "caPrivateKey"}}
"metadata": {
"description": "The base 64 CA private key used on the master."
},
@ -165,14 +164,12 @@
},
{{end}}
"generatorCode": {
{{PopulateClassicModeDefaultValue "generatorCode"}}
"metadata": {
"description": "The generator code used to identify the generator"
},
"type": "string"
},
"orchestratorName": {
{{PopulateClassicModeDefaultValue "orchestratorName"}}
"metadata": {
"description": "The orchestrator name used to identify the orchestrator. This must be no more than 3 digits in length, otherwise it will exceed Windows Naming"
},
@ -181,28 +178,24 @@
"type": "string"
},
"dockerBridgeCidr": {
{{PopulateClassicModeDefaultValue "dockerBridgeCidr"}}
"metadata": {
"description": "Docker bridge network IP address and subnet"
},
"type": "string"
},
"kubeClusterCidr": {
{{PopulateClassicModeDefaultValue "kubeClusterCidr"}}
"metadata": {
"description": "Kubernetes cluster subnet"
},
"type": "string"
},
"kubeDNSServiceIP": {
{{PopulateClassicModeDefaultValue "kubeDNSServiceIP"}}
"metadata": {
"description": "Kubernetes DNS IP"
},
"type": "string"
},
"kubeServiceCidr": {
{{PopulateClassicModeDefaultValue "kubeServiceCidr"}}
"metadata": {
"description": "Kubernetes service address space"
},
@ -221,7 +214,6 @@
"type": "string"
},
"kubernetesHyperkubeSpec": {
{{PopulateClassicModeDefaultValue "kubernetesHyperkubeSpec"}}
"metadata": {
"description": "The container spec for hyperkube."
},
@ -235,154 +227,132 @@
"type": "string"
},
"kubernetesAddonManagerSpec": {
{{PopulateClassicModeDefaultValue "kubernetesAddonManagerSpec"}}
"metadata": {
"description": "The container spec for hyperkube."
},
"type": "string"
},
"kubernetesAddonResizerSpec": {
{{PopulateClassicModeDefaultValue "kubernetesAddonResizerSpec"}}
"metadata": {
"description": "The container spec for addon-resizer."
},
"type": "string"
},
"kubernetesDashboardSpec": {
{{PopulateClassicModeDefaultValue "kubernetesDashboardSpec"}}
"metadata": {
"description": "The container spec for kubernetes-dashboard-amd64."
},
"type": "string"
},
"kubernetesDashboardCPURequests": {
{{PopulateClassicModeDefaultValue "kubernetesDashboardCPURequests"}}
"metadata": {
"description": "Dashboard CPU Requests."
},
"type": "string"
},
"kubernetesDashboardMemoryRequests": {
{{PopulateClassicModeDefaultValue "kubernetesDashboardMemoryRequests"}}
"metadata": {
"description": "Dashboard Memory Requests."
},
"type": "string"
},
"kubernetesDashboardCPULimit": {
{{PopulateClassicModeDefaultValue "kubernetesDashboardCPULimit"}}
"metadata": {
"description": "Dashboard CPU Limit."
},
"type": "string"
},
"kubernetesDashboardMemoryLimit": {
{{PopulateClassicModeDefaultValue "kubernetesDashboardMemoryLimit"}}
"metadata": {
"description": "Dashboard Memory Limit."
},
"type": "string"
},
"kubernetesExecHealthzSpec": {
{{PopulateClassicModeDefaultValue "kubernetesExecHealthzSpec"}}
"metadata": {
"description": "The container spec for exechealthz-amd64."
},
"type": "string"
},
"kubernetesDNSSidecarSpec": {
{{PopulateClassicModeDefaultValue "kubernetesDNSSidecarSpec"}}
"metadata": {
"description": "The container spec for k8s-dns-sidecar-amd64."
},
"type": "string"
},
"kubernetesHeapsterSpec": {
{{PopulateClassicModeDefaultValue "kubernetesHeapsterSpec"}}
"metadata": {
"description": "The container spec for heapster."
},
"type": "string"
},
"kubernetesMetricsServerSpec": {
{{PopulateClassicModeDefaultValue "kubernetesMetricsServerSpec"}}
"metadata": {
"description": "The container spec for Metrics Server."
},
"type": "string"
},
"kubernetesNVIDIADevicePluginSpec": {
{{PopulateClassicModeDefaultValue "kubernetesNVIDIADevicePluginSpec"}}
"metadata": {
"description": "The container spec for NVIDIA Device Plugin."
},
"type": "string"
},
"kubernetesNVIDIADevicePluginCPURequests": {
{{PopulateClassicModeDefaultValue "kubernetesNVIDIADevicePluginCPURequests"}}
"metadata": {
"description": "NVIDIA Device Plugin CPU Requests"
},
"type": "string"
},
"kubernetesNVIDIADevicePluginMemoryRequests": {
{{PopulateClassicModeDefaultValue "kubernetesNVIDIADevicePluginMemoryRequests"}}
"metadata": {
"description": "NVIDIA Device Plugin Memory Requests"
},
"type": "string"
},
"kubernetesNVIDIADevicePluginCPULimit": {
{{PopulateClassicModeDefaultValue "kubernetesNVIDIADevicePluginCPULimit"}}
"metadata": {
"description": "NVIDIA Device Plugin CPU Limit"
},
"type": "string"
},
"kubernetesNVIDIADevicePluginMemoryLimit": {
{{PopulateClassicModeDefaultValue "kubernetesNVIDIADevicePluginMemoryLimit"}}
"metadata": {
"description": "NVIDIA Device Plugin Memory Limit"
},
"type": "string"
},
"kubernetesTillerSpec": {
{{PopulateClassicModeDefaultValue "kubernetesTillerSpec"}}
"metadata": {
"description": "The container spec for Helm Tiller."
},
"type": "string"
},
"kubernetesTillerCPURequests": {
{{PopulateClassicModeDefaultValue "kubernetesTillerCPURequests"}}
"metadata": {
"description": "Helm Tiller CPU Requests."
},
"type": "string"
},
"kubernetesTillerMemoryRequests": {
{{PopulateClassicModeDefaultValue "kubernetesTillerMemoryRequests"}}
"metadata": {
"description": "Helm Tiller Memory Requests."
},
"type": "string"
},
"kubernetesTillerCPULimit": {
{{PopulateClassicModeDefaultValue "kubernetesTillerCPULimit"}}
"metadata": {
"description": "Helm Tiller CPU Limit."
},
"type": "string"
},
"kubernetesTillerMemoryLimit": {
{{PopulateClassicModeDefaultValue "kubernetesTillerMemoryLimit"}}
"metadata": {
"description": "Helm Tiller Memory Limit."
},
"type": "string"
},
"kubernetesTillerMaxHistory": {
{{PopulateClassicModeDefaultValue "kubernetesTillerMaxHistory"}}
"metadata": {
"description": "Helm Tiller Max History to Store. '0' for no limit."
},
@ -403,119 +373,102 @@
"type": "bool"
},
"kubernetesACIConnectorSpec": {
{{PopulateClassicModeDefaultValue "kubernetesACIConnectorSpec"}}
"metadata": {
"description": "The container spec for ACI Connector."
},
"type": "string"
},
"kubernetesACIConnectorNodeName": {
{{PopulateClassicModeDefaultValue "kubernetesACIConnectorNodeName"}}
"metadata": {
"description": "Node name for ACI Connector."
},
"type": "string"
},
"kubernetesACIConnectorOS": {
{{PopulateClassicModeDefaultValue "kubernetesACIConnectorOS"}}
"metadata": {
"description": "OS for ACI Connector."
},
"type": "string"
},
"kubernetesACIConnectorTaint": {
{{PopulateClassicModeDefaultValue "kubernetesACIConnectorTaint"}}
"metadata": {
"description": "Taint for ACI Connector."
},
"type": "string"
},
"kubernetesACIConnectorRegion": {
{{PopulateClassicModeDefaultValue "kubernetesACIConnectorRegion"}}
"metadata": {
"description": "Region for ACI Connector."
},
"type": "string"
},
"kubernetesACIConnectorCPURequests": {
{{PopulateClassicModeDefaultValue "kubernetesACIConnectorCPURequests"}}
"metadata": {
"description": "ACI Connector CPU Requests"
},
"type": "string"
},
"kubernetesACIConnectorMemoryRequests": {
{{PopulateClassicModeDefaultValue "kubernetesACIConnectorMemoryRequests"}}
"metadata": {
"description": "ACI Connector Memory Requests"
},
"type": "string"
},
"kubernetesACIConnectorCPULimit": {
{{PopulateClassicModeDefaultValue "kubernetesACIConnectorCPULimit"}}
"metadata": {
"description": "ACI Connector CPU Limit"
},
"type": "string"
},
"kubernetesACIConnectorMemoryLimit": {
{{PopulateClassicModeDefaultValue "kubernetesACIConnectorMemoryLimit"}}
"metadata": {
"description": "ACI Connector Memory Limit"
},
"type": "string"
},
"kubernetesClusterAutoscalerSpec": {
{{PopulateClassicModeDefaultValue "kubernetesClusterAutoscalerSpec"}}
"metadata": {
"description": "The container spec for the cluster autoscaler."
},
"type": "string"
},
"kubernetesClusterAutoscalerAzureCloud": {
{{PopulateClassicModeDefaultValue "kubernetesClusterAutoscalerAzureCloud"}}
"metadata": {
"description": "Name of the Azure cloud for the cluster autoscaler."
},
"type": "string"
},
"kubernetesClusterAutoscalerCPULimit": {
{{PopulateClassicModeDefaultValue "kubernetesClusterAutoscalerCPULimit"}}
"metadata": {
"description": "Cluster autoscaler cpu limit"
},
"type": "string"
},
"kubernetesClusterAutoscalerMemoryLimit": {
{{PopulateClassicModeDefaultValue "kubernetesClusterAutoscalerMemoryLimit"}}
"metadata": {
"description": "Cluster autoscaler memory limit"
},
"type": "string"
},
"kubernetesClusterAutoscalerCPURequests": {
{{PopulateClassicModeDefaultValue "kubernetesClusterAutoscalerCPURequests"}}
"metadata": {
"description": "Cluster autoscaler cpu requests"
},
"type": "string"
},
"kubernetesClusterAutoscalerMemoryRequests": {
{{PopulateClassicModeDefaultValue "kubernetesClusterAutoscalerMemoryRequests"}}
"metadata": {
"description": "Cluster autoscaler memory requests"
},
"type": "string"
},
"kubernetesClusterAutoscalerMinNodes": {
{{PopulateClassicModeDefaultValue "kubernetesClusterAutoscalerMinNodes"}}
"metadata": {
"description": "Cluster autoscaler min nodes"
},
"type": "string"
},
"kubernetesClusterAutoscalerMaxNodes": {
{{PopulateClassicModeDefaultValue "kubernetesClusterAutoscalerMaxNodes"}}
"metadata": {
"description": "Cluster autoscaler max nodes"
},
@ -529,7 +482,6 @@
"type": "bool"
},
"kubernetesClusterAutoscalerUseManagedIdentity": {
{{PopulateClassicModeDefaultValue "kubernetesClusterAutoscalerUseManagedIdentity"}}
"metadata": {
"description": "Managed identity for the cluster autoscaler addon"
},
@ -549,70 +501,60 @@
}
},
"kubernetesKeyVaultFlexVolumeInstallerCPURequests": {
{{PopulateClassicModeDefaultValue "kubernetesKeyVaultFlexVolumeInstallerCPURequests"}}
"metadata": {
"description": "Key Vault FlexVolume Installer CPU Requests"
},
"type": "string"
},
"kubernetesKeyVaultFlexVolumeInstallerMemoryRequests": {
{{PopulateClassicModeDefaultValue "kubernetesKeyVaultFlexVolumeInstallerMemoryRequests"}}
"metadata": {
"description": "Key Vault FlexVolume Installer Memory Requests"
},
"type": "string"
},
"kubernetesKeyVaultFlexVolumeInstallerCPULimit": {
{{PopulateClassicModeDefaultValue "kubernetesKeyVaultFlexVolumeInstallerCPULimit"}}
"metadata": {
"description": "Key Vault FlexVolume Installer CPU Limit"
},
"type": "string"
},
"kubernetesKeyVaultFlexVolumeInstallerMemoryLimit": {
{{PopulateClassicModeDefaultValue "kubernetesKeyVaultFlexVolumeInstallerMemoryLimit"}}
"metadata": {
"description": "Key Vault FlexVolume Installer Memory Limit"
},
"type": "string"
},
"kubernetesReschedulerSpec": {
{{PopulateClassicModeDefaultValue "kubernetesReschedulerSpec"}}
"metadata": {
"description": "The container spec for rescheduler."
},
"type": "string"
},
"kubernetesReschedulerCPURequests": {
{{PopulateClassicModeDefaultValue "kubernetesReschedulerCPURequests"}}
"metadata": {
"description": "Rescheduler CPU Requests."
},
"type": "string"
},
"kubernetesReschedulerMemoryRequests": {
{{PopulateClassicModeDefaultValue "kubernetesReschedulerMemoryRequests"}}
"metadata": {
"description": "Rescheduler Memory Requests."
},
"type": "string"
},
"kubernetesReschedulerCPULimit": {
{{PopulateClassicModeDefaultValue "kubernetesReschedulerCPULimit"}}
"metadata": {
"description": "Rescheduler CPU Limit."
},
"type": "string"
},
"kubernetesReschedulerMemoryLimit": {
{{PopulateClassicModeDefaultValue "kubernetesReschedulerMemoryLimit"}}
"metadata": {
"description": "Rescheduler Memory Limit."
},
"type": "string"
},
"kubernetesPodInfraContainerSpec": {
{{PopulateClassicModeDefaultValue "kubernetesPodInfraContainerSpec"}}
"metadata": {
"description": "The container spec for pod infra."
},
@ -632,14 +574,12 @@
}
},
"kubernetesKubeDNSSpec": {
{{PopulateClassicModeDefaultValue "kubernetesKubeDNSSpec"}}
"metadata": {
"description": "The container spec for kubedns-amd64."
},
"type": "string"
},
"kubernetesDNSMasqSpec": {
{{PopulateClassicModeDefaultValue "kubernetesDNSMasqSpec"}}
"metadata": {
"description": "The container spec for kube-dnsmasq-amd64."
},
@ -654,7 +594,6 @@
"type": "string"
},
"dockerEngineVersion": {
{{PopulateClassicModeDefaultValue "dockerEngineVersion"}}
"metadata": {
"description": "The docker engine version to install."
},
@ -845,21 +784,18 @@
"type": "int"
},
"etcdDiskSizeGB": {
{{PopulateClassicModeDefaultValue "etcdDiskSizeGB"}}
"metadata": {
"description": "Size in GB to allocate for etcd volume"
},
"type": "string"
},
"etcdDownloadURLBase": {
{{PopulateClassicModeDefaultValue "etcdDownloadURLBase"}}
"metadata": {
"description": "etcd image base URL"
},
"type": "string"
},
"etcdVersion": {
{{PopulateClassicModeDefaultValue "etcdVersion"}}
"metadata": {
"description": "etcd version"
},
@ -886,7 +822,6 @@
"type": "string"
},
"jumpboxOSDiskSizeGB": {
{{PopulateClassicModeDefaultValue "jumpboxOSDiskSizeGB"}}
"metadata": {
"description": "Size in GB to allocate to the private cluster jumpbox VM OS."
},

Просмотреть файл

@ -6,23 +6,6 @@
"value": ""
{{end}}
}
{{if GetClassicMode}}
,
{{if RequiresFakeAgentOutput}}
"agentFQDN": {
"type": "string",
"value": ""
},
{{end}}
"diagnosticsStorageAccountUri": {
"type": "string",
"value": ""
},
"jumpboxFQDN": {
"type": "string",
"value": ""
}
{{end}}
{{if AnyAgentUsesAvailabilitySets}}
,
"agentStorageAccountSuffix": {

Просмотреть файл

@ -149,9 +149,6 @@
},
"type": "string"
}
{{if GetClassicMode}}
,{{template "classicparams.t" .}}
{{end}}
{{if .LinuxProfile.HasSecrets}}
{{range $vIndex, $vault := .LinuxProfile.Secrets}}
,

Просмотреть файл

@ -1,203 +0,0 @@
{{if .IsStorageAccount}}
{
"apiVersion": "[variables('apiVersionStorage')]",
"copy": {
"count": "[variables('{{.Name}}StorageAccountsCount')]",
"name": "vmLoopNode"
},
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[concat(variables('storageAccountPrefixes')[mod(copyIndex(),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(copyIndex(),variables('storageAccountPrefixesCount'))],variables('storageAccountBaseClassicName'),copyIndex(1))]",
"properties": {
"accountType": "[variables('vmSizesMap')[variables('{{.Name}}VMSize')].storageAccountType]"
},
"type": "Microsoft.Storage/storageAccounts"
},
{{end}}
{{if IsPublic .Ports}}
{
"apiVersion": "[variables('apiVersionDefault')]",
"location": "[variables('location')]",
"name": "[variables('{{.Name}}IPAddressName')]",
"properties": {
"dnsSettings": {
"domainNameLabel": "[variables('{{.Name}}EndpointDNSNamePrefix')]"
},
"publicIPAllocationMethod": "Dynamic"
},
"type": "Microsoft.Network/publicIPAddresses"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('{{.Name}}IPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[variables('{{.Name}}LbName')]",
"properties": {
"backendAddressPools": [
{
"name": "[variables('{{.Name}}LbBackendPoolName')]"
}
],
"frontendIPConfigurations": [
{
"name": "[variables('{{.Name}}LbIPConfigName')]",
"properties": {
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('{{.Name}}IPAddressName'))]"
}
}
}
],
"inboundNatRules": [],
"loadBalancingRules": [
{{(GetLBRules .Name .Ports)}}
],
"probes": [
{{(GetProbes .Ports)}}
]
},
"type": "Microsoft.Network/loadBalancers"
},
{{end}}
{
{{if .IsManagedDisks}}
"apiVersion": "[variables('apiVersionStorageManagedDisks')]",
{{else}}
"apiVersion": "[variables('apiVersionDefault')]",
{{end}}
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]"
{{if .IsStorageAccount}}
,"[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountPrefixes')[mod(0,variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(0,variables('storageAccountPrefixesCount'))],variables('storageAccountBaseClassicName'),1)]",
"[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountPrefixes')[mod(1,variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(1,variables('storageAccountPrefixesCount'))],variables('storageAccountBaseClassicName'),2)]",
"[concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(2,variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(2,variables('storageAccountPrefixesCount'))],variables('storageAccountBaseClassicName'),3)]",
"[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountPrefixes')[mod(3,variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(3,variables('storageAccountPrefixesCount'))],variables('storageAccountBaseClassicName'),4)]",
"[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountPrefixes')[mod(4,variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(4,variables('storageAccountPrefixesCount'))],variables('storageAccountBaseClassicName'),5)]"
{{end}}
{{if not .IsCustomVNET}}
,"[variables('vnetID')]"
{{end}}
{{if IsPublic .Ports}}
,"[variables('{{.Name}}LbID')]"
{{end}}
],
"tags":
{
"creationSource" : "[concat('acsengine-', variables('{{.Name}}VMNamePrefix'), '-vmss')]"
},
"location": "[variables('location')]",
"name": "[concat(variables('{{.Name}}VMNamePrefix'), '-vmss')]",
"properties": {
"upgradePolicy": {
"mode": "Automatic"
},
"virtualMachineProfile": {
"networkProfile": {
"networkInterfaceConfigurations": [
{
"name": "nic",
"properties": {
"ipConfigurations": [
{
"name": "nicipconfig",
"properties": {
{{if IsPublic .Ports}}
"loadBalancerBackendAddressPools": [
{
"id": "[concat(variables('{{.Name}}LbID'), '/backendAddressPools/', variables('{{.Name}}LbBackendPoolName'))]"
}
],
{{end}}
"subnet": {
"id": "[variables('{{.Name}}VnetSubnetID')]"
}
}
}
],
"primary": "true"
}
}
]
},
"osProfile": {
"adminUsername": "[variables('adminUsername')]",
"computerNamePrefix": "[variables('{{.Name}}VMNamePrefix')]",
{{if IsSwarmMode}}
{{if not .IsRHEL}}
{{GetAgentSwarmModeCustomData .}}
{{end}}
{{else}}
{{GetAgentSwarmCustomData .}}
{{end}}
"linuxConfiguration": {
"disablePasswordAuthentication": "true",
"ssh": {
"publicKeys": [
{
"keyData": "[parameters('sshRSAPublicKey')]",
"path": "[variables('sshKeyPath')]"
}
]
}
}
},
"storageProfile": {
"imageReference": {
"offer": "[variables('osImageOffer')]",
"publisher": "[variables('osImagePublisher')]",
"sku": "[variables('osImageSKU')]",
"version": "latest"
},
{{GetDataDisks .}}
"osDisk": {
"caching": "ReadWrite"
,"createOption": "FromImage"
{{if .IsStorageAccount}}
,"name": "vmssosdisk"
,"vhdContainers": [
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(0,variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(0,variables('storageAccountPrefixesCount'))],variables('storageAccountBaseClassicName'),1), variables('apiVersionStorage') ).primaryEndpoints.blob, 'osdisk')]",
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(1,variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(1,variables('storageAccountPrefixesCount'))],variables('storageAccountBaseClassicName'),2), variables('apiVersionStorage')).primaryEndpoints.blob, 'osdisk')]",
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(2,variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(2,variables('storageAccountPrefixesCount'))],variables('storageAccountBaseClassicName'),3), variables('apiVersionStorage')).primaryEndpoints.blob, 'osdisk')]",
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(3,variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(3,variables('storageAccountPrefixesCount'))],variables('storageAccountBaseClassicName'),4), variables('apiVersionStorage')).primaryEndpoints.blob, 'osdisk')]",
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(4,variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(4,variables('storageAccountPrefixesCount'))],variables('storageAccountBaseClassicName'),5), variables('apiVersionStorage')).primaryEndpoints.blob, 'osdisk')]"
]
{{end}}
{{if ne .OSDiskSizeGB 0}}
,"diskSizeGB": {{.OSDiskSizeGB}}
{{end}}
}
}
{{if .IsRHEL}}
,"extensionProfile": {
"extensions": [
{
"name": "configure{{.Name}}",
"properties": {
"publisher": "Microsoft.Azure.Extensions",
"settings": {
"commandToExecute": "[variables('agentCustomScript')]",
"fileUris": [
"[concat('{{ GetConfigurationScriptRootURL }}', variables('configureClusterScriptFile'))]"
]
},
"type": "CustomScript",
"typeHandlerVersion": "2.0"
}
}
]
}
{{end}}
}
},
"sku": {
"capacity": "[variables('{{.Name}}Count')]",
"name": "[variables('{{.Name}}VMSize')]",
"tier": "[variables('{{.Name}}VMSizeTier')]"
},
"type": "Microsoft.Compute/virtualMachineScaleSets"
}

Просмотреть файл

@ -35,11 +35,7 @@
],
{{end}}
"masterAvailabilitySet": "[concat(variables('orchestratorName'), '-master-availabilitySet-', variables('nameSuffix'))]",
{{if GetClassicMode}}
"masterCount": "[parameters('masterCount')]",
{{else}}
"masterCount": {{.MasterProfile.Count}},
{{end}}
{{if .MasterProfile.IsRHEL}}
"masterCustomScript": "[concat('/bin/bash -c \"/bin/bash ',variables('configureClusterScriptFile'), ' ',variables('clusterInstallParameters'),' >> /var/log/azure/cluster-bootstrap.log 2>&1\"')]",
{{else}}

Просмотреть файл

@ -243,7 +243,6 @@ const (
const (
agentOutputs = "agentoutputs.t"
agentParams = "agentparams.t"
classicParams = "classicparams.t"
dcosAgentResourcesVMAS = "dcos/dcosagentresourcesvmas.t"
dcosWindowsAgentResourcesVMAS = "dcos/dcosWindowsAgentResourcesVmas.t"
dcosAgentResourcesVMSS = "dcos/dcosagentresourcesvmss.t"
@ -277,7 +276,6 @@ const (
swarmParams = "swarm/swarmparams.t"
swarmAgentResourcesVMAS = "swarm/swarmagentresourcesvmas.t"
swarmAgentResourcesVMSS = "swarm/swarmagentresourcesvmss.t"
swarmAgentResourcesClassic = "swarm/swarmagentresourcesclassic.t"
swarmAgentVars = "swarm/swarmagentvars.t"
swarmMasterResources = "swarm/swarmmasterresources.t"
swarmMasterVars = "swarm/swarmmastervars.t"

Просмотреть файл

@ -25,12 +25,12 @@ import (
"github.com/pkg/errors"
)
var commonTemplateFiles = []string{agentOutputs, agentParams, classicParams, masterOutputs, iaasOutputs, masterParams, windowsParams}
var commonTemplateFiles = []string{agentOutputs, agentParams, masterOutputs, iaasOutputs, masterParams, windowsParams}
var dcosTemplateFiles = []string{dcosBaseFile, dcosAgentResourcesVMAS, dcosAgentResourcesVMSS, dcosAgentVars, dcosMasterResources, dcosMasterVars, dcosParams, dcosWindowsAgentResourcesVMAS, dcosWindowsAgentResourcesVMSS}
var dcos2TemplateFiles = []string{dcos2BaseFile, dcosAgentResourcesVMAS, dcosAgentResourcesVMSS, dcosAgentVars, dcos2MasterResources, dcos2BootstrapResources, dcos2MasterVars, dcosParams, dcosWindowsAgentResourcesVMAS, dcosWindowsAgentResourcesVMSS, dcos2BootstrapVars, dcos2BootstrapParams}
var kubernetesTemplateFiles = []string{kubernetesBaseFile, kubernetesAgentResourcesVMAS, kubernetesAgentResourcesVMSS, kubernetesAgentVars, kubernetesMasterResources, kubernetesMasterVars, kubernetesParams, kubernetesWinAgentVars, kubernetesWinAgentVarsVMSS}
var swarmTemplateFiles = []string{swarmBaseFile, swarmParams, swarmAgentResourcesVMAS, swarmAgentVars, swarmAgentResourcesVMSS, swarmAgentResourcesClassic, swarmBaseFile, swarmMasterResources, swarmMasterVars, swarmWinAgentResourcesVMAS, swarmWinAgentResourcesVMSS}
var swarmModeTemplateFiles = []string{swarmBaseFile, swarmParams, swarmAgentResourcesVMAS, swarmAgentVars, swarmAgentResourcesVMSS, swarmAgentResourcesClassic, swarmBaseFile, swarmMasterResources, swarmMasterVars, swarmWinAgentResourcesVMAS, swarmWinAgentResourcesVMSS}
var swarmTemplateFiles = []string{swarmBaseFile, swarmParams, swarmAgentResourcesVMAS, swarmAgentVars, swarmAgentResourcesVMSS, swarmBaseFile, swarmMasterResources, swarmMasterVars, swarmWinAgentResourcesVMAS, swarmWinAgentResourcesVMSS}
var swarmModeTemplateFiles = []string{swarmBaseFile, swarmParams, swarmAgentResourcesVMAS, swarmAgentVars, swarmAgentResourcesVMSS, swarmBaseFile, swarmMasterResources, swarmMasterVars, swarmWinAgentResourcesVMAS, swarmWinAgentResourcesVMSS}
var openshiftTemplateFiles = append(
kubernetesTemplateFiles,
openshiftInfraResources,

Просмотреть файл

@ -57,11 +57,6 @@ func TestExpected(t *testing.T) {
addTestCertificateProfile(containerService.Properties.CertificateProfile)
}
isClassicMode := false
if strings.Contains(tuple.APIModelFilename, "_classicmode") {
isClassicMode = true
}
// test the output container service 3 times:
// 1. first time tests loaded containerService
// 2. second time tests generated containerService
@ -71,7 +66,7 @@ func TestExpected(t *testing.T) {
Locale: locale,
},
}
templateGenerator, e3 := InitializeTemplateGenerator(ctx, isClassicMode)
templateGenerator, e3 := InitializeTemplateGenerator(ctx)
if e3 != nil {
t.Error(e3.Error())
continue
@ -284,7 +279,7 @@ func TestTemplateOutputPresence(t *testing.T) {
},
}
templateGenerator, err := InitializeTemplateGenerator(ctx, false)
templateGenerator, err := InitializeTemplateGenerator(ctx)
if err != nil {
t.Fatalf("Failed to initialize template generator: %v", err)

Просмотреть файл

@ -9,7 +9,7 @@ import (
"github.com/Azure/acs-engine/pkg/api/common"
)
func getParameters(cs *api.ContainerService, isClassicMode bool, generatorCode string, acsengineVersion string) (paramsMap, error) {
func getParameters(cs *api.ContainerService, generatorCode string, acsengineVersion string) (paramsMap, error) {
properties := cs.Properties
location := cs.Location
parametersMap := paramsMap{}
@ -64,9 +64,6 @@ func getParameters(cs *api.ContainerService, isClassicMode bool, generatorCode s
}
addValue(parametersMap, "firstConsecutiveStaticIP", properties.MasterProfile.FirstConsecutiveStaticIP)
addValue(parametersMap, "masterVMSize", properties.MasterProfile.VMSize)
if isClassicMode {
addValue(parametersMap, "masterCount", properties.MasterProfile.Count)
}
}
if properties.HostedMasterProfile != nil {
addValue(parametersMap, "masterSubnet", properties.HostedMasterProfile.Subnet)

Просмотреть файл

@ -20,15 +20,13 @@ import (
// TemplateGenerator represents the object that performs the template generation.
type TemplateGenerator struct {
ClassicMode bool
Translator *i18n.Translator
Translator *i18n.Translator
}
// InitializeTemplateGenerator creates a new template generator object
func InitializeTemplateGenerator(ctx Context, classicMode bool) (*TemplateGenerator, error) {
func InitializeTemplateGenerator(ctx Context) (*TemplateGenerator, error) {
t := &TemplateGenerator{
ClassicMode: classicMode,
Translator: ctx.Translator,
Translator: ctx.Translator,
}
if err := t.verifyFiles(); err != nil {
@ -99,7 +97,7 @@ func (t *TemplateGenerator) GenerateTemplate(containerService *api.ContainerServ
templateRaw = b.String()
var parametersMap paramsMap
if parametersMap, err = getParameters(containerService, t.ClassicMode, generatorCode, acsengineVersion); err != nil {
if parametersMap, err = getParameters(containerService, generatorCode, acsengineVersion); err != nil {
return templateRaw, parametersRaw, certsGenerated, err
}
@ -426,17 +424,13 @@ func (t *TemplateGenerator) getTemplateFuncMap(cs *api.ContainerService) templat
return agentPreprovisionExtensionParameters
},
"GetMasterAllowedSizes": func() string {
if t.ClassicMode {
return GetClassicAllowedSizes()
} else if cs.Properties.OrchestratorProfile.OrchestratorType == api.DCOS {
if cs.Properties.OrchestratorProfile.OrchestratorType == api.DCOS {
return GetDCOSMasterAllowedSizes()
}
return GetMasterAgentAllowedSizes()
},
"GetAgentAllowedSizes": func() string {
if t.ClassicMode {
return GetClassicAllowedSizes()
} else if cs.Properties.OrchestratorProfile.IsKubernetes() || cs.Properties.OrchestratorProfile.IsOpenShift() {
if cs.Properties.OrchestratorProfile.IsKubernetes() || cs.Properties.OrchestratorProfile.IsOpenShift() {
return GetKubernetesAgentAllowedSizes()
}
return GetMasterAgentAllowedSizes()
@ -448,14 +442,8 @@ func (t *TemplateGenerator) getTemplateFuncMap(cs *api.ContainerService) templat
return getSwarmVersions(api.DockerCEVersion, api.DockerCEDockerComposeVersion)
},
"GetSizeMap": func() string {
if t.ClassicMode {
return GetClassicSizeMap()
}
return GetSizeMap()
},
"GetClassicMode": func() bool {
return t.ClassicMode
},
"Base64": func(s string) string {
return base64.StdEncoding.EncodeToString([]byte(s))
},
@ -747,371 +735,6 @@ func (t *TemplateGenerator) getTemplateFuncMap(cs *api.ContainerService) templat
"GetMasterEtcdClientPort": func() int {
return DefaultMasterEtcdClientPort
},
"PopulateClassicModeDefaultValue": func(attr string) string {
var val string
if !t.ClassicMode {
val = ""
} else {
k8sVersion := cs.Properties.OrchestratorProfile.OrchestratorVersion
cloudSpecConfig := getCloudSpecConfig(cs.Location)
tillerAddon := getAddonByName(cs.Properties.OrchestratorProfile.KubernetesConfig.Addons, DefaultTillerAddonName)
tC := getAddonContainersIndexByName(tillerAddon.Containers, DefaultTillerAddonName)
aciConnectorAddon := getAddonByName(cs.Properties.OrchestratorProfile.KubernetesConfig.Addons, DefaultACIConnectorAddonName)
aC := getAddonContainersIndexByName(aciConnectorAddon.Containers, DefaultACIConnectorAddonName)
clusterAutoscalerAddon := getAddonByName(cs.Properties.OrchestratorProfile.KubernetesConfig.Addons, DefaultClusterAutoscalerAddonName)
aS := getAddonContainersIndexByName(clusterAutoscalerAddon.Containers, DefaultClusterAutoscalerAddonName)
dashboardAddon := getAddonByName(cs.Properties.OrchestratorProfile.KubernetesConfig.Addons, DefaultDashboardAddonName)
dC := getAddonContainersIndexByName(dashboardAddon.Containers, DefaultDashboardAddonName)
reschedulerAddon := getAddonByName(cs.Properties.OrchestratorProfile.KubernetesConfig.Addons, DefaultReschedulerAddonName)
rC := getAddonContainersIndexByName(reschedulerAddon.Containers, DefaultReschedulerAddonName)
metricsServerAddon := getAddonByName(cs.Properties.OrchestratorProfile.KubernetesConfig.Addons, DefaultMetricsServerAddonName)
mC := getAddonContainersIndexByName(metricsServerAddon.Containers, DefaultMetricsServerAddonName)
nvidiaDevicePluginAddon := getAddonByName(cs.Properties.OrchestratorProfile.KubernetesConfig.Addons, NVIDIADevicePluginAddonName)
nC := getAddonContainersIndexByName(nvidiaDevicePluginAddon.Containers, NVIDIADevicePluginAddonName)
kvFlexVolumeAddon := getAddonByName(cs.Properties.OrchestratorProfile.KubernetesConfig.Addons, DefaultKeyVaultFlexVolumeAddonName)
kC := getAddonContainersIndexByName(kvFlexVolumeAddon.Containers, DefaultKeyVaultFlexVolumeAddonName)
switch attr {
case "kubernetesHyperkubeSpec":
val = cs.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + KubeConfigs[k8sVersion]["hyperkube"]
if cs.Properties.OrchestratorProfile.KubernetesConfig.CustomHyperkubeImage != "" {
val = cs.Properties.OrchestratorProfile.KubernetesConfig.CustomHyperkubeImage
}
case "dockerEngineVersion":
val = cs.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + KubeConfigs[k8sVersion]["dockerEngineVersion"]
if cs.Properties.OrchestratorProfile.KubernetesConfig.DockerEngineVersion != "" {
val = cs.Properties.OrchestratorProfile.KubernetesConfig.DockerEngineVersion
}
case "kubernetesAddonManagerSpec":
val = cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase + KubeConfigs[k8sVersion]["addonmanager"]
case "kubernetesAddonResizerSpec":
val = cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase + KubeConfigs[k8sVersion]["addonresizer"]
case "kubernetesDashboardSpec":
if dC > -1 {
if dashboardAddon.Containers[dC].Image != "" {
val = dashboardAddon.Containers[dC].Image
}
} else {
val = cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase + KubeConfigs[k8sVersion][DefaultDashboardAddonName]
}
case "kubernetesDashboardCPURequests":
if dC > -1 {
val = dashboardAddon.Containers[dC].CPURequests
} else {
val = ""
}
case "kubernetesDashboardMemoryRequests":
if dC > -1 {
val = dashboardAddon.Containers[dC].MemoryRequests
} else {
val = ""
}
case "kubernetesDashboardCPULimit":
if dC > -1 {
val = dashboardAddon.Containers[dC].CPULimits
} else {
val = ""
}
case "kubernetesDashboardMemoryLimit":
if dC > -1 {
val = dashboardAddon.Containers[dC].MemoryLimits
} else {
val = ""
}
case "kubernetesDNSMasqSpec":
val = cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase + KubeConfigs[k8sVersion]["dnsmasq"]
case "kubernetesExecHealthzSpec":
val = cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase + KubeConfigs[k8sVersion]["exechealthz"]
case "kubernetesDNSSidecarSpec":
val = cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase + KubeConfigs[k8sVersion]["k8s-dns-sidecar"]
case "kubernetesHeapsterSpec":
val = cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase + KubeConfigs[k8sVersion]["heapster"]
case "kubernetesACIConnectorSpec":
if aC > -1 {
if aciConnectorAddon.Containers[aC].Image != "" {
val = aciConnectorAddon.Containers[aC].Image
} else {
val = cloudSpecConfig.KubernetesSpecConfig.ACIConnectorImageBase + KubeConfigs[k8sVersion][DefaultACIConnectorAddonName]
}
}
case "kubernetesACIConnectorNodeName":
if aC > -1 {
val = aciConnectorAddon.Config["nodeName"]
} else {
val = ""
}
case "kubernetesACIConnectorOS":
if aC > -1 {
val = aciConnectorAddon.Config["os"]
} else {
val = ""
}
case "kubernetesACIConnectorTaint":
if aC > -1 {
val = aciConnectorAddon.Config["taint"]
} else {
val = ""
}
case "kubernetesACIConnectorRegion":
if aC > -1 {
val = aciConnectorAddon.Config["region"]
} else {
val = ""
}
case "kubernetesACIConnectorCPURequests":
if aC > -1 {
val = aciConnectorAddon.Containers[aC].CPURequests
} else {
val = ""
}
case "kubernetesACIConnectorMemoryRequests":
if aC > -1 {
val = aciConnectorAddon.Containers[aC].MemoryRequests
} else {
val = ""
}
case "kubernetesACIConnectorCPULimit":
if aC > -1 {
val = aciConnectorAddon.Containers[aC].CPULimits
} else {
val = ""
}
case "kubernetesACIConnectorMemoryLimit":
if aC > -1 {
val = aciConnectorAddon.Containers[aC].MemoryLimits
} else {
val = ""
}
case "kubernetesClusterAutoscalerSpec":
if aS > -1 {
if clusterAutoscalerAddon.Containers[aS].Image != "" {
val = clusterAutoscalerAddon.Containers[aS].Image
} else {
val = cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase + KubeConfigs[k8sVersion][DefaultClusterAutoscalerAddonName]
}
}
case "kubernetesClusterAutoscalerAzureCloud":
if aS > -1 {
val = cloudSpecConfig.CloudName
} else {
val = ""
}
case "kubernetesClusterAutoscalerCPURequests":
if aS > -1 {
val = clusterAutoscalerAddon.Containers[aC].CPURequests
} else {
val = ""
}
case "kubernetesClusterAutoscalerMemoryRequests":
if aS > -1 {
val = clusterAutoscalerAddon.Containers[aC].MemoryRequests
} else {
val = ""
}
case "kubernetesClusterAutoscalerCPULimit":
if aS > -1 {
val = clusterAutoscalerAddon.Containers[aC].CPULimits
} else {
val = ""
}
case "kubernetesClusterAutoscalerMemoryLimit":
if aS > -1 {
val = clusterAutoscalerAddon.Containers[aC].MemoryLimits
} else {
val = ""
}
case "kubernetesClusterAutoscalerUseManagedIdentity":
if aS > -1 {
if cs.Properties.OrchestratorProfile.KubernetesConfig != nil && cs.Properties.OrchestratorProfile.KubernetesConfig.UseManagedIdentity {
val = strings.ToLower(strconv.FormatBool(cs.Properties.OrchestratorProfile.KubernetesConfig.UseManagedIdentity))
} else {
val = "false"
}
}
case "kubernetesKeyVaultFlexVolumeInstallerCPURequests":
if kC > -1 {
val = kvFlexVolumeAddon.Containers[kC].CPURequests
} else {
val = ""
}
case "kubernetesKeyVaultFlexVolumeInstallerMemoryRequests":
if kC > -1 {
val = kvFlexVolumeAddon.Containers[kC].MemoryRequests
} else {
val = ""
}
case "kubernetesKeyVaultFlexVolumeInstallerCPULimit":
if kC > -1 {
val = kvFlexVolumeAddon.Containers[kC].CPULimits
} else {
val = ""
}
case "kubernetesKeyVaultFlexVolumeInstallerMemoryLimit":
if kC > -1 {
val = kvFlexVolumeAddon.Containers[kC].MemoryLimits
} else {
val = ""
}
case "kubernetesTillerSpec":
if tC > -1 {
if tillerAddon.Containers[tC].Image != "" {
val = tillerAddon.Containers[tC].Image
} else {
val = cloudSpecConfig.KubernetesSpecConfig.TillerImageBase + KubeConfigs[k8sVersion][DefaultTillerAddonName]
}
}
case "kubernetesTillerCPURequests":
if tC > -1 {
val = tillerAddon.Containers[tC].CPURequests
} else {
val = ""
}
case "kubernetesTillerMemoryRequests":
if tC > -1 {
val = tillerAddon.Containers[tC].MemoryRequests
} else {
val = ""
}
case "kubernetesTillerCPULimit":
if tC > -1 {
val = tillerAddon.Containers[tC].CPULimits
} else {
val = ""
}
case "kubernetesTillerMemoryLimit":
if tC > -1 {
val = tillerAddon.Containers[tC].MemoryLimits
} else {
val = ""
}
case "kubernetesTillerMaxHistory":
if tC > -1 {
if _, ok := tillerAddon.Config["max-history"]; ok {
val = tillerAddon.Config["max-history"]
} else {
val = "0"
}
} else {
val = "0"
}
case "kubernetesMetricsServerSpec":
if mC > -1 {
if metricsServerAddon.Containers[mC].Image != "" {
val = metricsServerAddon.Containers[mC].Image
}
} else {
val = cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase + KubeConfigs[k8sVersion][DefaultMetricsServerAddonName]
}
case "kubernetesNVIDIADevicePluginSpec":
if nC > -1 {
if nvidiaDevicePluginAddon.Containers[nC].Image != "" {
val = nvidiaDevicePluginAddon.Containers[nC].Image
}
} else {
val = cloudSpecConfig.KubernetesSpecConfig.NVIDIAImageBase + KubeConfigs[k8sVersion][NVIDIADevicePluginAddonName]
}
case "kubernetesNVIDIADevicePluginCPURequests":
if nC > -1 {
val = nvidiaDevicePluginAddon.Containers[aC].CPURequests
} else {
val = ""
}
case "kubernetesNVIDIADevicePluginMemoryRequests":
if nC > -1 {
val = nvidiaDevicePluginAddon.Containers[aC].MemoryRequests
} else {
val = ""
}
case "kubernetesNVIDIADevicePluginCPULimit":
if nC > -1 {
val = nvidiaDevicePluginAddon.Containers[aC].CPULimits
} else {
val = ""
}
case "kubernetesNVIDIADevicePluginMemoryLimit":
if nC > -1 {
val = nvidiaDevicePluginAddon.Containers[aC].MemoryLimits
} else {
val = ""
}
case "kubernetesReschedulerSpec":
if rC > -1 {
if reschedulerAddon.Containers[rC].Image != "" {
val = reschedulerAddon.Containers[rC].Image
}
} else {
val = cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase + KubeConfigs[k8sVersion][DefaultReschedulerAddonName]
}
case "kubernetesReschedulerCPURequests":
if rC > -1 {
val = reschedulerAddon.Containers[rC].CPURequests
} else {
val = ""
}
case "kubernetesReschedulerMemoryRequests":
if rC > -1 {
val = reschedulerAddon.Containers[rC].MemoryRequests
} else {
val = ""
}
case "kubernetesReschedulerCPULimit":
if rC > -1 {
val = reschedulerAddon.Containers[rC].CPULimits
} else {
val = ""
}
case "kubernetesReschedulerMemoryLimit":
if rC > -1 {
val = reschedulerAddon.Containers[rC].MemoryLimits
} else {
val = ""
}
case "kubernetesKubeDNSSpec":
val = cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase + KubeConfigs[k8sVersion]["dns"]
case "kubernetesPodInfraContainerSpec":
val = cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase + KubeConfigs[k8sVersion]["pause"]
case "kubeBinariesSASURL":
val = cloudSpecConfig.KubernetesSpecConfig.KubeBinariesSASURLBase + KubeConfigs[k8sVersion]["windowszip"]
case "windowsPackageSASURLBase":
val = cloudSpecConfig.KubernetesSpecConfig.WindowsPackageSASURLBase
case "kubeClusterCidr":
val = DefaultKubernetesClusterSubnet
case "kubeDNSServiceIP":
val = DefaultKubernetesDNSServiceIP
case "kubeServiceCidr":
val = DefaultKubernetesServiceCIDR
case "kubeBinariesVersion":
val = cs.Properties.OrchestratorProfile.OrchestratorVersion
case "windowsTelemetryGUID":
val = cloudSpecConfig.KubernetesSpecConfig.WindowsTelemetryGUID
case "caPrivateKey":
// The base64 encoded "NotAvailable"
val = "Tm90QXZhaWxhYmxlCg=="
case "dockerBridgeCidr":
val = DefaultDockerBridgeSubnet
case "gchighthreshold":
val = strconv.Itoa(cs.Properties.OrchestratorProfile.KubernetesConfig.GCHighThreshold)
case "gclowthreshold":
val = strconv.Itoa(cs.Properties.OrchestratorProfile.KubernetesConfig.GCLowThreshold)
case "generatorCode":
val = DefaultGeneratorCode
case "orchestratorName":
val = DefaultOrchestratorName
case "etcdImageBase":
val = cloudSpecConfig.KubernetesSpecConfig.EtcdDownloadURLBase
case "etcdVersion":
val = cs.Properties.OrchestratorProfile.KubernetesConfig.EtcdVersion
case "etcdEncryptionKey":
val = cs.Properties.OrchestratorProfile.KubernetesConfig.EtcdEncryptionKey
case "etcdDiskSizeGB":
val = cs.Properties.OrchestratorProfile.KubernetesConfig.EtcdDiskSizeGB
case "jumpboxOSDiskSizeGB":
val = strconv.Itoa(cs.Properties.OrchestratorProfile.KubernetesConfig.PrivateCluster.JumpboxProfile.OSDiskSizeGB)
default:
val = ""
}
}
return fmt.Sprintf("\"defaultValue\": \"%s\",", val)
},
"UseCloudControllerManager": func() bool {
return cs.Properties.OrchestratorProfile.KubernetesConfig.UseCloudControllerManager != nil && *cs.Properties.OrchestratorProfile.KubernetesConfig.UseCloudControllerManager
},

Просмотреть файл

@ -386,9 +386,6 @@ type ImageReference struct {
ResourceGroup string `json:"resourceGroup,omitempty"`
}
// ClassicAgentPoolProfileType represents types of classic profiles
type ClassicAgentPoolProfileType string
// ExtensionProfile represents an extension definition
type ExtensionProfile struct {
Name string `json:"name"`

Просмотреть файл

@ -485,7 +485,7 @@ func (ku *Upgrader) generateUpgradeTemplate(upgradeContainerService *api.Contain
ctx := acsengine.Context{
Translator: ku.Translator,
}
templateGenerator, err := acsengine.InitializeTemplateGenerator(ctx, false)
templateGenerator, err := acsengine.InitializeTemplateGenerator(ctx)
if err != nil {
return nil, nil, ku.Translator.Errorf("failed to initialize template generator: %s", err.Error())
}