Skip to content

Commit cf1dca2

Browse files
committed
UPSTREAM: 29006: Dynamic provisioning v2beta
- it is not merged upstream yet - some changes outside of `vedor/` were needed to compile it and run it (especially pv-binder-controller got privileges to list+watch extensions/StorageClass instances)
1 parent 756a9bd commit cf1dca2

File tree

31 files changed

+846
-279
lines changed

31 files changed

+846
-279
lines changed

pkg/cmd/server/bootstrappolicy/infra_sa_policy.go

+6
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,12 @@ func init() {
506506
Verbs: sets.NewString("create", "update", "patch"),
507507
Resources: sets.NewString("events"),
508508
},
509+
// PersistentVolumeController.syncClaim() -> provisionClaim()
510+
{
511+
APIGroups: []string{extensions.GroupName},
512+
Verbs: sets.NewString("list", "watch"),
513+
Resources: sets.NewString("storageclasses"),
514+
},
509515
},
510516
},
511517
)

pkg/cmd/server/kubernetes/master.go

+6-10
Original file line numberDiff line numberDiff line change
@@ -154,20 +154,15 @@ func (c *MasterConfig) RunNamespaceController(kubeClient internalclientset.Inter
154154

155155
func (c *MasterConfig) RunPersistentVolumeController(client *client.Client, namespace, recyclerImageName, recyclerServiceAccountName string) {
156156
s := c.ControllerManager
157-
provisioner, err := kctrlmgr.NewVolumeProvisioner(c.CloudProvider, s.VolumeConfiguration)
158-
if err != nil {
159-
glog.Fatal("A Provisioner could not be created, but one was expected. Provisioning will not work. This functionality is considered an early Alpha version.")
160-
}
161-
162157
volumeController := persistentvolumecontroller.NewPersistentVolumeController(
163158
clientadapter.FromUnversionedClient(client),
164159
s.PVClaimBinderSyncPeriod.Duration,
165-
provisioner,
166-
probeRecyclableVolumePlugins(s.VolumeConfiguration, namespace, recyclerImageName, recyclerServiceAccountName),
160+
probeControllerVolumePlugins(s.VolumeConfiguration, namespace, recyclerImageName, recyclerServiceAccountName),
167161
c.CloudProvider,
168162
s.ClusterName,
169-
nil, nil, nil,
163+
nil, nil, nil, nil,
170164
s.VolumeConfiguration.EnableDynamicProvisioning,
165+
"",
171166
)
172167
volumeController.Run()
173168

@@ -187,8 +182,8 @@ func (c *MasterConfig) RunPersistentVolumeController(client *client.Client, name
187182
}
188183
}
189184

190-
// probeRecyclableVolumePlugins collects all persistent volume plugins into an easy to use list.
191-
func probeRecyclableVolumePlugins(config componentconfig.VolumeConfiguration, namespace, recyclerImageName, recyclerServiceAccountName string) []volume.VolumePlugin {
185+
// probeControllerVolumePlugins collects all persistent volume plugins into an easy to use list.
186+
func probeControllerVolumePlugins(config componentconfig.VolumeConfiguration, namespace, recyclerImageName, recyclerServiceAccountName string) []volume.VolumePlugin {
192187
uid := int64(0)
193188
defaultScrubPod := volume.NewPersistentVolumeRecyclerPodTemplate()
194189
defaultScrubPod.Namespace = namespace
@@ -214,6 +209,7 @@ func probeRecyclableVolumePlugins(config componentconfig.VolumeConfiguration, na
214209
RecyclerMinimumTimeout: int(config.PersistentVolumeRecyclerConfiguration.MinimumTimeoutHostPath),
215210
RecyclerTimeoutIncrement: int(config.PersistentVolumeRecyclerConfiguration.IncrementTimeoutHostPath),
216211
RecyclerPodTemplate: defaultScrubPod,
212+
ProvisioningEnabled: config.EnableHostPathProvisioning,
217213
}
218214
if err := kctrlmgr.AttemptToLoadRecycler(config.PersistentVolumeRecyclerConfiguration.PodTemplateFilePathHostPath, &hostPathConfig); err != nil {
219215
glog.Fatalf("Could not create hostpath recycler pod from file %s: %+v", config.PersistentVolumeRecyclerConfiguration.PodTemplateFilePathHostPath, err)

test/testdata/bootstrappolicy/bootstrap_cluster_roles.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -2660,6 +2660,14 @@ items:
26602660
- create
26612661
- patch
26622662
- update
2663+
- apiGroups:
2664+
- extensions
2665+
attributeRestrictions: null
2666+
resources:
2667+
- storageclasses
2668+
verbs:
2669+
- list
2670+
- watch
26632671
- apiVersion: v1
26642672
kind: ClusterRole
26652673
metadata:

vendor/k8s.io/kubernetes/cmd/kube-controller-manager/app/controllermanager.go

+5-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/k8s.io/kubernetes/cmd/kube-controller-manager/app/plugins.go

+10-22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/k8s.io/kubernetes/examples/experimental/persistent-volume-provisioning/README.md

+47-23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/k8s.io/kubernetes/examples/experimental/persistent-volume-provisioning/aws-ebs.yaml

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/k8s.io/kubernetes/examples/experimental/persistent-volume-provisioning/claim1.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/k8s.io/kubernetes/examples/experimental/persistent-volume-provisioning/claim2.json

-20
This file was deleted.

vendor/k8s.io/kubernetes/examples/experimental/persistent-volume-provisioning/gce-pd.yaml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)