diff --git a/docs/clusterdefinition.md b/docs/clusterdefinition.md index 66a00e42c..e3a7da434 100644 --- a/docs/clusterdefinition.md +++ b/docs/clusterdefinition.md @@ -414,7 +414,7 @@ We consider `kubeletConfig`, `controllerManagerConfig`, `apiServerConfig`, and ` |vmSize|yes|Describes a valid [Azure VM Sizes](https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-windows-sizes/)| |publicKey|yes|The public SSH key used for authenticating access to the jumpbox. Here are instructions for [generating a public/private key pair](ssh.md#ssh-key-generation)| |osDiskSizeGB|no|Describes the OS Disk Size in GB. Defaults to `30`| -|storageProfile|no|Specifies the storage profile to use. Valid values are [StorageAccount](../examples/disks-storageaccount) or [ManagedDisks](../examples/disks-managed). Defaults to `StorageAccount`| +|storageProfile|no|Specifies the storage profile to use. Valid values are [ManagedDisks](../examples/disks-managed) or [StorageAccount](../examples/disks-storageaccount). Defaults to `ManagedDisks`| |username|no|Describes the admin username to be used on the jumpbox. Defaults to `azureuser`| ### masterProfile @@ -446,7 +446,7 @@ A cluster can have 0 to 12 agent pool profiles. Agent Pool Profiles are used for |dnsPrefix|Required if agents are to be exposed publically with a load balancer|The dns prefix that forms the FQDN to access the loadbalancer for this agent pool. This must be a unique name among all agent pools. Not supported for Kubernetes clusters| |name|yes|This is the unique name for the agent pool profile. The resources of the agent pool profile are derived from this name| |ports|only required if needed for exposing services publically|Describes an array of ports need for exposing publically. A tcp probe is configured for each port and only opens to an agent node if the agent node is listening on that port. A maximum of 150 ports may be specified. Not supported for Kubernetes clusters| -|storageProfile|no|Specifies the storage profile to use. Valid values are [StorageAccount](../examples/disks-storageaccount) or [ManagedDisks](../examples/disks-managed). Defaults to `StorageAccount`| +|storageProfile|no|Specifies the storage profile to use. Valid values are [ManagedDisks](../examples/disks-managed) or [StorageAccount](../examples/disks-storageaccount). Defaults to `ManagedDisks`| |vmsize|yes|Describes a valid [Azure VM Sizes](https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-windows-sizes/). These are restricted to machines with at least 2 cores| |osDiskSizeGB|no|Describes the OS Disk Size in GB| |vnetSubnetId|no|Specifies the Id of an alternate VNET subnet. The subnet id must specify a valid VNET ID owned by the same subscription. ([bring your own VNET examples](../examples/vnet))| diff --git a/docs/kubernetes/features.md b/docs/kubernetes/features.md index c0a9a6d51..bc55ea899 100644 --- a/docs/kubernetes/features.md +++ b/docs/kubernetes/features.md @@ -289,11 +289,9 @@ container runtime by setting: ``` You will need to make sure your agents are using a `vmSize` that [supports -nested -virtualization](https://azure.microsoft.com/en-us/blog/nested-virtualization-in-azure/). +nested virtualization](https://azure.microsoft.com/en-us/blog/nested-virtualization-in-azure/). These are the `Dv3` or `Ev3` series nodes. -You will also need to attach a disk to those nodes for the device-mapper disk that clear containers will use. This should look like: ``` @@ -303,7 +301,6 @@ This should look like: "count": 3, "vmSize": "Standard_D4s_v3", "availabilityProfile": "AvailabilitySet", - "storageProfile": "ManagedDisks", "diskSizesGB": [1023] } ], @@ -340,7 +337,6 @@ To auto-provision a jumpbox with your acs-engine deployment use: "name": "my-jb", "vmSize": "Standard_D4s_v3", "osDiskSizeGB": 30, - "storageProfile": "ManagedDisks", "username": "azureuser", "publicKey": "xxx" } diff --git a/examples/custom-image.json b/examples/custom-image.json index c3f64d6b5..2d391e259 100644 --- a/examples/custom-image.json +++ b/examples/custom-image.json @@ -11,7 +11,6 @@ }, "count": 1, "dnsPrefix": "", - "storageProfile": "ManagedDisks", "vmSize": "Standard_D2_v2" }, "agentPoolProfiles": [ @@ -22,7 +21,6 @@ "name": "stretch", "resourceGroup": "debian" }, - "storageProfile": "ManagedDisks", "vmSize": "Standard_D2_v2", "availabilityProfile": "AvailabilitySet" } diff --git a/examples/disks-managed/README.md b/examples/disks-managed/README.md index 3826ea08d..6f2fd06ec 100644 --- a/examples/disks-managed/README.md +++ b/examples/disks-managed/README.md @@ -2,4 +2,6 @@ ## Overview -ACS-Engine enables you to create customized Docker enabled cluster on Microsoft Azure with [managed disks](https://docs.microsoft.com/en-us/azure/storage/storage-managed-disks-overview). +ACS-Engine enables you to create customized Docker enabled cluster on Microsoft Azure with [managed disks](https://docs.microsoft.com/en-us/azure/storage/storage-managed-disks-overview). + +These examples are provided as a reference, note that managed disks is the default storage account type if none is specified. diff --git a/examples/e2e-tests/kubernetes/node-count/50-nodes/definition.json b/examples/e2e-tests/kubernetes/node-count/50-nodes/definition.json index ffae6e53a..746363db1 100644 --- a/examples/e2e-tests/kubernetes/node-count/50-nodes/definition.json +++ b/examples/e2e-tests/kubernetes/node-count/50-nodes/definition.json @@ -17,7 +17,6 @@ "count": 50, "vmSize": "Standard_D2_v2", "osType": "Linux", - "storageProfile": "ManagedDisks", "availabilityProfile": "AvailabilitySet" } ], diff --git a/examples/k8s-upgrade/v1.7.7.json b/examples/k8s-upgrade/v1.7.7.json index 346733f9e..eff3c00c6 100644 --- a/examples/k8s-upgrade/v1.7.7.json +++ b/examples/k8s-upgrade/v1.7.7.json @@ -8,23 +8,20 @@ "masterProfile": { "count": 3, "dnsPrefix": "", - "vmSize": "Standard_D2_v2", - "storageProfile" : "ManagedDisks" + "vmSize": "Standard_D2_v2" }, "agentPoolProfiles": [ { "name": "agentpool1", "count": 2, "vmSize": "Standard_D2_v2", - "availabilityProfile": "AvailabilitySet", - "storageProfile" : "ManagedDisks" + "availabilityProfile": "AvailabilitySet" }, { "name": "agentpool2", "count": 3, "vmSize": "Standard_D2_v2", - "availabilityProfile": "AvailabilitySet", - "storageProfile" : "ManagedDisks" + "availabilityProfile": "AvailabilitySet" } ], "linuxProfile": { diff --git a/examples/k8s-upgrade/v1.7.9-hybrid.json b/examples/k8s-upgrade/v1.7.9-hybrid.json index 2b8de88e1..8f0286bb4 100644 --- a/examples/k8s-upgrade/v1.7.9-hybrid.json +++ b/examples/k8s-upgrade/v1.7.9-hybrid.json @@ -8,8 +8,7 @@ "masterProfile": { "count": 1, "dnsPrefix": "", - "vmSize": "Standard_D2_v2", - "storageProfile" : "ManagedDisks" + "vmSize": "Standard_D2_v2" }, "agentPoolProfiles": [ { @@ -17,15 +16,13 @@ "count": 2, "vmSize": "Standard_D2_v2", "availabilityProfile": "AvailabilitySet", - "storageProfile" : "ManagedDisks", "osType": "Windows" }, { "name": "agentpool2", "count": 1, "vmSize": "Standard_D2_v2", - "availabilityProfile": "AvailabilitySet", - "storageProfile" : "ManagedDisks" + "availabilityProfile": "AvailabilitySet" } ], "windowsProfile": { diff --git a/examples/k8s-upgrade/v1.7.9-win.json b/examples/k8s-upgrade/v1.7.9-win.json index 331b48b10..b8013dbe7 100644 --- a/examples/k8s-upgrade/v1.7.9-win.json +++ b/examples/k8s-upgrade/v1.7.9-win.json @@ -8,8 +8,7 @@ "masterProfile": { "count": 1, "dnsPrefix": "", - "vmSize": "Standard_D2_v2", - "storageProfile" : "ManagedDisks" + "vmSize": "Standard_D2_v2" }, "agentPoolProfiles": [ { @@ -17,6 +16,7 @@ "count": 1, "vmSize": "Standard_D2_v2", "availabilityProfile": "AvailabilitySet", + "storageProfile": "StorageAccount", "osType": "Windows" }, { @@ -24,7 +24,6 @@ "count": 2, "vmSize": "Standard_D2_v2", "availabilityProfile": "AvailabilitySet", - "storageProfile" : "ManagedDisks", "osType": "Windows" } ], diff --git a/examples/k8s-upgrade/v1.7.9.json b/examples/k8s-upgrade/v1.7.9.json index cde577c0c..65b537a34 100644 --- a/examples/k8s-upgrade/v1.7.9.json +++ b/examples/k8s-upgrade/v1.7.9.json @@ -8,22 +8,21 @@ "masterProfile": { "count": 1, "dnsPrefix": "", - "vmSize": "Standard_D2_v2", - "storageProfile" : "ManagedDisks" + "vmSize": "Standard_D2_v2" }, "agentPoolProfiles": [ { "name": "agentpool1", "count": 1, "vmSize": "Standard_D2_v2", - "availabilityProfile": "AvailabilitySet" + "availabilityProfile": "AvailabilitySet", + "storageProfile": "StorageAccount" }, { "name": "agentpool2", "count": 2, "vmSize": "Standard_D2_v2", - "availabilityProfile": "AvailabilitySet", - "storageProfile" : "ManagedDisks" + "availabilityProfile": "AvailabilitySet" } ], "linuxProfile": { diff --git a/examples/k8s-upgrade/v1.8.4.json b/examples/k8s-upgrade/v1.8.4.json index 74911e12f..b4c3b833c 100644 --- a/examples/k8s-upgrade/v1.8.4.json +++ b/examples/k8s-upgrade/v1.8.4.json @@ -8,23 +8,20 @@ "masterProfile": { "count": 3, "dnsPrefix": "", - "vmSize": "Standard_D2_v2", - "storageProfile" : "ManagedDisks" + "vmSize": "Standard_D2_v2" }, "agentPoolProfiles": [ { "name": "agentpool1", "count": 2, "vmSize": "Standard_D2_v2", - "availabilityProfile": "AvailabilitySet", - "storageProfile" : "ManagedDisks" + "availabilityProfile": "AvailabilitySet" }, { "name": "agentpool2", "count": 1, "vmSize": "Standard_D2_v2", - "availabilityProfile": "AvailabilitySet", - "storageProfile" : "ManagedDisks" + "availabilityProfile": "AvailabilitySet" } ], "linuxProfile": { diff --git a/examples/kubernetes-config/kubernetes-private-cluster-single-master.json b/examples/kubernetes-config/kubernetes-private-cluster-single-master.json index 6aeb6fbb2..8a6673c4f 100644 --- a/examples/kubernetes-config/kubernetes-private-cluster-single-master.json +++ b/examples/kubernetes-config/kubernetes-private-cluster-single-master.json @@ -10,7 +10,6 @@ "name": "my-jb", "vmSize": "Standard_D2_v2", "diskSizeGB": 30, - "storageProfile": "ManagedDisks", "username": "azureuser", "publicKey": "" } diff --git a/examples/kubernetes-config/kubernetes-private-cluster.json b/examples/kubernetes-config/kubernetes-private-cluster.json index d6da51d69..2b214b92f 100644 --- a/examples/kubernetes-config/kubernetes-private-cluster.json +++ b/examples/kubernetes-config/kubernetes-private-cluster.json @@ -10,7 +10,6 @@ "name": "my-jb", "vmSize": "Standard_D2_v2", "diskSizeGB": 30, - "storageProfile": "ManagedDisks", "username": "azureuser", "publicKey": "" } diff --git a/examples/windows/kubernetes-custom-image.json b/examples/windows/kubernetes-custom-image.json index 45b513996..9c92ebb86 100644 --- a/examples/windows/kubernetes-custom-image.json +++ b/examples/windows/kubernetes-custom-image.json @@ -15,7 +15,6 @@ "count": 2, "vmSize": "Standard_D2_v2", "availabilityProfile": "AvailabilitySet", - "storageProfile": "ManagedDisks", "osType": "Windows" } ], diff --git a/pkg/acsengine/defaults.go b/pkg/acsengine/defaults.go index 3c1695754..525b9dbb7 100644 --- a/pkg/acsengine/defaults.go +++ b/pkg/acsengine/defaults.go @@ -511,7 +511,7 @@ func setOrchestratorDefaults(cs *api.ContainerService) { } if a.OrchestratorProfile.KubernetesConfig.PrivateJumpboxProvision() && a.OrchestratorProfile.KubernetesConfig.PrivateCluster.JumpboxProfile.StorageProfile == "" { - a.OrchestratorProfile.KubernetesConfig.PrivateCluster.JumpboxProfile.StorageProfile = api.StorageAccount + a.OrchestratorProfile.KubernetesConfig.PrivateCluster.JumpboxProfile.StorageProfile = api.ManagedDisks } if a.OrchestratorProfile.KubernetesConfig.EnableRbac == nil { @@ -716,11 +716,19 @@ func setAgentNetworkDefaults(a *api.Properties) { // setStorageDefaults for agents func setStorageDefaults(a *api.Properties) { if a.MasterProfile != nil && len(a.MasterProfile.StorageProfile) == 0 { - a.MasterProfile.StorageProfile = api.StorageAccount + if a.OrchestratorProfile.OrchestratorType == api.Kubernetes { + a.MasterProfile.StorageProfile = api.ManagedDisks + } else { + a.MasterProfile.StorageProfile = api.StorageAccount + } } for _, profile := range a.AgentPoolProfiles { if len(profile.StorageProfile) == 0 { - profile.StorageProfile = api.StorageAccount + if a.OrchestratorProfile.OrchestratorType == api.Kubernetes { + profile.StorageProfile = api.ManagedDisks + } else { + profile.StorageProfile = api.StorageAccount + } } if len(profile.AvailabilityProfile) == 0 { profile.AvailabilityProfile = api.VirtualMachineScaleSets diff --git a/pkg/acsengine/defaults_test.go b/pkg/acsengine/defaults_test.go index 0801ea330..57b1d996d 100644 --- a/pkg/acsengine/defaults_test.go +++ b/pkg/acsengine/defaults_test.go @@ -448,6 +448,39 @@ func TestNetworkPolicyDefaults(t *testing.T) { } } +func TestStorageProfile(t *testing.T) { + // Test ManagedDisks default configuration + mockCS := getMockBaseContainerService("1.8.10") + properties := mockCS.Properties + properties.OrchestratorProfile.OrchestratorType = "Kubernetes" + properties.MasterProfile.Count = 1 + properties.OrchestratorProfile.KubernetesConfig.PrivateCluster = &api.PrivateCluster{ + Enabled: helpers.PointerToBool(true), + JumpboxProfile: &api.PrivateJumpboxProfile{}, + } + SetPropertiesDefaults(&mockCS, false) + if properties.MasterProfile.StorageProfile != api.ManagedDisks { + t.Fatalf("MasterProfile.StorageProfile did not have the expected configuration, got %s, expected %s", + properties.MasterProfile.StorageProfile, api.ManagedDisks) + } + if !properties.MasterProfile.IsManagedDisks() { + t.Fatalf("MasterProfile.StorageProfile did not have the expected configuration, got %t, expected %t", + false, true) + } + if properties.AgentPoolProfiles[0].StorageProfile != api.ManagedDisks { + t.Fatalf("AgentPoolProfile.StorageProfile did not have the expected configuration, got %s, expected %s", + properties.AgentPoolProfiles[0].StorageProfile, api.ManagedDisks) + } + if !properties.AgentPoolProfiles[0].IsManagedDisks() { + t.Fatalf("AgentPoolProfile.IsManagedDisks() did not have the expected configuration, got %t, expected %t", + false, true) + } + if properties.OrchestratorProfile.KubernetesConfig.PrivateCluster.JumpboxProfile.StorageProfile != api.ManagedDisks { + t.Fatalf("MasterProfile.StorageProfile did not have the expected configuration, got %s, expected %s", + properties.OrchestratorProfile.KubernetesConfig.PrivateCluster.JumpboxProfile.StorageProfile, api.ManagedDisks) + } +} + func getMockAddon(name string) api.KubernetesAddon { return api.KubernetesAddon{ Name: name,