2014-11-23 15:47:25 +00:00
|
|
|
/*
|
2016-06-03 00:25:58 +00:00
|
|
|
Copyright 2014 The Kubernetes Authors.
|
2014-11-23 15:47:25 +00:00
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2015-02-07 21:30:53 +00:00
|
|
|
package app
|
2014-11-23 15:47:25 +00:00
|
|
|
|
|
|
|
// This file exists to force the desired plugin implementations to be linked.
|
|
|
|
import (
|
|
|
|
// Credential providers
|
2016-01-09 00:02:05 +00:00
|
|
|
_ "k8s.io/kubernetes/pkg/credentialprovider/aws"
|
2016-12-07 07:16:53 +00:00
|
|
|
_ "k8s.io/kubernetes/pkg/credentialprovider/azure"
|
2015-08-05 22:03:47 +00:00
|
|
|
_ "k8s.io/kubernetes/pkg/credentialprovider/gcp"
|
2017-03-07 00:24:14 +00:00
|
|
|
_ "k8s.io/kubernetes/pkg/credentialprovider/rancher"
|
2015-03-19 23:14:13 +00:00
|
|
|
// Network plugins
|
2015-08-05 22:03:47 +00:00
|
|
|
"k8s.io/kubernetes/pkg/kubelet/network"
|
2015-09-09 21:00:41 +00:00
|
|
|
"k8s.io/kubernetes/pkg/kubelet/network/cni"
|
2015-12-16 23:31:10 +00:00
|
|
|
"k8s.io/kubernetes/pkg/kubelet/network/kubenet"
|
2014-11-23 15:47:25 +00:00
|
|
|
// Volume plugins
|
2015-08-05 22:03:47 +00:00
|
|
|
"k8s.io/kubernetes/pkg/volume"
|
|
|
|
"k8s.io/kubernetes/pkg/volume/aws_ebs"
|
2016-07-27 18:07:34 +00:00
|
|
|
"k8s.io/kubernetes/pkg/volume/azure_dd"
|
2015-11-13 16:47:04 +00:00
|
|
|
"k8s.io/kubernetes/pkg/volume/azure_file"
|
2015-04-09 18:05:24 +00:00
|
|
|
"k8s.io/kubernetes/pkg/volume/cephfs"
|
2015-04-10 16:54:01 +00:00
|
|
|
"k8s.io/kubernetes/pkg/volume/cinder"
|
2016-01-25 19:41:16 +00:00
|
|
|
"k8s.io/kubernetes/pkg/volume/configmap"
|
2015-02-20 05:36:23 +00:00
|
|
|
"k8s.io/kubernetes/pkg/volume/downwardapi"
|
2015-08-05 22:03:47 +00:00
|
|
|
"k8s.io/kubernetes/pkg/volume/empty_dir"
|
2015-08-11 15:19:29 +00:00
|
|
|
"k8s.io/kubernetes/pkg/volume/fc"
|
2015-09-30 18:31:53 +00:00
|
|
|
"k8s.io/kubernetes/pkg/volume/flexvolume"
|
2015-09-25 19:22:23 +00:00
|
|
|
"k8s.io/kubernetes/pkg/volume/flocker"
|
2015-08-05 22:03:47 +00:00
|
|
|
"k8s.io/kubernetes/pkg/volume/gce_pd"
|
|
|
|
"k8s.io/kubernetes/pkg/volume/git_repo"
|
|
|
|
"k8s.io/kubernetes/pkg/volume/glusterfs"
|
|
|
|
"k8s.io/kubernetes/pkg/volume/host_path"
|
|
|
|
"k8s.io/kubernetes/pkg/volume/iscsi"
|
2017-05-12 07:15:49 +00:00
|
|
|
"k8s.io/kubernetes/pkg/volume/local"
|
2015-08-05 22:03:47 +00:00
|
|
|
"k8s.io/kubernetes/pkg/volume/nfs"
|
2016-11-03 05:31:47 +00:00
|
|
|
"k8s.io/kubernetes/pkg/volume/photon_pd"
|
2016-12-19 23:17:11 +00:00
|
|
|
"k8s.io/kubernetes/pkg/volume/portworx"
|
2016-11-10 22:33:06 +00:00
|
|
|
"k8s.io/kubernetes/pkg/volume/projected"
|
2016-04-20 08:38:19 +00:00
|
|
|
"k8s.io/kubernetes/pkg/volume/quobyte"
|
2015-08-05 22:03:47 +00:00
|
|
|
"k8s.io/kubernetes/pkg/volume/rbd"
|
2016-11-19 20:46:23 +00:00
|
|
|
"k8s.io/kubernetes/pkg/volume/scaleio"
|
2015-08-05 22:03:47 +00:00
|
|
|
"k8s.io/kubernetes/pkg/volume/secret"
|
2016-04-14 00:36:05 +00:00
|
|
|
"k8s.io/kubernetes/pkg/volume/vsphere_volume"
|
2016-01-05 07:16:18 +00:00
|
|
|
// Cloud providers
|
2015-08-12 05:36:51 +00:00
|
|
|
_ "k8s.io/kubernetes/pkg/cloudprovider/providers"
|
2014-11-23 15:47:25 +00:00
|
|
|
)
|
|
|
|
|
2015-02-02 21:30:31 +00:00
|
|
|
// ProbeVolumePlugins collects all volume plugins into an easy to use list.
|
2015-09-30 18:31:53 +00:00
|
|
|
// PluginDir specifies the directory to search for additional third party
|
|
|
|
// volume plugins.
|
|
|
|
func ProbeVolumePlugins(pluginDir string) []volume.VolumePlugin {
|
2015-03-19 05:18:31 +00:00
|
|
|
allPlugins := []volume.VolumePlugin{}
|
2014-11-23 15:47:25 +00:00
|
|
|
|
|
|
|
// The list of plugins to probe is decided by the kubelet binary, not
|
|
|
|
// by dynamic linking or other "magic". Plugins will be analyzed and
|
|
|
|
// initialized later.
|
2015-08-31 13:44:37 +00:00
|
|
|
//
|
|
|
|
// Kubelet does not currently need to configure volume plugins.
|
|
|
|
// If/when it does, see kube-controller-manager/app/plugins.go for example of using volume.VolumeConfig
|
2015-04-09 13:40:48 +00:00
|
|
|
allPlugins = append(allPlugins, aws_ebs.ProbeVolumePlugins()...)
|
2014-11-23 15:47:25 +00:00
|
|
|
allPlugins = append(allPlugins, empty_dir.ProbeVolumePlugins()...)
|
|
|
|
allPlugins = append(allPlugins, gce_pd.ProbeVolumePlugins()...)
|
|
|
|
allPlugins = append(allPlugins, git_repo.ProbeVolumePlugins()...)
|
2015-08-31 13:44:37 +00:00
|
|
|
allPlugins = append(allPlugins, host_path.ProbeVolumePlugins(volume.VolumeConfig{})...)
|
|
|
|
allPlugins = append(allPlugins, nfs.ProbeVolumePlugins(volume.VolumeConfig{})...)
|
2015-03-19 05:18:31 +00:00
|
|
|
allPlugins = append(allPlugins, secret.ProbeVolumePlugins()...)
|
2015-03-13 21:31:13 +00:00
|
|
|
allPlugins = append(allPlugins, iscsi.ProbeVolumePlugins()...)
|
2015-03-26 18:53:21 +00:00
|
|
|
allPlugins = append(allPlugins, glusterfs.ProbeVolumePlugins()...)
|
2015-04-07 17:22:23 +00:00
|
|
|
allPlugins = append(allPlugins, rbd.ProbeVolumePlugins()...)
|
2015-04-10 16:54:01 +00:00
|
|
|
allPlugins = append(allPlugins, cinder.ProbeVolumePlugins()...)
|
2016-04-20 08:38:19 +00:00
|
|
|
allPlugins = append(allPlugins, quobyte.ProbeVolumePlugins()...)
|
2015-04-09 18:05:24 +00:00
|
|
|
allPlugins = append(allPlugins, cephfs.ProbeVolumePlugins()...)
|
2015-02-20 05:36:23 +00:00
|
|
|
allPlugins = append(allPlugins, downwardapi.ProbeVolumePlugins()...)
|
2015-08-11 15:19:29 +00:00
|
|
|
allPlugins = append(allPlugins, fc.ProbeVolumePlugins()...)
|
2015-09-25 19:22:23 +00:00
|
|
|
allPlugins = append(allPlugins, flocker.ProbeVolumePlugins()...)
|
2015-09-30 18:31:53 +00:00
|
|
|
allPlugins = append(allPlugins, flexvolume.ProbeVolumePlugins(pluginDir)...)
|
2015-11-13 16:47:04 +00:00
|
|
|
allPlugins = append(allPlugins, azure_file.ProbeVolumePlugins()...)
|
2016-01-25 19:41:16 +00:00
|
|
|
allPlugins = append(allPlugins, configmap.ProbeVolumePlugins()...)
|
2016-04-14 00:36:05 +00:00
|
|
|
allPlugins = append(allPlugins, vsphere_volume.ProbeVolumePlugins()...)
|
2016-07-27 18:07:34 +00:00
|
|
|
allPlugins = append(allPlugins, azure_dd.ProbeVolumePlugins()...)
|
2016-11-03 05:31:47 +00:00
|
|
|
allPlugins = append(allPlugins, photon_pd.ProbeVolumePlugins()...)
|
2016-11-10 22:33:06 +00:00
|
|
|
allPlugins = append(allPlugins, projected.ProbeVolumePlugins()...)
|
2016-12-19 23:17:11 +00:00
|
|
|
allPlugins = append(allPlugins, portworx.ProbeVolumePlugins()...)
|
2016-11-19 20:46:23 +00:00
|
|
|
allPlugins = append(allPlugins, scaleio.ProbeVolumePlugins()...)
|
2017-05-12 07:15:49 +00:00
|
|
|
allPlugins = append(allPlugins, local.ProbeVolumePlugins()...)
|
2014-11-23 15:47:25 +00:00
|
|
|
return allPlugins
|
|
|
|
}
|
2015-03-19 23:14:13 +00:00
|
|
|
|
|
|
|
// ProbeNetworkPlugins collects all compiled-in plugins
|
2016-09-06 16:41:18 +00:00
|
|
|
func ProbeNetworkPlugins(pluginDir, cniConfDir, cniBinDir string) []network.NetworkPlugin {
|
2015-03-19 23:14:13 +00:00
|
|
|
allPlugins := []network.NetworkPlugin{}
|
|
|
|
|
2016-09-06 16:41:18 +00:00
|
|
|
// for backwards-compat, allow pluginDir as a source of CNI config files
|
|
|
|
if cniConfDir == "" {
|
|
|
|
cniConfDir = pluginDir
|
|
|
|
}
|
2017-04-19 23:22:19 +00:00
|
|
|
|
|
|
|
binDir := cniBinDir
|
|
|
|
if binDir == "" {
|
|
|
|
binDir = pluginDir
|
|
|
|
}
|
2015-03-19 23:14:13 +00:00
|
|
|
// for each existing plugin, add to the list
|
2017-04-19 23:22:19 +00:00
|
|
|
allPlugins = append(allPlugins, cni.ProbeNetworkPlugins(cniConfDir, binDir)...)
|
|
|
|
allPlugins = append(allPlugins, kubenet.NewPlugin(binDir))
|
2015-03-19 23:14:13 +00:00
|
|
|
|
|
|
|
return allPlugins
|
|
|
|
}
|