Refactor provider init (#360)

* Refactor provider init

This moves provider init out of vkubelet setup, instead preferring to
initialize vkubelet with a provider.

* Split API server configuration from setup.

This makes sure that configuration (which is done primarily through env
vars) is separate from actually standing up the servers.

This also makes sure to abort daemon initialization if the API servers
are not able to start.
This commit is contained in:
Brian Goff
2018-09-26 13:18:02 -07:00
committed by Robbie Zhang
parent 6b97713af3
commit 083f6dee05
21 changed files with 518 additions and 293 deletions

View File

@@ -0,0 +1,23 @@
// +build !no_azure_provider
package register
import (
"github.com/virtual-kubelet/virtual-kubelet/providers"
"github.com/virtual-kubelet/virtual-kubelet/providers/azure"
)
func init() {
register("azure", initAzure)
}
func initAzure(cfg InitConfig) (providers.Provider, error) {
return azure.NewACIProvider(
cfg.ConfigPath,
cfg.ResourceManager,
cfg.NodeName,
cfg.OperatingSystem,
cfg.InternalIP,
cfg.DaemonPort,
)
}