From 636f93393be29f8559edbb842546b5a6437b087a Mon Sep 17 00:00:00 2001 From: Abrar Shivani Date: Mon, 1 May 2017 18:35:21 -0700 Subject: [PATCH] Add vsphere default storage class --- .../storage-vsphere.addons.k8s.io/v1.6.0.yaml | 24 +++++++++++++++++++ .../pkg/fi/cloudup/bootstrapchannelbuilder.go | 10 +++++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 upup/models/cloudup/resources/addons/storage-vsphere.addons.k8s.io/v1.6.0.yaml diff --git a/upup/models/cloudup/resources/addons/storage-vsphere.addons.k8s.io/v1.6.0.yaml b/upup/models/cloudup/resources/addons/storage-vsphere.addons.k8s.io/v1.6.0.yaml new file mode 100644 index 0000000000000..b98e58b05b15c --- /dev/null +++ b/upup/models/cloudup/resources/addons/storage-vsphere.addons.k8s.io/v1.6.0.yaml @@ -0,0 +1,24 @@ +apiVersion: storage.k8s.io/v1beta1 +kind: StorageClass +metadata: + name: default + labels: + k8s-addon: storage-vsphere.addons.k8s.io +provisioner: kubernetes.io/vsphere-volume +parameters: + diskformat: thin + +--- + +apiVersion: storage.k8s.io/v1beta1 +kind: StorageClass +metadata: + name: thin + annotations: + storageclass.beta.kubernetes.io/is-default-class: "true" + labels: + k8s-addon: storage-vsphere.addons.k8s.io +provisioner: kubernetes.io/vsphere-volume +parameters: + diskformat: thin + diff --git a/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go b/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go index a525a0e69541e..3329fe7d7d5fe 100644 --- a/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go +++ b/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go @@ -173,7 +173,15 @@ func (b *BootstrapChannelBuilder) buildManifest() (*channelsapi.Addons, map[stri } { - key := "storage-aws.addons.k8s.io" + var key string + + switch fi.CloudProviderID(b.cluster.Spec.CloudProvider) { + case fi.CloudProviderVSphere: + key = "storage-vsphere.addons.k8s.io" + case fi.CloudProviderAWS: + key = "storage-aws.addons.k8s.io" + } + version := "1.6.0" location := key + "/v" + version + ".yaml"