Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial outline of userdata plugin handling * Add head comment * Start with plugin registration process * Change discovery strategy of plugins * More robust start of the plugin manager and change to net/rpc * Add plugin counterpart for the userdata manager * Minor fixes in manager and plugin, migrate CentOS plugin * Fix comment * Add test for CentOS userdata plugin * Migrate CoreOS userdata provider to new plugin * Add Ubuntu UserData plugin and do some harmonization between implementations * Remove old providers * Finish userdata and plugins, dependencies and Makefile still missing * Extract userdata os configuration into own package * More compatible OS configuration changes * Fixes and adding plugins to Makefile * Add check for already running plugins * Add deploying of plugins * Fix missing plugin copy in Dockerfile * Test with explicit plugin names * Fix linter troubles * Some more handling of linter and deployment feedback * Fix error in plugin find function * Be more chatty when looking for plugin * Test plugin deployment * Fix wrong placement of test * Change plugin loading to lazy mode * Copy plugins before e2e tests * Check /usr/local/bin * Temporary change loading for test that locally works * Change plugins from daemons to individual command calls * Fix error formatting and move loading for debugging * Enhance plugin search with ENV variable and add some debugging output * Correctly propagate userdata plugin output * Dont try to marshal an interface * Update tests * Fix review comments * Add required ignition wrapping to coreos userdata provider * Rename plugin API package * Handle review comments * Some more simplifications * Code reorg after review * Code reorg after review and discussion * Handle format errors * Change of import blocks to std, 3rd party, k8s, loodse * Change indent (dunno why it changes before) * Final fixes after review
- Loading branch information
1 parent
ec87a42
commit fdcc62a
Showing
27 changed files
with
995 additions
and
333 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// UserData plugin for CentOS. | ||
// | ||
|
||
package main | ||
|
||
import ( | ||
"flag" | ||
|
||
"github.com/golang/glog" | ||
|
||
"github.com/kubermatic/machine-controller/pkg/userdata/centos" | ||
userdataplugin "github.com/kubermatic/machine-controller/pkg/userdata/plugin" | ||
) | ||
|
||
func main() { | ||
// Parse flags. | ||
var debug bool | ||
|
||
flag.BoolVar(&debug, "debug", false, "Switch for enabling the plugin debugging") | ||
flag.Parse() | ||
|
||
// Instantiate provider and start plugin. | ||
var provider = ¢os.Provider{} | ||
var p = userdataplugin.New(provider, debug) | ||
|
||
if err := p.Run(); err != nil { | ||
glog.Fatalf("error running CentOS plugin: %v", err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// UserData plugin for CoreOS. | ||
// | ||
|
||
package main | ||
|
||
import ( | ||
"flag" | ||
|
||
"github.com/golang/glog" | ||
|
||
"github.com/kubermatic/machine-controller/pkg/userdata/convert" | ||
"github.com/kubermatic/machine-controller/pkg/userdata/coreos" | ||
userdataplugin "github.com/kubermatic/machine-controller/pkg/userdata/plugin" | ||
) | ||
|
||
func main() { | ||
// Parse flags. | ||
var debug bool | ||
|
||
flag.BoolVar(&debug, "debug", false, "Switch for enabling the plugin debugging") | ||
flag.Parse() | ||
|
||
// Instantiate provider and start plugin. | ||
var provider = &coreos.Provider{} | ||
var p = userdataplugin.New(convert.NewIgnition(provider), debug) | ||
|
||
if err := p.Run(); err != nil { | ||
glog.Fatalf("error running CoreOS plugin: %v", err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// UserData plugin for Ubuntu. | ||
// | ||
|
||
package main | ||
|
||
import ( | ||
"flag" | ||
|
||
"github.com/golang/glog" | ||
|
||
userdataplugin "github.com/kubermatic/machine-controller/pkg/userdata/plugin" | ||
"github.com/kubermatic/machine-controller/pkg/userdata/ubuntu" | ||
) | ||
|
||
func main() { | ||
// Parse flags. | ||
var debug bool | ||
|
||
flag.BoolVar(&debug, "debug", false, "Switch for enabling the plugin debugging") | ||
flag.Parse() | ||
|
||
// Instantiate provider and start plugin. | ||
var provider = &ubuntu.Provider{} | ||
var p = userdataplugin.New(provider, debug) | ||
|
||
if err := p.Run(); err != nil { | ||
glog.Fatalf("error running Ubuntu plugin: %v", err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// Environment and serialisation types for UserData plugins. | ||
// | ||
|
||
package plugin | ||
|
||
import ( | ||
"net" | ||
|
||
clientcmdapi "k8s.io/client-go/tools/clientcmd/api" | ||
clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" | ||
) | ||
|
||
const ( | ||
// EnvUserDataRequest names the environment variable containing | ||
// the user data request. | ||
EnvUserDataRequest = "MACHINE_CONTROLLER_USER_DATA_REQUEST" | ||
|
||
// EnvPluginDir names the environment variable containing | ||
// a user defined location of the plugins. | ||
EnvPluginDir = "MACHINE_CONTROLLER_USERDATA_PLUGIN_DIR" | ||
) | ||
|
||
// UserDataRequest requests user data with the given arguments. | ||
type UserDataRequest struct { | ||
MachineSpec clusterv1alpha1.MachineSpec | ||
KubeConfig *clientcmdapi.Config | ||
CloudProviderName string | ||
CloudConfig string | ||
DNSIPs []net.IP | ||
ExternalCloudProvider bool | ||
} | ||
|
||
// UserDataResponse contains the responded user data. | ||
type UserDataResponse struct { | ||
UserData string | ||
Err string | ||
} | ||
|
||
// ErrorResponse contains a single responded error. | ||
type ErrorResponse struct { | ||
Err string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.