Skip to content

Gate fail-swap-on flag with a version check #17410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/cmd/server/admin/create_nodeconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ type CreateNodeConfigOptions struct {
DNSRecursiveResolvConf string
ListenAddr flagtypes.Addr

KubeletArguments map[string][]string

ClientCertFile string
ClientKeyFile string
ServerCertFile string
Expand Down Expand Up @@ -420,6 +422,8 @@ func (o CreateNodeConfigOptions) MakeNodeConfig(serverCertFile, serverKeyFile, n
NetworkPluginName: o.NetworkPluginName,
},

KubeletArguments: o.KubeletArguments,

EnableUnidling: true,
}

Expand Down
4 changes: 4 additions & 0 deletions pkg/cmd/server/start/start_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,10 @@ func (o NodeOptions) createNodeConfig() (string, error) {
APIServerURL: masterAddr.String(),
APIServerCAFiles: []string{admin.DefaultCABundleFile(o.NodeArgs.MasterCertDir)},

KubeletArguments: map[string][]string{
"fail-swap-on": {"false"},
},

NodeClientCAFile: getSignerOptions.CertFile,
ExpireDays: o.ExpireDays,
Output: cmdutil.NewGLogWriterV(3),
Expand Down
7 changes: 3 additions & 4 deletions pkg/oc/bootstrap/docker/openshift/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -887,9 +887,6 @@ func (h *Helper) updateConfig(configDir string, opt *StartOptions) error {
nodeCfg.DNSIP = ""
}
nodeCfg.DNSBindAddress = ""
if nodeCfg.KubeletArguments == nil {
nodeCfg.KubeletArguments = configapi.ExtendedArguments{}
}

if h.supportsCgroupDriver() {
// Set the cgroup driver from the current docker
Expand All @@ -898,9 +895,11 @@ func (h *Helper) updateConfig(configDir string, opt *StartOptions) error {
return err
}
glog.V(5).Infof("cgroup driver from Docker: %s", cgroupDriver)
if nodeCfg.KubeletArguments == nil {
nodeCfg.KubeletArguments = configapi.ExtendedArguments{}
}
nodeCfg.KubeletArguments["cgroup-driver"] = []string{cgroupDriver}
}
nodeCfg.KubeletArguments["fail-swap-on"] = []string{"false"}

cfgBytes, err = configapilatest.WriteYAML(nodeCfg)
if err != nil {
Expand Down