Skip to content

Commit

Permalink
UPSTREAM: 29006: Dynamic provisioning v2beta
Browse files Browse the repository at this point in the history
- 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)
  • Loading branch information
jsafrane committed Aug 2, 2016
1 parent 756a9bd commit cf1dca2
Show file tree
Hide file tree
Showing 31 changed files with 846 additions and 279 deletions.
6 changes: 6 additions & 0 deletions pkg/cmd/server/bootstrappolicy/infra_sa_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,12 @@ func init() {
Verbs: sets.NewString("create", "update", "patch"),
Resources: sets.NewString("events"),
},
// PersistentVolumeController.syncClaim() -> provisionClaim()
{
APIGroups: []string{extensions.GroupName},
Verbs: sets.NewString("list", "watch"),
Resources: sets.NewString("storageclasses"),
},
},
},
)
Expand Down
16 changes: 6 additions & 10 deletions pkg/cmd/server/kubernetes/master.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,20 +154,15 @@ func (c *MasterConfig) RunNamespaceController(kubeClient internalclientset.Inter

func (c *MasterConfig) RunPersistentVolumeController(client *client.Client, namespace, recyclerImageName, recyclerServiceAccountName string) {
s := c.ControllerManager
provisioner, err := kctrlmgr.NewVolumeProvisioner(c.CloudProvider, s.VolumeConfiguration)
if err != nil {
glog.Fatal("A Provisioner could not be created, but one was expected. Provisioning will not work. This functionality is considered an early Alpha version.")
}

volumeController := persistentvolumecontroller.NewPersistentVolumeController(
clientadapter.FromUnversionedClient(client),
s.PVClaimBinderSyncPeriod.Duration,
provisioner,
probeRecyclableVolumePlugins(s.VolumeConfiguration, namespace, recyclerImageName, recyclerServiceAccountName),
probeControllerVolumePlugins(s.VolumeConfiguration, namespace, recyclerImageName, recyclerServiceAccountName),
c.CloudProvider,
s.ClusterName,
nil, nil, nil,
nil, nil, nil, nil,
s.VolumeConfiguration.EnableDynamicProvisioning,
"",
)
volumeController.Run()

Expand All @@ -187,8 +182,8 @@ func (c *MasterConfig) RunPersistentVolumeController(client *client.Client, name
}
}

// probeRecyclableVolumePlugins collects all persistent volume plugins into an easy to use list.
func probeRecyclableVolumePlugins(config componentconfig.VolumeConfiguration, namespace, recyclerImageName, recyclerServiceAccountName string) []volume.VolumePlugin {
// probeControllerVolumePlugins collects all persistent volume plugins into an easy to use list.
func probeControllerVolumePlugins(config componentconfig.VolumeConfiguration, namespace, recyclerImageName, recyclerServiceAccountName string) []volume.VolumePlugin {
uid := int64(0)
defaultScrubPod := volume.NewPersistentVolumeRecyclerPodTemplate()
defaultScrubPod.Namespace = namespace
Expand All @@ -214,6 +209,7 @@ func probeRecyclableVolumePlugins(config componentconfig.VolumeConfiguration, na
RecyclerMinimumTimeout: int(config.PersistentVolumeRecyclerConfiguration.MinimumTimeoutHostPath),
RecyclerTimeoutIncrement: int(config.PersistentVolumeRecyclerConfiguration.IncrementTimeoutHostPath),
RecyclerPodTemplate: defaultScrubPod,
ProvisioningEnabled: config.EnableHostPathProvisioning,
}
if err := kctrlmgr.AttemptToLoadRecycler(config.PersistentVolumeRecyclerConfiguration.PodTemplateFilePathHostPath, &hostPathConfig); err != nil {
glog.Fatalf("Could not create hostpath recycler pod from file %s: %+v", config.PersistentVolumeRecyclerConfiguration.PodTemplateFilePathHostPath, err)
Expand Down
8 changes: 8 additions & 0 deletions test/testdata/bootstrappolicy/bootstrap_cluster_roles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2660,6 +2660,14 @@ items:
- create
- patch
- update
- apiGroups:
- extensions
attributeRestrictions: null
resources:
- storageclasses
verbs:
- list
- watch
- apiVersion: v1
kind: ClusterRole
metadata:
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 10 additions & 22 deletions vendor/k8s.io/kubernetes/cmd/kube-controller-manager/app/plugins.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit cf1dca2

Please sign in to comment.