Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
change default azure disk storage class for managed disk cluster (#1817)
Browse files Browse the repository at this point in the history
* change default storage class for managed disk cluster

* change unmanaged-standard to managed-standard class
  • Loading branch information
andyzhangx authored and jackfrancis committed Nov 28, 2017
1 parent 78d158e commit 8d39c8c
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
36 changes: 36 additions & 0 deletions parts/kubernetesmasteraddons-managed-azure-storage-classes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: storage.k8s.io/v1beta1
kind: StorageClass
metadata:
name: default
annotations:
storageclass.beta.kubernetes.io/is-default-class: "true"
labels:
kubernetes.io/cluster-service: "true"
provisioner: kubernetes.io/azure-disk
parameters:
kind: Managed
storageaccounttype: Standard_LRS
---
apiVersion: storage.k8s.io/v1beta1
kind: StorageClass
metadata:
name: managed-premium
annotations:
labels:
kubernetes.io/cluster-service: "true"
provisioner: kubernetes.io/azure-disk
parameters:
kind: Managed
storageaccounttype: Premium_LRS
---
apiVersion: storage.k8s.io/v1beta1
kind: StorageClass
metadata:
name: managed-standard
annotations:
labels:
kubernetes.io/cluster-service: "true"
provisioner: kubernetes.io/azure-disk
parameters:
kind: Managed
storageaccounttype: Standard_LRS
10 changes: 8 additions & 2 deletions pkg/acsengine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ const (

swarmModeProvision = "configure-swarmmode-cluster.sh"
swarmModeWindowsProvision = "Join-SwarmMode-cluster.ps1"

masterAddonAzureStorageClasses = "MASTER_ADDON_AZURE_STORAGE_CLASSES_B64_GZIP_STR"
masterAddonAzureStorageClassesFileUnmanaged = "kubernetesmasteraddons-unmanaged-azure-storage-classes.yaml"
masterAddonAzureStorageClassesFileManaged = "kubernetesmasteraddons-managed-azure-storage-classes.yaml"
)

const (
Expand Down Expand Up @@ -120,7 +124,7 @@ var kubernetesAddonYamls = map[string]string{
"MASTER_ADDON_KUBE_DNS_DEPLOYMENT_B64_GZIP_STR": "kubernetesmasteraddons-kube-dns-deployment.yaml",
"MASTER_ADDON_KUBE_PROXY_DAEMONSET_B64_GZIP_STR": "kubernetesmasteraddons-kube-proxy-daemonset.yaml",
"MASTER_ADDON_KUBERNETES_DASHBOARD_DEPLOYMENT_B64_GZIP_STR": "kubernetesmasteraddons-kubernetes-dashboard-deployment.yaml",
"MASTER_ADDON_AZURE_STORAGE_CLASSES_B64_GZIP_STR": "kubernetesmasteraddons-azure-storage-classes.yaml",
masterAddonAzureStorageClasses: masterAddonAzureStorageClassesFileUnmanaged,
"MASTER_ADDON_TILLER_DEPLOYMENT_B64_GZIP_STR": "kubernetesmasteraddons-tiller-deployment.yaml",
"MASTER_ADDON_RESCHEDULER_DEPLOYMENT_B64_GZIP_STR": "kubernetesmasteraddons-kube-rescheduler-deployment.yaml",
}
Expand All @@ -130,7 +134,7 @@ var kubernetesAddonYamls15 = map[string]string{
"MASTER_ADDON_KUBE_DNS_DEPLOYMENT_B64_GZIP_STR": "kubernetesmasteraddons-kube-dns-deployment1.5.yaml",
"MASTER_ADDON_KUBE_PROXY_DAEMONSET_B64_GZIP_STR": "kubernetesmasteraddons-kube-proxy-daemonset1.5.yaml",
"MASTER_ADDON_KUBERNETES_DASHBOARD_DEPLOYMENT_B64_GZIP_STR": "kubernetesmasteraddons-kubernetes-dashboard-deployment1.5.yaml",
"MASTER_ADDON_AZURE_STORAGE_CLASSES_B64_GZIP_STR": "kubernetesmasteraddons-azure-storage-classes.yaml",
masterAddonAzureStorageClasses: masterAddonAzureStorageClassesFileUnmanaged,
"MASTER_ADDON_TILLER_DEPLOYMENT_B64_GZIP_STR": "kubernetesmasteraddons-tiller-deployment1.5.yaml",
}

Expand Down Expand Up @@ -828,6 +832,8 @@ func (t *TemplateGenerator) getTemplateFuncMap(cs *api.ContainerService) templat
if profile.StorageProfile == api.ManagedDisks {
storagetier, _ := getStorageAccountType(profile.VMSize)
buf.WriteString(fmt.Sprintf(",storageprofile=managed,storagetier=%s", storagetier))
// change default storage class for managed disk agent pool
kubernetesAddonYamls[masterAddonAzureStorageClasses] = masterAddonAzureStorageClassesFileManaged
}
buf.WriteString(fmt.Sprintf(",kubernetes.azure.com/cluster=%s", rg))
for k, v := range profile.CustomNodeLabels {
Expand Down

0 comments on commit 8d39c8c

Please sign in to comment.